[Qgis-user] qgis-web-client: searching, but how?

Andreas Neumann a.neumann at carto.net
Tue Oct 18 11:46:54 PDT 2011


Hi Arichp,

I am sorry - I am currently traveling (and attending a conference).

We need to better document this, but there are basically two ways
(probably more).

Either through:

a) wsgi python script on the server (typically querying Postgis tables)
b) through QGIS server (Sourcepole implemented something I am not yet
too familiar with)

In version a) this is quite disconnected from the project itself, e.g.
addresses, parcel numbers, street names, etc. - that are present
regardless of the other topics in the project.

Version b) is actually using data layers from within the project, as I
understand it - you basically work with the FILTER and SELECTION command
of QGIS server.

Version a) and b) can also be combined.

For version a) you'd have to define a table with a structure like the
following:

CREATE TABLE av_user.suchtabelle
(
  searchstring text,
  displaytext text NOT NULL,
  search_category text,
  the_geom geometry,
  geometry_type text,
  searchstring_tsvector tsvector,
  CONSTRAINT suchtabelle_pkey PRIMARY KEY (displaytext)
)
WITH (
  OIDS=FALSE
);

CREATE INDEX in_av_user_searchstring_tsvector_gin
  ON av_user.suchtabelle
  USING gin
  (searchstring_tsvector);

and fill the table with the data you want to search in. Then get the
wsgi to work whicht will query the database.

When you type in the searchbox it will query the database for search
strings that are longer than 1 character. It will then list all options
while you are typing. After selecting one of the result records in the
combobox it will get the actual wkt geometry from the python script,
zoom to the geometry, and highlight it.

Hope this at least helps to understand the mechanism.

I understand that the documentation is not yet ideal. I will try to
improve that when I am back from my traveling.

Andreas


> Step by step, maybe?
> 
> Regards,
> Arichp
> 
> 
> 
> 
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user




More information about the Qgis-user mailing list