Vector-Tiles-Reader-QGIS-Plugin icon indicating copy to clipboard operation
Vector-Tiles-Reader-QGIS-Plugin copied to clipboard

Support PostGIS

Open mnboos opened this issue 7 years ago • 6 comments

PostGIS shall be supported as mvt source.

mnboos avatar Oct 30 '17 14:10 mnboos

Adding even more new sources is probably beyond the scope of https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin/projects/2 .

sfkeller avatar Nov 16 '17 23:11 sfkeller

I read a post about what is required to get ST_AsMVT working, but I'm damned if I can now find it. As I recall, connecting directly means you have to recreate functions which VT servers carry out themselves. An important example is scale-dependent geometry simplification.

There's a minimal Flask example here:

https://medium.com/@giohappy/vector-tiles-postgis-and-openlayers-258a3b0ce4b6

tomchadwin avatar Nov 19 '17 09:11 tomchadwin

And here's another Flask example: https://www.zimmi.cz/posts/2017/serving-mapbox-vector-tiles-with-postgis-nginx-and-python-backend/ .

I really think that optimally PostGIS is just another source like GeoServer #112 and both just need to have a remote TileJSON metadata file, pointing to these ZXY tile sources.

sfkeller avatar Nov 19 '17 16:11 sfkeller

Another argument for wontfix: if the user has access to the database, they don't need to use VT to open the data in QGIS - they can just query without ST_AsMVT.

tomchadwin avatar Nov 19 '17 17:11 tomchadwin

Agreed.

For the records: PostGIS is - or will be - supported via several servers and generators compatible with Mapbox vector tile (MVT). Examples are t-rex, tilemaker, and eventually GeoWebCache/GeoServer. So, this MVT plugin can consume already PostGIS VT with it's Connection dialog.

I'm remaining open to include this in future plugin development. This could probably be a useful feature for those who want to use QGIS as a frontend to PostGIS. Obviously, this makes more sense if queries really take e.g. scale/zoom into account which makes SQL queries more complex than just calling ST_AsMVT.

AFAIK there are still no established "SQL / PostGIS patterns" around, as following blog posts suggests: https://carto.com/blog/inside/MVT-mapnik-vs-postgis/#conclusions and https://carto.com/blog/inside/postgis-performance/ . But perhaps I'm unaware of further developments - besides OMT https://github.com/openmaptiles/postserve - and @rafatower or @pramsey could comment on this?

sfkeller avatar Nov 26 '17 12:11 sfkeller

Sounds like a great plugin. Look forward to testing it out.

On 26 Nov 2017 12:49 pm, "Stefan" [email protected] wrote:

Agreed. So closing this issue for now.

For the records: PostGIS is - or will be - supported via several servers and generators compatible with Mapbox vector tile (MVT). Examples are t-rex, tilemaker, and eventually GeoWebCache/GeoServer. So, this MVT plugin can consume already PostGIS VT with it's Connection dialog.

I'm remaining open to include this in future plugin development. This could probably a useful feature for those who want to use QGIS as a frontend to PostGIS. Obviously, this makes more sense if queries really take e.g. scale/zoom into account which makes SQL queries more complex than just calling ST_AsMVT.

AFAIK there are still no established "SQL / PostGIS patterns" around, as following blog post suggests: https://carto.com/blog/inside/ MVT-mapnik-vs-postgis/#conclusions . But perhaps I'm unaware of further developments and @rafatower https://github.com/rafatower or @pramsey https://github.com/pramsey can comment on this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin/issues/109#issuecomment-347006422, or mute the thread https://github.com/notifications/unsubscribe-auth/ABt0RvS1tqgPoJoEYUVeSkOJ5UB_QmpUks5s6V5ngaJpZM4QLSCq .

mtravis avatar Nov 26 '17 13:11 mtravis