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

Marco Boeringa marco at boeringa.demon.nl
Wed Feb 24 02:58:39 PST 2021


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:
> 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.
>
>
>
> On Wed, Feb 24, 2021 at 1:08 PM Marco Boeringa 
> <marco at boeringa.demon.nl <mailto:marco at boeringa.demon.nl>> wrote:
>
>     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
>     postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
>     https://lists.osgeo.org/mailman/listinfo/postgis-users
>     <https://lists.osgeo.org/mailman/listinfo/postgis-users>
>
>
>
> -- 
> Darafei "Komяpa" Praliaskouski
> OSM BY Team - http://openstreetmap.by/ <http://openstreetmap.by/>
>
> _______________________________________________
> 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/20210224/e37001e1/attachment.html>


More information about the postgis-users mailing list