Giter Site home page Giter Site logo

lutraconsulting / qgis-discovery-plugin Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 16.0 404 KB

Provides search / gazetteer functionality in QGIS using PostGIS-based data

Home Page: http://www.lutraconsulting.co.uk/products/discovery/

License: GNU General Public License v2.0

Python 99.42% Shell 0.15% Batchfile 0.43%

qgis-discovery-plugin's People

Contributors

erpas avatar gangerang avatar jctull avatar jef-n avatar mostlyatnight avatar nyalldawson avatar peterpetrik avatar saberraz avatar stratiform avatar thollands avatar thomasg77 avatar tjmgis avatar tschuettenberg avatar wonder-sk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qgis-discovery-plugin's Issues

Priorities for search results

It would be good to have support for an expression that would define priorities for different types of features. Higher priority results would be shown more to the top in the list.

Where is the config file saved?

Hi

Is the config file saved to the plugin/discovery folder as I cannot find it, or is it saved somewhere else?

Ideally we were hoping to setup multiple configs and then transfer the file to other users.

Thanks in advance

Tim

very quick and easy way to switch back end table

Just had a thought about making it easy for the user to switch the back end table as a possible enhancement.

Example: our current search plugin allows us to search a number of different back end tables selected from a drop down list (LLPG, planning applications, street gazetteer, building standards, etc)

Possible options then:
a) user manually changes plugin configuration to read new table
b) user picks a new table from drop-down list next to search box (requires some prep work in the DB to standardise field names)
c) sysadmin creates a super-table in the db combining all records from all tables in a view and results can be split out according to type (e.g. address, street record, planning application but all at the same address or with matching search string)

Open to discussion...

Errormessage after install new version

Hallo,

updating (or first install) to the new version of your very helpful plugin "discovery" from the qgis standard repository produces an errormessage during every localizing (see errormessage above). Version 1.2.1 works fine, so I turn back to this older version until the error is fixed.

Best regards
Joachim Deutmann

Traceback (most recent call last):
File "C:/Users/heinh/.qgis2/python/plugins\Discovery\discoveryplugin.py", line 267, in on_result_selected
rect_geom = QgsGeometry.fromRect(rect)
TypeError: QgsGeometry.fromRect(QgsRectangle): argument 1 has unexpected type 'NoneType'

Python-Version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS-Version:
2.8.2-Wien Wien, 1b929ef

Python-Pfad: ['C:/PROGRA1/QGISWI1/apps/qgis/./python/plugins\processing', 'C:/PROGRA1/QGISWI1/apps/qgis/./python', u'C:/Users/heinh/.qgis2/python', u'C:/Users/heinh/.qgis2/python/plugins', 'C:/PROGRA1/QGISWI1/apps/qgis/./python/plugins', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg', 'C:\PROGRA1\QGISWI1\bin\python27.zip', 'C:\PROGRA1\QGISWI1\apps\Python27\DLLs', 'C:\PROGRA1\QGISWI1\apps\Python27\lib', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\plat-win', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\lib-tk', 'C:\PROGRA1\QGISWI1\bin', 'C:\PROGRA1\QGISWI1\apps\Python27', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\six-1.3.0-py2.7.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg', 'C:\PROGRA1\QGISWI1\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg', u'C:/Users/heinh/.qgis2//python', 'C:\PROGRA1\QGISWI1\apps\qgis\python\plugins\fTools\tools', 'C:/Users/heinh/Desktop'].

Working with QGIS 3.2?

Have both QGIS 2.18.20 and QGIS 3.2.1 installed on my workstation with same configuration. Discovery works great with 2.18.20 but not with 3.2.1 .

When setting up configuration get (fe_sendauth;no password supplied\n') and drop downs not populating. Have checked database connections and all are fine.

password protected connections

I've got a password (supplied on connect) protected connection, and there is no possibility in the configuration dialog to provide one.

Couldn't load plugin 'Discovery' due to an error when calling its initGui() method

I'm testing the new version of the plugin 2.1.1 in QGIS Master and couldn't get it to work with database connections without a saved password or with connections saved in the qgis-auth.db. I deleted all my postgresql database connections and recreated them and now I get the following error:

Couldn't load plugin 'Discovery' due to an error when calling its initGui() method

AttributeError: type object 'QgsMessageBar' has no attribute 'CRITICAL'

Traceback (most recent call last): File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 345, in startPlugin plugins[packageName].initGui() File "C:/Users/someuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Discovery\discoveryplugin.py", line 214, in initGui self.read_config(config_list[0] if config_list else "") File "C:/Users/someuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Discovery\discoveryplugin.py", line 406, in read_config level=QgsMessageBar.CRITICAL)

AttributeError: type object 'QgsMessageBar' has no attribute 'CRITICAL'

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
QGIS version: 3.1.0-Master Master, d7fd14b340

Python Path: C:/OSGEO4~1/apps/qgis-dev/./python C:/Users/someuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/someuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/OSGEO4~1/apps/qgis-dev/./python/plugins C:\OSGeo4W64\bin\python36.zip C:\OSGEO4~1\apps\Python36\DLLs C:\OSGEO4~1\apps\Python36\lib C:\OSGeo4W64\bin C:\OSGEO4~1\apps\Python36 C:\OSGEO4~1\apps\Python36\lib\site-packages C:/Users/someuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users\someuser\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins C:\Users\someuser\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins

I'm on Windows 7 64bit. Running QGIS Master installed via OSGeo4W.

Search tables with no geometry

Great work with adding Geopackage recently!
However I was wondering if you were planning on making tables with no geometry searchable as well?

No result

Within the search dialog box it would be useful to display if no/null results have been returned rather than displaying nothing (as a few times I wasn't sure whether the lookup was working correctly or not).

Support for multiple tables

Currently the plugin is using only one settings. There should be an option (drop-down menu) to set multiple connections/tables so that user can search across multiple tables.

Problem with installation

Couldn't load plugin Discovery due to an error when calling its initGui() method

TypeError: unable to convert a QVariant of type 0 to a QMetaType of type 10

Colour of marker and rubber band

It would be nice if you could choose the colour of your marker (the default is red, but that could get confusing if you have red styled elements on your layer).

Order By in display Column in configuration

Hello,

Is it possible to add in the configuration, for the display column a order by?

For example, when i search a street, i chose in the display columns "Towns" and "Street", the search column "Street" is order by but not the display Column"Town"

Thanks

Problem with QGIS 3

File "/home/saber/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Discovery/discoveryplugin.py", line 49, in eval_expression
for extra_col, extra_value in extra_data.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

Python error - Qgs coordinate transform

Hi

I just installed the QGIS3 version but am having an issue which seems to relate to coordinate transformation.

My PostGIS table is in BNG 27700 with my project in the same system, but a python error is occurring as below - any solutions?

An error has occurred while executing Python code: 

TypeError: QgsCoordinateTransform(): arguments did not match any overloaded call:   overload 1: too many arguments   overload 2: not enough arguments   overload 3: not enough arguments   overload 4: not enough arguments   overload 5: argument 1 has unexpected type 'QgsCoordinateReferenceSystem' 
Traceback (most recent call last):
  File "C:/Users/chris.buckmaster/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Discovery\discoveryplugin.py", line 262, in on_result_selected
    self.select_result(self.search_results[result_index.row()])
  File "C:/Users/chris.buckmaster/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Discovery\discoveryplugin.py", line 270, in select_result
    QgsCoordinateReferenceSystem(dst_srid))
TypeError: QgsCoordinateTransform(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: not enough arguments
  overload 3: not enough arguments
  overload 4: not enough arguments
  overload 5: argument 1 has unexpected type 'QgsCoordinateReferenceSystem'


Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] 
QGIS version: 3.0.0-Girona Girona, 001c80b0c3 

Display columns

Currently, the search column is shown by default as the display column in the result.

To give users more flexibility, it will be good to have the display columns overriding the order in which columns are shown.

Search for an adress failed

Hi, thank you for your nice and practicable tool for search and locate adresses and so on. I have an database with cadastre-informations and adresses (streetname and number) in one table. For long streets with many numbers, the lower numbers are not visible in the search results. See the screenshot. Modifing the search like "Halterner Straße%5" does'nt have the effect i wish.

