[geos-devel] CoverageUnion

Martin Davis mtnclimb at gmail.com
Thu Apr 27 16:33:26 PDT 2023


The definition of a valid Simple Polygonal Coverage is presented here:

http://lin-ear-th-inking.blogspot.com/2022/08/validating-polygonal-coverages-in-jts.html

It's in the JTS Javadoc here:

https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/coverage/CoverageValidator.java#L22

The GEOS doc for GEOSCoverageIsValid is here:

http://libgeos.org/doxygen/geos__c_8h.html#a562112e71b059c2bccd84ba05b5e0907

I'll add some more details to that doco.

It might be nice to have an overview of what SimplePolygonalCoverages are
and the operations available for them.  I'm not sure if there's a way to
have section doc in doxygen.  If anyone has ideas let me know.


On Thu, Apr 27, 2023 at 2:16 PM Sandro Santilli <strk at kbt.io> wrote:

> On Wed, Apr 26, 2023 at 12:45:41PM -0700, Paul Ramsey wrote:
>
> > I am tempted to change the contract and document that
> > a validity check is a precondition for getting "sensible" results on
> > output.
>
> Where's the contract ? I was curious to understand what would
> ST_CoverageUnion do for me but only found these short paragraphs:
>
>
> https://github.com/libgeos/geos/blob/62c928c9f37957c62fab8db69e6c8efd26ce4085/include/geos/coverage/CoverageUnion.h#L33-L40
>
> https://github.com/libgeos/geos/blob/62c928c9f37957c62fab8db69e6c8efd26ce4085/include/geos/coverage/CoverageUnion.h#L48-L53
>
> Those two paragraphs boils down to:
>
>   Unions a polygonal coverage in an efficient way.
>   Valid polygonal coverage topology allows merging polygons in a very
> efficient way.
>   Takes: the polygons in the coverage (a vector of Geometry pointers)
>   Returns: the union of the coverage polygons (a Geometry unique pointer)
>
> Questions I have are:
>
>   - What is a "valid polygonal coverage" ?
>   - Do shared edges need to contain the exact same vertices ?
>
> The answer seem to be in the PostGIS pull request to expose the
> functionality [1], but it would be useful to have it in the GEOS
> (and JTS?) side too. For easier porting of JTS fixes I also find
> it useful to encode the "last commit of JTS" in a comment in the
> top of each file.
>
> [1] https://github.com/postgis/postgis/pull/731#issue-1683980686
>
> In general GEOS functions are (not sure if documented as such) expected to
> take
> a valid input for their return to be defined. There should be very few
> exceptions
> to this, maybe only the recent MakeValid.
>
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geos-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20230427/e9b038a7/attachment.htm>


More information about the geos-devel mailing list