[PostGIS] #5799: ST_TileEnvelope with margin is not clipped fully to WM extent
PostGIS
trac at osgeo.org
Thu Oct 17 13:11:09 PDT 2024
#5799: ST_TileEnvelope with margin is not clipped fully to WM extent
----------------------+---------------------------
Reporter: mdavis | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.5.1
Component: postgis | Version: 3.5.x
Resolution: | Keywords:
----------------------+---------------------------
Comment (by mdavis):
Here's a drop-in function to fix the clipping behaviour:
{{{
CREATE OR REPLACE FUNCTION ST_TileEnvelopeClip(zoom integer, x integer, y
integer, bounds geometry DEFAULT 'SRID=3857;LINESTRING(-20037508.342789244
-20037508.342789244, 20037508.342789244 20037508.342789244)'::geometry,
margin float8 DEFAULT 0.0)
RETURNS geometry
AS $$
SELECT ST_Intersection( ST_Envelope(bounds), ST_TileEnvelope(zoom, x,
y, bounds, margin))
$$
LANGUAGE 'sql' STABLE STRICT PARALLEL SAFE;
}}}
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5799#comment:3>
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