[geos-devel] Clip and Union --> is my implementation correct?

Martin Davis mtnclimb at gmail.com
Tue Oct 15 11:01:28 PDT 2019


This sounds like a classic polygon coverage overlay operation?

The "obvious" way to do this in GEOS is by using the overlay operations.
However, these work on pairs of geometries only, which means that (a) it's
a bit complicated to compute a full polygon coverage overlay and (b) this
tends to be quite slow.

The other way to do this in GEOS is to node the linework of the input
coverages (GEOSUnion can do this), polygonize the linework, generate
interior points for all resulting polygons, and then determine the
parentage of each resultant by using point-in-polygon tests against the
input coverages.

This is a fair amount of complex code. But it should be faster (at least,
if spatial indexes are used where appropriate).

Perhaps we can add a function into GEOS to perform this operation at some
point.

On Tue, Oct 15, 2019 at 1:06 AM Paul Meems <bontepaarden at gmail.com> wrote:

> Hi List,
>
> I have a large shapefile (land use) with a lot of small shapes (392k).
> I also have a smaller shapefile (catchments) with larger shapes (2.5k).
> The smaller shapefile overlaps the larger shapefile in the center.
>
> I need to create a new shapefile (expected number of shapes is several
> 100k) that have the values of the land use and the catchments combined.
> Currently, I'm doing a GEOSClip() of the land use by the catchment first
> and then a GEOSUnion of the clipped result and the catchment.
>
> This is a bit slow. The clipping already takes 40 minutes.
>
> Am I using the right approach or should I use a different one?
>
> Extra info. I'm using MapWinGIS (C++) which includes GDAL and GEOS.
> This is the implementation of GEOSClip:
>
> https://github.com/MapWindow/MapWinGIS/blob/develop/src/COM%20classes/Shapefile_Geoprocessing.cpp#L1936
> It was created years ago. Perhaps the implementation can/should be
> optimized as well.
>
> Thanks,
>
> Paul Meems
>
> _______________________________________________
> 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/20191015/9dd35015/attachment.html>


More information about the geos-devel mailing list