[postgis-users] PostGIS "Subdivide" should insert vertex where subdivision lines intersect

10 views
Skip to first unread message

Marco Boeringa

unread,
Feb 24, 2021, 5:08:30 AM2/24/21
to PostGIS Users Discussion
Hi all,

I don't know how much of an effort it would be, but I think it would be
nice if PostGIS's "Subdivide" was enhanced to insert a vertex where
subdivision lines "intersect". Currently, when a large shape is
subdivided, if a vertical sudivide line "hits" a horizontal one, the
sub-part of the large geometry being subdivided that is above or below
the horizontal subdivision line, won't receive a vertex where the
vertical subdivision line "hits" it.

This has the negative consequence that as soon as you start reprojecting
the geometries resulting of this subdivide operation to another
projection and depending on that projection's properties, e.g. with
on-the-fly projection in QGIS, that the three geometries around this
"virtual" intersection of subdivision lines, won't match, and show a
clearly visible gap.

This could be prevented if "Subdivide" always inserted an extra vertex
at the intersection of the subdivision lines, even if the geometry part
above or below the horizontal subdivision line, won't be cut vertically
at that point.

Marco

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

Darafei "Komяpa" Praliaskouski

unread,
Feb 24, 2021, 5:20:00 AM2/24/21
to PostGIS Users Discussion
Hello Marco,

Subdivision should be done in target projection as a final step of processing. If you expect to keep topology after reprojection, you should be either merging the polygon back before the reprojection, or investing in using the topology framework of postgis. That's the base of all overlay operations.

Insertion of an extra vertex breaks the logic of "every time you do a split on a node, you have less nodes in each half" and will lead to undesired behavior in sawtooth polygons. Thus behavior you're requesting has to be under a flag.

Please send in the pull request for keeping the nodes.


--
Darafei "Komяpa" Praliaskouski
OSM BY Team - http://openstreetmap.by/

Marco Boeringa

unread,
Feb 24, 2021, 5:58:46 AM2/24/21
to postgi...@lists.osgeo.org

Hi Darafei,

I am not a PostGIS, nor C(++) developer, so unfortunately can't help with coding. I also have no idea of the technical consequences of what I am asking here, so it is merely a suggestion at this point.

"Subdivision should be done in target projection as a final step of processing."

I am just speaking as a GIS user here. I understand 'ST_Subdivide' is a kind of "end-of-pipeline" process.

However, the data coming out is simply not guaranteed to be used in single "target projection" nowadays. With increasing usage of WFS and vector tile services, the ability to reproject the data resulting from 'ST_Subdivide', is of increasing value. Web services or GIS's using the data primarily for "dumb" display, not subsequent processing or geographical analysis, may be perfectly happy with subdivided polygons (and may even need it for performance reasons).

Hence it would be a kind of nice to have such an option to insert an extra vertex, and allow "seamless/gap-less" reprojection to another projection.

Marco


Op 24-2-2021 om 11:19 schreef Darafei "Komяpa" Praliaskouski:
Reply all
Reply to author
Forward
0 new messages