Git Product home page Git Product logo

metasearch's Introduction

geopython

Vanity package for geopython projects

pip install geopython
>>> import geopython

metasearch's People

Contributors

alexbruy avatar emiliom avatar jachym avatar kalxas avatar pcav avatar peppecorra avatar rduivenvoorde avatar tomkralidis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

metasearch's Issues

wmts failing to load

When trying to load a wmts I get the following error:

screenshot from 2014-02-14 18 07 46

To reproduce: use 'Nationaal Georegister (Nederland)" as CSW
Search for WMTS, and select for example:
TOP250raster WMTS
from the results

GetCapabilities response

When you have several services registered (2 in my case), this button does not refresh when switching from one service to another. You need to first click on the “ Service info” button so that it refreshes.

replace pygments highlighting with QScintilla

As suggested by @alexbruy, since the latter is part of QGIS core, replace pygments syntax highlighting funcitonality (contained to MetaSearch.util.highlight_xml) with something just as simple, and remove the pygments dependency and bundling for plugin.

Add ability to get search BBox from layer

Suggestion that the plugin be able to parse the BBox of a layer to use in its search query.

The suggestion comes handy when there's a reference Shapefile, KML... and there's a need to search the catalog for intersecting datasets

MetaSearch dutch repo working in QGIS master + 2.4, but not in QGIS 2.6 ?

hi Tom,

strange error, while wanting to try metasearch in my own compiled QGIS2.6 (on Debian) on our 'nationaal georegister', I get the following error:
Connection error: HTTP Error 401: Unauthorized

thinking there was something wrong with our service, i tried to connect using owslib in python... all working fine there..

Then i tried QGIS master, and that one was working, also tested 2.4 still working?

Can you please see if 2.6 is working for you?

I've tried to up/downgrade in different version:

QGIS master: OK
Installed version: 0.3.1 (in /home/richard/apps/qgis/master/debug/share/qgis/python/plugins/MetaSearch)
Available version: 0.3.2 (in QGIS Official Plugin Repository)

QGIS master: OK
Installed version: 0.3.2 (in /home/richard/.qgis2/python/plugins/MetaSearch)
Available version: 0.3.2 (in QGIS Official Plugin Repository)

QGIS 2.6: NOT OK: Connection error: HTTP Error 401: Unauthorized
Installed version: 0.3.2 (in /home/richard/.qgis2/python/plugins/MetaSearch)
Available version: 0.3.2 (in QGIS Official Plugin Repository)

QGIS 2.6: NOT OK: Connection error: HTTP Error 401: Unauthorized
Installed version: 0.3.1 (in /home/richard/apps/qgis/2.6/debug/share/qgis/python/plugins/MetaSearch)
Available version: 0.3.2 (in QGIS Official Plugin Repository)

Also testing QGIS 2.4: OK
Installed version: 0.2.0 (in /home/richard/apps/qgis/2.4/debug/share/qgis/python/plugins/MetaSearch)
Available version: 0.3.2 (in QGIS Official Plugin Repository)

Then upgrading the plugin in QGIS 2.4: OK
Installed version: 0.3.2 (in /home/richard/.qgis2/python/plugins/MetaSearch)
Available version: 0.3.2 (in QGIS Official Plugin Repository)

connection dropdowns not synced

Removing a connection in the Services tab does not update the connection dropdown in the Search tab. So removing a connection (in the Services tab) which in Search tab is the active one (or is still available) results in a Python error.

Editing the connection dropdown in the Services tab should sync immidiatly with the dropdown in the Search tab. Even better would be to reuse that widget...

harmonize settings namespace

We should harmonize the namespace for MetaSearch settings.

Looking at the QGIS registry (for Windows case), plugins use case-sensitive settings as per the plugin name, so we can use /MetaSearch/ as the top-level grouping, and s/CSWClient/MetaSearch/ thereafter.

httpcachingproxy option cause error

if i set proxy option in qgis network preferences as httpcachingproxy , the plugin doesn't work and give error:

Impossibile caricare il plugin MetaSearch a causa di errore chiamando il metodo initGui()

Traceback (most recent call last):
  File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python\qgis\utils.py", line 213, in startPlugin
    plugins[packageName].initGui()
  File "C:/Documents and Settings/SALVO/.qgis2/python/plugins\MetaSearch\plugin.py", line 106, in initGui
    self.dialog = MetaSearchDialog(self.iface)
  File "C:/Documents and Settings/SALVO/.qgis2/python/plugins\MetaSearch\dialogs\maindialog.py", line 129, in __init__
    self.manageGui()
  File "C:/Documents and Settings/SALVO/.qgis2/python/plugins\MetaSearch\dialogs\maindialog.py", line 158, in manageGui
    self.install_proxy()
  File "C:/Documents and Settings/SALVO/.qgis2/python/plugins\MetaSearch\dialogs\maindialog.py", line 883, in install_proxy
    conn = '%s://%s%s%s' % (ptype, proxy_up, host, proxy_port)
