Quantcast

Touching polygons and floating-point

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Touching polygons and floating-point

Denis Pesotsky
Look at attached picture. There are 2 polygons. Side of first polygon
lies on side of second. What GGL will do if I unite them? Will it
produce 1 polygon or 2 polygons?

In other words, does it support fuzzy detection polygons with touching
side. When touch side is not vertical or horizontal and they don't
have same corners (e.g. they only touch by sides).

_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl

fuzzy_union.png (40K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Touching polygons and floating-point

Barend
Hi Denis,


Op 11-2-2011 4:58, Denis Pesotsky schreef:
> Look at attached picture. There are 2 polygons. Side of first polygon
> lies on side of second. What GGL will do if I unite them? Will it
> produce 1 polygon or 2 polygons?

It will produce 1 polygon.

> In other words, does it support fuzzy detection polygons with touching
> side. When touch side is not vertical or horizontal and they don't
> have same corners (e.g. they only touch by sides).
Yes, it unites polygons with touching sides. Horizontal or vertical does
not matter here, and neither does having the same corners. Actually I
don't call this "fuzzy detection", I mean, they must really touch. If
they are just close, the two polygons will stay separate.

Regards, Barend

_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Touching polygons and floating-point

Denis Pesotsky
Thanks for answer. But I mean a bit other thing. You noticied same
thing in your blog ("Precision, the cause of spikes").
For example, 1st polygon have coordinates like (1, 1) and (4, 2.3)
(and 1 more coordinate somewhere) and other have coordinates like
(2.1, y1) and (3, y2), where y1 is y coordinate for crosspoint of
Line({1, 1} {4, 2.3}) and y=2.1, while y2 is y coordinate for
cross-point of same line and y=3. In float-point presentation that
points can be not exactly on this line, but very close. Can this
result in leaving 2 separate polygons after union?

2011/2/11 Barend Gehrels <[hidden email]>:

> Hi Denis,
>
>
> Op 11-2-2011 4:58, Denis Pesotsky schreef:
>>
>> Look at attached picture. There are 2 polygons. Side of first polygon
>> lies on side of second. What GGL will do if I unite them? Will it
>> produce 1 polygon or 2 polygons?
>
> It will produce 1 polygon.
>
>> In other words, does it support fuzzy detection polygons with touching
>> side. When touch side is not vertical or horizontal and they don't
>> have same corners (e.g. they only touch by sides).
>
> Yes, it unites polygons with touching sides. Horizontal or vertical does not
> matter here, and neither does having the same corners. Actually I don't call
> this "fuzzy detection", I mean, they must really touch. If they are just
> close, the two polygons will stay separate.
>
> Regards, Barend
>
> _______________________________________________
> ggl mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/ggl
>
_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Touching polygons and floating-point

Barend
Op 11-2-2011 11:19, Denis Pesotsky schreef:
> Thanks for answer. But I mean a bit other thing. You noticied same
> thing in your blog ("Precision, the cause of spikes").
Sure.
> For example, 1st polygon have coordinates like (1, 1) and (4, 2.3)
> (and 1 more coordinate somewhere) and other have coordinates like
> (2.1, y1) and (3, y2), where y1 is y coordinate for crosspoint of
> Line({1, 1} {4, 2.3}) and y=2.1, while y2 is y coordinate for
> cross-point of same line and y=3. In float-point presentation that
> points can be not exactly on this line, but very close. Can this
> result in leaving 2 separate polygons after union?
>
In this described case, probably not, using float or double. But it
might occur, yes. There is no fuzzy detection indeed. I'll come back to
this with some details.

Barend

_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Touching polygons and floating-point

Denis Pesotsky
Is there any chance that there will appear function to fix this stuff
in near future? I don't mean fuzzy detection when doing stuff. I mean
something like spikes detection (that you mentioned in your blog)
after doing stuff. I can list all possible cases on picture, if you
want.

2011/2/11 Barend Gehrels <[hidden email]>:

> Op 11-2-2011 11:19, Denis Pesotsky schreef:
>>
>> Thanks for answer. But I mean a bit other thing. You noticied same
>> thing in your blog ("Precision, the cause of spikes").
>
> Sure.
>>
>> For example, 1st polygon have coordinates like (1, 1) and (4, 2.3)
>> (and 1 more coordinate somewhere) and other have coordinates like
>> (2.1, y1) and (3, y2), where y1 is y coordinate for crosspoint of
>> Line({1, 1} {4, 2.3}) and y=2.1, while y2 is y coordinate for
>> cross-point of same line and y=3. In float-point presentation that
>> points can be not exactly on this line, but very close. Can this
>> result in leaving 2 separate polygons after union?
>>
> In this described case, probably not, using float or double. But it might
> occur, yes. There is no fuzzy detection indeed. I'll come back to this with
> some details.
>
> Barend
>
> _______________________________________________
> ggl mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/ggl
>
_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Touching polygons and floating-point

Barend
Hi Denis,

On 2-3-2011 12:44, Denis Pesotsky wrote:
> Is there any chance that there will appear function to fix this stuff
> in near future? I don't mean fuzzy detection when doing stuff. I mean
> something like spikes detection (that you mentioned in your blog)
> after doing stuff. I can list all possible cases on picture, if you
> want.

Yes, there is also a remark at my blog about this. I will come with the
details, but if you have pictures or preferably WKT-representations,
that would help me to check if the solution is applicable in all cases.

Thanks, Barend

--
Barend Gehrels
http://about.me/barendgehrels

_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Touching polygons and floating-point

Denis Pesotsky
In one or two days I'll hack my CAD-like app to use GGL for polygons
union and subtractions, so it will be easy to test stuff. Will send
message here, when I will do that. Thanks.

2011/3/6 Barend Gehrels <[hidden email]>:

> Hi Denis,
>
> On 2-3-2011 12:44, Denis Pesotsky wrote:
>>
>> Is there any chance that there will appear function to fix this stuff
>> in near future? I don't mean fuzzy detection when doing stuff. I mean
>> something like spikes detection (that you mentioned in your blog)
>> after doing stuff. I can list all possible cases on picture, if you
>> want.
>
> Yes, there is also a remark at my blog about this. I will come with the
> details, but if you have pictures or preferably WKT-representations, that
> would help me to check if the solution is applicable in all cases.
>
> Thanks, Barend
>
> --
> Barend Gehrels
> http://about.me/barendgehrels
>
> _______________________________________________
> ggl mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/ggl
>
_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Loading...