[postgis-users] ST_Subdivide creates nodes outside original polygon

Martin Davis mtnclimb at gmail.com
Tue Nov 26 10:45:03 PST 2019


Due to finite precision of coordinates (numeric rounding), generally the
polygons created by ST_Subdivide (or any other function which adds
vertices) are never going to match exactly with the source polygons.

How you handle this depends on what you are trying to compute.  One thing
you might be able to do is to filter out polygons which have a very small
area of overlap.

Hopefully a future version of PostGIS will provide the ability to specify a
snapping tolerance for spatial predicates.  In that case using relate with
an "interiorIntersects" pattern [1] and a tolerance should work for this.

[1] https://postgis.net/docs/ST_Relate.html

On Tue, Nov 26, 2019 at 8:25 AM Eduardo Ramos <duda.ramos at gmail.com> wrote:

> Hello all.
>
> I'm exploring the function ST_Subdivide(with type geometry) and noticed
> that the nodes that this function creates to divide the original polygon
> are missing the polygon edges by ~6cm.
>
> Here is an example:
>
> [image: image.png]
> This is originating some issues when using the ST_Intersects because the
> new polygons generated by ST_Subdivide are intersecting polygons that were
> not being intersected before.
>
> I guess this must be a matter of numeric precision but I we can't control
> the precision or the tolerance in either of the two functions (ST_Subdivide
> and ST_Intersects).
>
> Is there a way to configure the precision of ST_Subdivide or to play with
> the ST_Intersects tolerance?
>
> Any ideas or suggestions?
>
> Thanks,
> Eduardo
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20191126/72aa2ea9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 58922 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20191126/72aa2ea9/attachment.png>


More information about the postgis-users mailing list