-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MVT_Postgis vs postgres tile difference, checkerboarding when styled #925
Comments
@KCC-IT-Admin what projection are your geometries in? It looks like you're trying to reproject to 3857 on the fly using Change: WHERE geom && !BBOX! To WHERE geom && ST_Transform(!BBOX!, 3857) |
yes, our data is all in 4326. Would I need to transform the geom as well as the BBOX? |
OK- quick update, I ran the updated query as written, and got blank tiles- I ran it after transforming the geom & bbox data and got workable tiles, but the same checkerboard issue persisted. |
@KCC-IT-Admin can you please post your update query? If all your data is in 4326, try the following query: sql = "SELECT ST_AsMVTGeom(geom, ST_Transform(!BBOX!,4326)) AS geom, gid FROM gis.landuse WHERE geom && ST_Transform(!BBOX!,4326)" Alternatively, you can set the [[providers.layers]]
name = "us_adm1"
tablename = "public.us_adm1"
geometry_type = "multipolygon"
geometry_fieldname = "geom"
id_fieldname = "gid"
srid = 4326 # this will transform the !BBOX! token to the 4326 projection
sql = 'SELECT "gid", ST_AsMVTGeom(geom, !BBOX!) AS geom, "adm0code", "adm1code", "name" FROM public.us_adm1 WHERE geom && !BBOX!' |
@KCC-IT-Admin ok. I think you're close. Did you find the documentation I wrote up around this situation? |
I did, yes - I was using a query based off your initial documentation before we started this. the SRID is set on the provider as 4326. Your Sample was and I was using I've tried it with GID before and after the geometry in case it was an issue with that. I'm thinking there's something different with how the mvt creates tiles vs how tegola creates them that makes shapes that spread across multiple tiles sometimes style differently |
@KCC-IT-Admin can you confirm that you have added the [[providers.layers]]
name = "us_adm1"
tablename = "public.us_adm1"
geometry_type = "multipolygon"
geometry_fieldname = "geom"
id_fieldname = "gid"
srid = 4326 # is this set in your config?
sql = 'SELECT "gid", ST_AsMVTGeom(ST_Transform(geom, 3857),ST_Transform(!BBOX!, 3857)) AS geom, "adm0code", "adm1code", "name" FROM public.us_adm1 WHERE geom && !BBOX!' To break down what's happening here:
It's nuanced, but if you get all these params correctly configured then it should work for you. Also, if you want to jump into our Slack, I can try to give you some support there: http://slack.go-spatial.org/ |
I've attempted to migrate our tegola setup to mvt_postgis to capitalize on the performance improvements, and resolve some weird blank spots in maps, but am instead getting strange checkerboarding across tiles when I attempt to style.
[[providers.layers]]
name = "us_adm1"
tablename = "public.us_adm1"
geometry_type = "multipolygon"
geometry_fieldname = "geom"
id_fieldname = "gid"
sql = 'SELECT "gid", ST_AsMVTGeom(ST_Transform(geom, 3857),ST_Transform(!BBOX!, 3857)) AS geom, "adm0code", "adm1code", "name" FROM public.us_adm1 WHERE geom && !BBOX!'
I don't get this banding with my regular format, but instead get weirdly cut polgyons that leave gaps. My usual config section for the same is this:
[[providers.layers]]
name = "us_adm1"
geometry_type = "MultiPolygon"
sql = "SELECT name, gid, adm1code, adm0code, ST_AsBinary(geom) AS geom FROM public.us_adm1 WHERE geom && !BBOX!"
The text was updated successfully, but these errors were encountered: