|
Geometry : |
Subject: Re: [geometry] "covered_by" for polygons
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-02-15 13:38:40
Hi Volker,
On 15-2-2012 18:31, Volker Schöch wrote:
>
> Hi,
>
> One last post for today: As far as I can see, there is no dedicated
> "within" or "covered_by" algorithm for polygons. Is this considered
> "by design" or "not yet implemented"?
>
Not yet, indeed.
> In any case, while there is no dedicated algorithm (or did I miss
> something?), what do you consider a
> canonical/optimal-performance/most-precise "covered_by" test for
> polygons? Any pros or cons for A.covered_by(B) := area(A-B)==0 vs.
> A.covered_by(B) := (A&B)==A ?
>
The difference and intersection do have the same complexity and precision.
The equals-test will cost you more than the area-test.
But area(A-B)==0 is not always a good test. Suppose A is empty. Than A-B
= empty as well. But A is not covered by B
> Do you think there are any optimization opportunities in a dedicated
> covered_by algorithm?
>
The intersection or difference operations are not necessary. Getting
intersection points and some additional logic should be enough.
Regards, Barend
Geometry list run by mateusz at loskot.net