[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    [postgis-users] ST_AsMVTGeom buffer not working as I expected
From:       James McManus <jmpmcmanus () gmail ! com>
Date:       2020-09-22 20:22:26
Message-ID: CAFXM4AzpfG5ms6HUv+HYVvmp_7Adj3rgGyL7VpTc8-iNwzk8PQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I'm using ST_AsMVTGeom in a function, to extract map box tiles, from a
database, which consist of lat/lon points that I then render as Voronoi
polygons. However, the ST_AsMVTGeom buffer does not appear to be working,
because the Voronoi polygons are not connected between tiles. I'm using
PostGIS 3.0, on PostgreSQL 11. Below is the function:

CREATE OR REPLACE
-- 
http://localhost:7800/public.region3_sim_storms_geom/13/2362/3138.pbf?properties=node,bathymetry
FUNCTION public.region3_sim_storms_geom(z integer, x integer, y integer)
RETURNS bytea
AS $$
  WITH
  bounds AS (
    SELECT ST_TileEnvelope(z, x, y) AS geometry
  ),
  mvtgeom AS (
    SELECT ST_AsMVTGeom(ST_Transform(geom, 3857), bounds.geometry, 4096,
256, true) AS geom, node, bathymetry
    FROM r3sim_fort_geom, bounds
    WHERE ST_Intersects(geom, ST_Transform(bounds.geometry, 4326))
  )
  SELECT ST_AsMVT(mvtgeom.*, 'public.region3_sim_storms_geom')
  FROM mvtgeom;
$$
LANGUAGE 'sql'
STABLE
PARALLEL SAFE;

COMMENT ON FUNCTION public.region3_sim_storms_geom IS 'Given a tile address
query database.';

I've tried many variations, using the default settings, and inputting
settings.

I have been able to display the same data as Voronoi polygons, without the
tile connection problem using pg_tileserv
<https://github.com/CrunchyData/pg_tileserv>.

Thanks
Jim

[Attachment #5 (text/html)]

<div dir="ltr">I&#39;m using ST_AsMVTGeom in a function, to extract map box tiles, \
from a database, which consist of lat/lon points that I then render as Voronoi \
polygons. However, the ST_AsMVTGeom buffer does not appear  to be working, because \
the Voronoi polygons are not connected between tiles. I&#39;m using PostGIS 3.0, on \
PostgreSQL 11. Below is the function:<div><div><br></div><div>CREATE OR REPLACE<br>-- \
<a href="http://localhost:7800/public.region3_sim_storms_geom/13/2362/3138.pbf?properties=node,bathymetry" \
target="_blank">http://localhost:7800/public.region3_sim_storms_geom/13/2362/3138.pbf?properties=node,bathymetry</a><br>FUNCTION \
public.region3_sim_storms_geom(z integer, x integer, y integer)<br>RETURNS \
bytea<br>AS $$<br>   WITH<br>   bounds AS (<br>      SELECT ST_TileEnvelope(z, x, y) \
AS geometry<br>   ),<br>   mvtgeom AS (<br>      SELECT \
ST_AsMVTGeom(ST_Transform(geom, 3857), bounds.geometry, 4096, 256, true) AS geom, \
node, bathymetry<br>      FROM r3sim_fort_geom, bounds<br>      WHERE \
ST_Intersects(geom, ST_Transform(bounds.geometry, 4326))<br>   )<br>   SELECT \
ST_AsMVT(mvtgeom.*, &#39;public.region3_sim_storms_geom&#39;)<br>   FROM \
mvtgeom;<br>$$<br>LANGUAGE &#39;sql&#39;<br>STABLE<br>PARALLEL SAFE;<br><br>COMMENT \
ON FUNCTION public.region3_sim_storms_geom IS &#39;Given a tile address query \
database.&#39;;<br></div><div><br></div><div>I&#39;ve tried many variations, using \
the default settings, and inputting settings.</div></div><div><br></div><div>I have \
been able to display the same data as Voronoi polygons, without the tile connection \
problem  <a href="https://github.com/CrunchyData/pg_tileserv">using pg_tileserv</a>.  \
</div><div><br></div><div>Thanks</div><div>Jim</div></div>


[Attachment #6 (text/plain)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic