[postgis-users] PostGIS mapbox vector tiles and custom tile grid
pavel.borodaev
pavel.borodaev at gmail.com
Mon Apr 1 02:27:06 PDT 2019
Yes, I understand that MVT is 2D-only and that SRID can be important
but my data has no explicit SRID
Sample data can be any 3D Autocad DXF or any 3d model (Sketchup for ex)
imported into postgis (no coord sys)
My query is
WITH cte AS
(
SELECT
id
, original_feature_id
, layer_id
, ST_FORCE2D(geometry) AS geometry
FROM {0}.{1}
)
SELECT
id
, ST_ASMVTGEOM(
geometry
,
ST_MAKEENVELOPE(:min_x, :min_y, :max_x, :max_y),
:tile_size, 0, true) geometry
FROM cte
WHERE layer_id = :layer_id
AND
geometry && ST_MAKEENVELOPE(:min_x, :min_y, :max_x, :max_y)
AND
ST_INTERSECTS(geometry, ST_MAKEENVELOPE(:min_x, :min_y, :max_x, :max_y))
ORDER BY
id
) q
As far as I understand grid tiles schema should be used to determine
"simplification level" while preparing vector tile. PostGIS functions have
no sufficient params to provide this schema information (resolution-extent
mapping). GDAL supports this but it is hard to use it for this (mostly file
based, CLI-oriented, undocumented features of c# bindings)
--
Sent from: http://postgis.17.x6.nabble.com/PostGIS-User-f3516033.html
More information about the postgis-users
mailing list