image

Best regards
Joachim

missing dsn and no parameters

Discovery can no longer see my database connections and I am seeing an error message in the bottom left of the configuration window that states "missing dsn and no parameters". Sounds like its ODBC related?

Settings saved from previous versions of the plugin are still in but there are no results from queries entered in the search box.

QGIS version: 3.4.5.1

Wrong Postgres user

I find this problem!
WARNING Traceback (most recent call last): conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: FATAL: role "XXX" does not exist
It seems the plugin fails in getting the proper Postgres user: "XXX" is my Windows 10 user

Correct ordering of results

Having the correct ordering of results that start with a number would be good, e.g. 1, 2, 3 rather than 1, 101, 102 (see screenshot).
image

User setting for marker delay

When using web background maps, sometimes the marker dispears before the BG maps have loaded.

Could we include a configuration option to allow the user to specify a non-default delay in seconds?

Python error - 'no attribute 'transform'

Hi there

I have set up the configuration to connect to my PostGIS address layer, I am able to search and retrieve autocomplete results, but on clicking an option I am getting a python error as follows:

location_geom.transform(transform)
AttributeError: 'NoneType' object has no attribute 'transform'

I think this is trying to see if the PostGIS layer has the same projection as my QGIS project, but it does so I am not too sure why I am getting this error?

Thanks

Installing Discovery plugin on windows 10 2.18.14

I have tried to install the plugin but I keep getting this message

Couldn't load plugin Discovery due to an error when calling its initGui() method

TypeError: unable to convert a QVariant of type 0 to a QMetaType of type 10

Traceback (most recent call last):

File "C:/PROGRA1/QGIS211.14/apps/qgis/./python\qgis\utils.py", line 342, in startPlugin

plugins[packageName].initGui()

File "C:/Users/cbc_admin/.qgis2/python/plugins\Discovery\discoveryplugin.py", line 205, in initGui

self.read_config(config_list[0] if config_list else "")

File "C:/Users/cbc_admin/.qgis2/python/plugins\Discovery\discoveryplugin.py", line 355, in read_config

connection = settings.value(key + "connection", "", type=str)

TypeError: unable to convert a QVariant of type 0 to a QMetaType of type 10

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version: 2.18.14 Las Palmas, ff83b9a479

Python Path:

•C:/PROGRA1/QGIS211.14/apps/qgis/./python/plugins\processing

•C:/PROGRA1/QGIS211.14/apps/qgis/./python

•C:/Users/cbc_admin/.qgis2/python

•C:/Users/cbc_admin/.qgis2/python/plugins

•C:/PROGRA1/QGIS211.14/apps/qgis/./python/plugins

•C:\PROGRA1\QGIS211.14\bin\python27.zip

•C:\PROGRA1\QGIS211.14\apps\Python27\DLLs

•C:\PROGRA1\QGIS211.14\apps\Python27\lib

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\plat-win

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\lib-tk

•C:\PROGRA1\QGIS211.14\bin

•C:\PROGRA1\QGIS211.14\apps\Python27

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\win32

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\win32\lib

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\Pythonwin

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\wx-2.8-msw-unicode

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg

•C:\PROGRA1\QGIS211.14\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg

•C:/Users/cbc_admin/.qgis2//python

Cheers

Joe York

plugin has no attribute 'classFactory'

Hi,

I'm getting an error installing the Discovery plugin in QGIS 3.0.1 and 3.1.0 on Windows 7 and Windows 10 64bit.

AttributeError: module 'qgis-discovery-plugin-qgis3' has no attribute 'classFactory'

If I uninstall and reinstall QGI tells me the plugin installed correctly but that the plugin is broken and missing a metadata file. There is no version history. Am I missing some dependencies?

column "geom" does not exist

Hello,

A quick test of the new search plugin returns the following error:

2015-11-17T09:31:52 1 Traceback (most recent call last): File "C:/Users/me/.qgis2/python/plugins\Discovery\discoveryplugin.py", line 211, in do_db_operations self.perform_search() File "C:/Users/me/.qgis2/python/plugins\Discovery\discoveryplugin.py", line 220, in perform_search cur.execute(self.query_sql, self.query_dict) ProgrammingError: column "geom" does not exist LINE 3: ST_SRID(geom) AS epsg,

I have configured the plugin to use a full_address field in the database table with a geometry column called geometry and not geom.

The pg_trgm extension is installed and an appropriate index built on the on the full_address field.

QGIS 2.12 32bit, PostgreSQL 9.2.13

Save Configuration

Can you add the configuration backup so you can import it to another computer?
Thanks,
Stéphane
"Sorry for my bad english"

Error in loading the plugin

Couldn't load plugin Discovery due to an error when calling its initGui() method

TypeError: unable to convert a QVariant of type 0 to a QMetaType of type 10

Traceback (most recent call last):
File "C:/PROGRA1/QGIS21.18/apps/qgis-ltr/./python\qgis\utils.py", line 342, in startPlugin
plugins[packageName].initGui()
File "C:/Users/USER/.qgis2/python/plugins\Discovery\discoveryplugin.py", line 204, in initGui
self.read_config(config_list[0] if config_list else "")
File "C:/Users/USER/.qgis2/python/plugins\Discovery\discoveryplugin.py", line 354, in read_config
connection = settings.value(key + "connection", "", type=str)
TypeError: unable to convert a QVariant of type 0 to a QMetaType of type 10

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version: 2.18.18 Las Palmas, b33566195a

Master download of Discovery

I've installed (via a downloaded ZIP of the latest release) Discovery but getting the following error message..

This plugin is broken
Missing metadata file

image

role Null does not exist

Hi,

I installed the latest version of your plugin.
I noticed there is a combobox where I selected Postgresql as database
When I submit the same values as in the previous version I get an error saying that role Null does not exist.
Regards

Fading cross (fading or not fading..)

Hello,
is it possible to set a flag (for example as a checkbox in the configuration dialog) for fading out or not fading out the red cross ?
Best regards
Joachim Deutmann
#6

Can't select PostgreSQL connection and other oddities)

Steps to reproduce:

  1. Have a working PostgreSQL connection
  2. Open discovery settings
  3. Click +
  4. Try to select a connection (there's none in the list and there should be)

Workaround (partial):

Now:

  1. Change Data source type to GeoPackage and back to PostgreSQL

Drop-down now works as expected.

However, I now get an error about missing dsn or similar at the bottom and unable to see any schemata in Schema drop-down.

Unfortunately unable to reproduce the missing schema issue reliably on my computer.

The red marker in QGIS start up

When starting QGIS, the red cross identifying the location of search result from this plugin, appears for a couple of seconds on the map canvas and then it fades away.

Configuration window too big for screen with a lot of unused empty space

Every time I open the Configuration window it is too large for my screen. There is a lot of unused space between the bbox setting and the OK button. I can resize the window to see the OK button, but the next time I open the Configuration window it's too big again.

I use QGIS 3.0.2 on Windows 10.

discoveryconfigtoolarge

Problem with data type

I would like to use your Discovery Plugin for easy access with a Postgis DB. Unfortunately I cannot seem to search for integers in your search bar.
Everytime I try to do that there either is an error message or nothing happens (no dropdown menu).
The format of the integer is given in Postgis as int4.

Discovery when running from Locator

Discovery configured with MSSQL db, comes up with this error when trying to use in Locator:

   An error has occurred while executing Python code:
             
             
             AttributeError: 'QSqlDatabase' object has no attribute 'execute'
             
             
             Traceback (most recent call last):
              File "C:/Users/Saber/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Discovery\locator_filter.py", line 53, in fetchResults
              cur.execute(query_text, query_dict)
             AttributeError: 'QSqlDatabase' object has no attribute 'execute'
             
             
             
             
             Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
             
             
             QGIS version: 3.4.5-Madeira Madeira, 89ee6f6e23

Displaying no result

Within the search dialog box it would be useful to display if no/null results have been returned rather than displaying nothing (as a few times I wasn't sure whether the lookup was working correctly or not).

Colour of marker, polygon and line highlighted

Currently the result of search is always shown in red for all features. Can we set that to follow the user setting of rubber-band colour or Identified result (my preference)?

On that note, the polygon is completely blocked by the colour and features are not visible within it.

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.