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

Paul Meems bontepaarden at gmail.com
Tue Jan 21 07:32:26 PST 2020


Hi Martin,

Thanks for the answer and sorry for the late reply.
Because we couldn't do a quick magic trick we had to move on.

But now I'm at a similar point.
Again I have two large polygons files that I want to clip.
This is very slow. In fact, I have never succeeded because after 6+ hours I
canceled the process.

You mentioned a new function could be added to GEOS for quicker clipping of
polygons.
Is that still the case? If so how much budget would be needed to get this
function built?
It is quite a showstopper for us right now and I could gather some funding
for this.

Regards,

Paul Meems

Op di 15 okt. 2019 om 20:01 schreef Martin Davis <mtnclimb at gmail.com>:

> 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
>
> _______________________________________________
> 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/20200121/70f98cf9/attachment.html>


More information about the geos-devel mailing list