<div dir="ltr">Hi,<div><br></div><div><div>I'm trying the use the new ST_AsMVT and ST_AsMVTGeom and I'm seeing an</div><div>error that I can't figure out:</div><div><br></div><div>  SELECT ST_AsMVTGeom(ST_Transform(geom, 3857),</div><div>                      TileBBox(4, 9, 4), 4096, 256, TRUE)</div><div>    FROM fin_adm4 WHERE name_3='Vaasa';</div><div><br></div><div>  -- ERROR:  Operation on mixed SRID geometries</div><div><br></div><div>The TileBBox function is from [1] and uses SRID 3857 as default. The</div><div>geom is Finland admin boundaries level 4 downloaded from <a href="http://www.gadm.org">www.gadm.org</a></div><div>and imported using shp2psql. It is imported in SRID 4326 but I'm</div><div>applying the ST_Transform function to reproject into 3857 in my queries.</div><div><br></div><div>The only time I see this error when I set clip_geom to true. But I</div><div>don't consitently see the error even then. For example, here are a</div><div>few similar queries without generating the error:</div><div><br></div><div>  -- A different city</div><div>  SELECT ST_AsMVTGeom(ST_Transform(geom, 3857),</div><div>                      TileBBox(4, 9, 4), 4096, 256, TRUE)</div><div>    FROM fin_adm4 WHERE name_3='Turku';</div><div><br></div><div>  -- Set clip_geom=false</div><div>  SELECT ST_AsMVTGeom(ST_Transform(geom, 3857),</div><div>                      TileBBox(4, 9, 4), 4096, 256, FALSE)</div><div>    FROM fin_adm4 WHERE name_3='Vaasa';</div><div><br></div><div>  -- Try the tile to the left instead (4, 8, 4)</div><div>  SELECT ST_AsMVTGeom(ST_Transform(geom, 3857),</div><div>                      TileBBox(4, 8, 4), 4096, 256, TRUE)</div><div>    FROM fin_adm4 WHERE name_3='Vaasa';</div><div><br></div><div>Here's a little info on the versions I'm currently running</div><div><br></div><div>  SELECT postgis_full_version();</div><div><br></div><div>  POSTGIS="2.4.0 r15853"</div><div>  PGSQL="96"</div><div>  GEOS="3.4.2-CAPI-1.8.2 r3921"</div><div>  PROJ="Rel. 4.8.0, 6 March 2012"</div><div>  GDAL="GDAL 1.10.1, released 2013/08/26"</div><div>  LIBXML="2.9.1"</div><div>  LIBJSON="0.11.99"</div><div>  LIBPROTOBUF="1.2.1"</div><div>  RASTER</div><div><br></div><div>  SELECT version();</div><div><br></div><div>  PostgreSQL 9.6.5 on x86_64-pc-linux-gnu, compiled by gcc (Debian</div><div>  4.9.2-10) 4.9.2, 64-bit</div><div><br></div><div>[1]  <a href="https://github.com/mapbox/postgis-vt-util/blob/master/src/TileBBox.sql">https://github.com/mapbox/postgis-vt-util/blob/master/src/TileBBox.sql</a></div></div><div><br></div></div>