UnboundLocalError: local variable 'ptype' referenced before assignment

Versione Python:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]


Versione di QGIS:
2.2.0-Valmiera Valmiera, c3a2817

for to work i nee to set proxy option as:

httpProxy

is it possible solve the problem?

Problem when using a proxy

I installed the MetaSearch Catalogue Client plugin for QGIS and was able to test it and use it to interact with our CSW (and start optimizing our metadata).
(out CSW is this: https://www.dov.vlaanderen.be/geonetwork/srv/nl/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2 ).

However I am faced with the problem that it is not possible to use the plugin when I have to activate a proxy to allow access to the internet (which I always have to do when I'm working at my office - Belgium - Flemish government).

Is it possible to make sure that the plugin can be used when the proxy is on ?

translate error at startup

screenshot from 2014-02-24 08 22 24

running here on a master version of QGIS of a couple of days old. Getting msg above.
Is it working for others?
Is the interface of 'translate' different between different QGIS versions?

there is no hint to load default connections

after last update, all settings are changed, so I ended up as if I was a fresh user.

but because the other tabs were not working (only Services was active), I thought my plugin was frozen. Untill I thought about my settings and clicked 'Add default services'...

Should there not be a message somewhere, in case of showing of the plugin with zero connections, telling the user: "to start: either click default services, or create a new cws connection first". I know we do not like popups, but ...

rubberband for record bbox only shown on epsg:4326 map

If I'm write, I only see the data extent from a record when I'm in a project which has epsg:4326?

To reproduce:

  • load epsg:4326 data, zoom to The Netherlands
  • do empty search in MetaSearch in "nationaal georegister' csw
  • click some results in result pane (not all but some show up the red extent then)

Now do the same via:

  • search for 'achtergrond luchtfoto wms' and load the wms (in epsg:28992 project)
  • do empty search in MetaSearch in "nationaal georegister' csw
  • click some results in result pane

I never see a bbox.
Seems not to difficult to check the crs of current mapcanvas and reproject the latlon extent from the record to the mapcanvas crs

implement development workflow

use Paver to support automation of developer tasks:

  • install dependencies
  • compile .ui files
  • compile .rc files
  • install to .qgis2/python/plugins
  • clean
  • build package / .zip file
  • upload .zip file

move project to QGIS core

cc @geopython/metasearch

The team has decided to move this project into QGIS core. Given that MetaSearch is now a core QGIS plugin, it will be easier to maintain in the long run inline with QGIS, especially for mainline documentation, translation and issue tracking.

Plan:

provide a tab for Settings

It would be useful to have a settings tab, for MetaSearch configurables like:

  • connection naming
  • custom HTML output templates
  • directory path for storing downloaded files (#25)
  • custom rubber band settings (color, width, opacity)

entering on a search, makes you set extent to current bbox

in current version, if I enter a keyword to search for, and just press 'enter' (instead of clicking the 'search' button), the Xmax, Xmin, Ymax, Ymin is rewitten, to current bbox of the mapcanvas. Which when you start with an empty map is a bbox of zero meters/degrees, which makes a next search have zero results because of the (wrong) extent taken into account.

I've tried to look into the code what is triggering this, but only thing I could come up with is that the button 'Map extent' is silently activated/clicked because of the 'enter' action...

show thumbnails

Some csw services (for example geonetwork based ones) provide a thumbnail for some layers, for example wms layers.

For example using this csw:

http://www.nationaalgeoregister.nl/geonetwork/srv/eng/csw?request=GetCapabilities&service=CSW&version=2.0.2

searching for 'rce' and getting record info for 'Rijksmonumenten' will show you a link '
image/png' which is a thumbnail link to:
http://services.rce.geovoorziening.nl/www/PreviewRijksmonumentenKlein200x150.png

it would be nice to show it it somewhere...

Python Error when selecting dataset in Search Tab

I get the following error when selecting at searched dataset in Search Tab

Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 548, in record_clicked
geom.transform(ctr)
Exception: unknown

I was using the LINZ Data Service service.

after a python error the waiting cursor keeps being active

IF we have a python error (should not happen, but.... a lot of wrong metadata can do wrong...). the waiting cursor is active AND keeps active even after closing the MetaSearch dialog.

We could always put the default cursor back after closing our dialog?

Connection Error: Mismatched tag: line 57, column 3

Hi,
I've installed MetaSearch on a QGIS 2.6.0 Brighton on Mac OS 10.9.5.
I've been able to display some results (not for all) from default catalog collection.
I've tried to include mine with the URL as follow:
http://geocatalog.webservice-energy.org/geonetwork/srv/eng/csw

Though I can get successfully get the Information on the Service as well as the GetCapabilities response when I try to search for resources with or without keywords I get a pop-up window with the error as listed in the title of the email (see screenshot).

I did not see any reference to this error message in the GitHub.

Thanks for your help.

Cheers,

Lionel
capture d ecran 2014-11-04 a 12 45 49

Connection to protected services

Hi,
is it possible to connect protected services by access credentials (or services on server protected by user name & password) with MetaSearch?
I can load the same services with the "Add WMS button".
When I try to connect this kind of services, MetaSearch give me a connection errors.... ....401 - Unauthorized: Access is denied due to invalid credentials..... but I can not enter credentials.
To riproduce the problem you can try to load "Arpa Piemonte - Ortofoto AGEA 2009 - Provincia di Alessandria - (accesso riservato)" (search by keywords "AGEA (accesso riservato)") on our CSW catalog: http://webgis.arpa.piemonte.it/geoportalserver_arpa/csw?
How can solve this issue?
Many Thanks
Luca

Qt deprecation warning

When running debug-build QGIS from cli, you see the following deprecation message:

src/core/qgsmessagelog.cpp: 45: (logMessage) 2014-06-17T10:00:32 Python warning[1] warning:/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py:876: PendingDeprecationWarning: This method will be removed in future versions. Use 'elem.iter()' or 'list(elem.iter())' instead.
for include in elem.getiterator("include"):

traceback: File "", line 1, in
File "/home/richard/apps/qgis/master/debug/share/qgis/python/qgis/utils.py", line 204, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/home/richard/.qgis2/python/plugins/MetaSearch/init.py", line 35, in classFactory
from MetaSearch.plugin import MetaSearchPlugin
File "/home/richard/apps/qgis/master/debug/share/qgis/python/qgis/utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/richard/.qgis2/python/plugins/MetaSearch/plugin.py", line 33, in
from MetaSearch.dialogs.maindialog import MetaSearchDialog
File "/home/richard/apps/qgis/master/debug/share/qgis/python/qgis/utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/richard/.qgis2/python/plugins/MetaSearch/dialogs/maindialog.py", line 54, in
from MetaSearch.dialogs.manageconnectionsdialog import ManageConnectionsDialog
File "/home/richard/apps/qgis/master/debug/share/qgis/python/qgis/utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/richard/.qgis2/python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py", line 40, in
BASE_CLASS = get_ui_class('manageconnectionsdialog.ui')
File "/home/richard/.qgis2/python/plugins/MetaSearch/util.py", line 60, in get_ui_class
return loadUiType(ui_file_full)[0]
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/init.py", line 210, in loadUiType
winfo = compiler.UICompiler().compileUi(uifile, code_string, from_imports, resource_suffix)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/Compiler/compiler.py", line 139, in compileUi
w = self.parse(input_stream, resource_suffix)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 978, in parse
actor(elem)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 876, in readResources
for include in elem.getiterator("include"):

Version 0.1.1: Can not add all WMS/WFS from a CSW

Example:
From CSW:
http://www.geonorge.no/geonetwork/srv/no/csw?
The service "Nordatlas - WMS" can be added to WMS-Connections in QGIS, while the service: "Sjøpattedyr" (marine mamals) can not . Neither "art_prioriterte WMS".
The two latter have a Link:
OGC:WMS-1.1.1-http-get-map
While the first one had such a link:
OGC:WMS
Following the link of "Sjøpattedyr" in a webbrowser (http://maps.imr.no/geoserver/ows?) gives an error report. The same for "art_prioriterte WMS" (http://wms.dirnat.no/arcgis/services/art_prioriterte/mapserver/WMSServer?). However, at least the link for "Sjøpattedyr" works if entered manually to WMS in QGIS.
Following the link of "Nordatlas - WMS" leads to a blank page (http://www.nordatlas.no/wms.aspx?)...

crs of boundingbox when choosing Extent from map

When you choose to add the extent of your current map to the query, and you are currently in a non-epsg:4326 project. The bbox inputs are filled with the native values.

It would be better if those were transformed to normal epsg:4326 values

Version 0.1.1: Arrow "One step back in results" throws python error

When browsing search results, klicking on the single arrow back throws a python error:

 An error has occured while executing Python code:

Traceback (most recent call last):
  File "C:\Users\ninsbl/.qgis2/python/plugins\MetaSearch\dialogs\maindialog.py", line 572, in navigate
    if res == QMessageBox.Ok:
UnboundLocalError: local variable 'res' referenced before assignment

Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
2.0.1-Dufour Dufour, ebebdf3

QGIS 2.3 Master Ubuntu 14.04

I hope this is a good place to leave this note.

Just started running QGIS 2.3 on Ubuntu 14.04. When searching the CSW of data.gov I received this error when clicking on records.


An error has occured while executing Python code:

Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 549, in record_clicked
geom.transform(ctr)
Exception: unknown

Python version:
2.7.6 (default, Mar 22 2014, 23:03:41)
[GCC 4.8.2]

QGIS version:
2.3.0-Master Master, exported

Python path: ['/usr/share/qgis/python/plugins/processing', '/usr/share/qgis/python', u'/home/rjhale/.qgis2/python', u'/home/rjhale/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/home/rjhale/.qgis2/python/plugins/DigitizingTools/tools', '/usr/share/qgis/python/plugins/fTools/tools']


I was searching (in case you want to replicate): -87.81431 34.325558 -82.79549 36.373995 for Agriculture. Before that I searched for NAIP in the same area and received an error similar to the one above.

If I need to file this on hub.qgis I can.

Thanks for all the good work.

newlines giving strange results in our result list

It seems that certain esri filled metadata is full of newlines, giving strange results in our result list.

For example search for 'Kunst' in the Nationaal Georegister. The first record then is several lines high.

screenshot from 2014-06-06 10 43 54

If you look at the xml in a browser:
http://www.nationaalgeoregister.nl/geonetwork/srv/eng/csw?outputFormat=application%2Fxml&service=CSW&outputSchema=http%3A%2F%2Fwww.opengis.net%2Fcat%2Fcsw%2F2.0.2&request=GetRecordById&version=2.0.2&elementsetname=full&id=5687365c-b343-4820-b0df-02757ba9c85c

you see teh dc:type on one line, but if you look into the source, you see it has a lot of newlines in it:

dc:typeVector

    Simple
    Multipoint
    FALSE
    41
    TRUE
    FALSE


    Composite object
    41</dc:type>

So, isn't it best to remove newlines from this result items? Or at least from 'type' but I would think also from 'title'?

Couldn't load plugin MetaSearch due to an error when calling its classFactory() method

Just cloned the MetaSearch plugin into my .qgis2/python/plugins directory on Linux Mint running python 2.7 (QGIS 2.0.1) I get the following traceback when loading QGIS:

Couldn't load plugin MetaSearch due an error when calling its classFactory() method

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 204, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/home/jo/.qgis2/python/plugins/MetaSearch/init.py", line 79, in classFactory
from cswclient import CSWClientPlugin
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/jo/.qgis2/python/plugins/MetaSearch/cswclient.py", line 36, in
import cswclientdialog
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/jo/.qgis2/python/plugins/MetaSearch/cswclientdialog.py", line 50, in
from cswresponsedialog import CSWResponseDialog
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/jo/.qgis2/python/plugins/MetaSearch/cswresponsedialog.py", line 37, in
from ui.ui_cswresponsedialogbase import Ui_CSWResponseDialog
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named ui_cswresponsedialogbase

Python version:
2.7.3 (default, Sep 26 2013, 16:38:06)
[GCC 4.7.2]

QGIS version:
2.0.1-Dufour Dufour, exported

Python path: ['/home/jo/.qgis2/python/plugins/MetaSearch', '/home/jo/.qgis2/python/plugins/QGIS-Gazetteer-Plugin', '/usr/share/qgis/python', '/home/jo/.qgis2/python', '/home/jo/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/local/lib/python2.7/dist-packages/dulwich-0.8.7-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/hg_git-0.4.0-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

I guess that ImportError: No module named ui_cswresponsedialogbase is the important one.

Any thoughts?

Jo

URL Error messages

Hi,
I have tested MetaSearch on our catalog CSW:
http://webgis.arpa.piemonte.it/geoportalserver_arpa/csw?
When I try to connect WMS or WFS an error message appears (WMS url incorrect). After that if I chose OK and I modify the connection (without actually making any changes), and then try again, the connection works.
To riproduce the problem you can try to load "Topografica - Quadri d'unione" (search by keywords "Quadri").
How I can solve this kind of issues?
Is it a server side problem?

When I try to connect a WMTS services I get the following error and I cannot load the data:
Error connecting to OGC: WMS / OGC: WMTS: 'NoneType' object has no attribute 'find'
To riproduce the problem you can try to load "Arpa Piemonte - Sfumo_Europa_WM" (search by keywords "Sfumo_Europa_WM").
Could be the same problem discuss in this post??
#23
It's possible to try your solutions?

Many thanks
Luca

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.