[PostGIS] #5844: ST_AsMVTGeom producing null results on valid geoms
PostGIS
trac at osgeo.org
Wed Jan 29 14:24:59 PST 2025
#5844: ST_AsMVTGeom producing null results on valid geoms
-----------------------+-------------------------------
Reporter: pratishta | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS Packaging
Component: postgis | Version: 3.2.x
Keywords: |
-----------------------+-------------------------------
We're working on an application with a map that gets Mapbox vector tiles
from our backend API. Our API generates these tiles from a database that's
hosted here Digital Ocean. However, the behavior of the app differs from
the locally hosted database and the one on DO. Specifically, some tiles
are missing at certain zoom levels and x, y coordinates.
We've provided a repository with a database schema and data to populate to
reproduce this issue: https://github.com/pratishta/do-postgres-support
The following query produces null values on the existing database in DO.
It does not produce null values when run on a local database with the same
data. The PostGIS functions seem to be the points of difference,
specifically ST_AsMVTGeom.
{{{
SELECT
id,
ST_AsMVTGeom(mercator_fill, ST_TileEnvelope(10, 301, 385), 4096,
64, true) as geomFill
FROM city_council_district
WHERE ST_Intersects(mercator_fill, ST_TileEnvelope(10, 301, 385));
}}}
PostGIS versions using `SELECT PostGIS_Full_Version();`
Local database:
{{{
POSTGIS="3.5.1 48ab069" [EXTENSION] PGSQL="150" GEOS="3.11.1-CAPI-1.17.1"
PROJ="9.1.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org
USER_WRITABLE_DIRECTORY=/var/lib/postgresql/.local/share/proj
DATABASE_PATH=/usr/share/proj/proj.db" LIBXML="2.9.14" LIBJSON="0.16"
LIBPROTOBUF="1.4.1" WAGYU="0.5.0 (Internal)" (core procs from "3.4.2
c19ce56" need upgrade)
}}}
DO database:
{{{
POSTGIS="3.2.6 5ea52a731b3" [EXTENSION] PGSQL="150"
GEOS="3.9.2-CAPI-1.14.3" PROJ="7.2.1" LIBXML="2.10.4" LIBJSON="0.17"
LIBPROTOBUF="1.4.1" WAGYU="0.5.0 (Internal)" (core procs from "3.2.4
23.10.1-282-g0354378dc6" need upgrade)
}}}
But even when both databases are on the same version, this problem
persists.
Could we get some information on what else could be impacting the results
if the data and PostGIS versions are the same? In what cases does
`ST_AsMVTGeom` meant to result in a null value?
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5844>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list