lizmap-web-client: postgresql search bar not returning any results from database
Description
I set up PostgreSQL search, exactly as the “Spatial Searching” documentation would suggest, and the search bar appears in my Lizmap projects. The search bar will not return any results. Based on the documentation, it should be returning item_layer
and item_label
, but instead, it says “Map data No Results”.
When I run
SELECT * FROM public.lizmap_search
LIMIT 100
in pgAdmin4, I get 100 addresses from the address data I put in the lizmap_search
materialized view. So I am fairly confident the table is configured properly
I am actively trying to troubleshoot this issue myself, but any help would be appreciated.
Environment
- Lizmap version: 3.5 most recent, master, as of 1 week ago
- QGIS Server FULL version:
1:3.20.2+34hirsute
3.20.2 - QGIS Desktop FULL version:
1:3.20.2+34hirsute
3.20.2 - OS: Server is Ubuntu Desktop, Client is Windows
- Browser: Chrome
- Lizmap admin information stored in: default sqlite
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (3 by maintainers)
@MidPiedmont you could perhaps propose a PR to add the file in the source code inside
lizmap/www/assets/js/
?About the “lightning fast” function, we should all thank the AWESOME PostgreSQL/PostGIS community for their tremendous job ! The trick is to use an GIN index base on the trigram extension
See: https://docs.lizmap.com/next/fr/publish/configuration/spatial_search.html#optimisation
Thanks a lot for your feedback. I think we could enhance the documentation about this. We tried indeed to have a automatic fetching of the projection from spatialreference.org, but it does not always work.
Okay, got it done, thank you all for your help. Just in case anyone else ends up looking at this question in the future, here are the final steps:
Convert PostgreSQL address table into a spatial reference that is available on spatialreference.org using QGIS. I chose 2440, my StatePlane CRS, a version that is available as opposed to the original 6447 because they don’t have that one as evidenced by the console error @ygorigor pointed out.
Add in
EPSG2440.js
(usedtouch EPSG2440.js
in ubuntu command) into...assets/js
folder, copied the javascript from spatialreference.org/ref/epsg/2440/proj4js/, wrote it out, restarted apache for good measure. Exact commands are below.cd /var/www/lizmap-web-client-master/lizmap/www/assets/js
sudo touch EPSG2440.js
sudo nano EPSG2440.js
copy and paste contents of spatialreference.org/ref/epsg/2440/proj4js/ intoEPSG2440.js
ctrl + o , enter , ctrl + xsudo service apache2 restart
And that did the trick. And btw, this search function is lightning fast! I don’t know how you made it work so well!