
Geometry : 
Subject: Re: [geometry] "covered_by" for polygons
From: Barend Gehrels (barend_at_[hidden])
Date: 20120215 13:38:40
Hi Volker,
On 1522012 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/optimalperformance/mostprecise "covered_by" test for
> polygons? Any pros or cons for A.covered_by(B) := area(AB)==0 vs.
> A.covered_by(B) := (A&B)==A ?
>
The difference and intersection do have the same complexity and precision.
The equalstest will cost you more than the areatest.
But area(AB)==0 is not always a good test. Suppose A is empty. Than AB
= 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