overlay_invalid_input_exception in 1.50

classic Classic list List threaded Threaded
3 messages Options
V
Reply | Threaded
Open this post in threaded view
|

overlay_invalid_input_exception in 1.50

V
Hello world

I encounter a overlay_invalid_input_exception while using the boost::geometry::intersection(p1,p2,out)

I don't get why it works with some polygons and not with other, any help would be very welcome

this work :
str1 : POLYGON((530 -6890, 3530 -6890, 3680 -8240, 530 -6890))
str2 : POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426 -5976, -4073 -976, 6926 1523))

and not this :
str1 : POLYGON((4280 160, 5930 1810, 6980 1510, 6980 -4490, 5930 -7640, 4280 -7490, 4280 160))
str2 : POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426 -5976, -4073 -976, 6926 1523))

The read_wkt(str1,p1) et (str2,p2) get the right polygon each time.
The intersection(p1,p2,out) crashes only in the second case.

Thanks by advance for your help, and sorry for my english (not a native speaker)

V
Reply | Threaded
Open this post in threaded view
|

Re: overlay_invalid_input_exception in 1.50

Barend
Hi,

Welcome to the list!


On 31-8-2012 11:09, V wrote:
Hello world

I encounter a overlay_invalid_input_exception while using the
boost::geometry::intersection(p1,p2,out)

I don't get why it works with some polygons and not with other, any help
would be very welcome

this work :
str1 : POLYGON((530 -6890, 3530 -6890, 3680 -8240, 530 -6890))
str2 : POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426
-5976, -4073 -976, 6926 1523))

and not this :
str1 : POLYGON((4280 160, 5930 1810, 6980 1510, 6980 -4490, 5930 -7640, 4280
-7490, 4280 160))
str2 : POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426
-5976, -4073 -976, 6926 1523))

The read_wkt(str1,p1) et (str2,p2) get the right polygon each time.
The intersection(p1,p2,out) crashes only in the second case.



It does not crash but reports an exception.

Your second polygon POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426 -5976, -4073 -976, 6926 1523)) is self-intersecting:



The first intersection with this invalid polygon succeeds, because it probably happens to intersect it in a non-intersecting piece of it. Boost.Geometry does not checks self-intersectons before the process (for performance reasons). However, the second intersectoin is problematic, and then the polygons are checked on validity.

Regards, Barend





_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
V
Reply | Threaded
Open this post in threaded view
|

Re: overlay_invalid_input_exception in 1.50

V
Oh my !

Ok, thanks for your answer (you're fast !)

I didn't check this as I though interecting polygon worked, I'm sorry (and ... the chunk of my code that generate the polygon is not supposed to do that >< )

Thanks for your time and your help

V


2012/8/31 Barend [via Boost Geometry] <[hidden email]>
Hi,

Welcome to the list!


On 31-8-2012 11:09, V wrote:
Hello world

I encounter a overlay_invalid_input_exception while using the
boost::geometry::intersection(p1,p2,out)

I don't get why it works with some polygons and not with other, any help
would be very welcome

this work :
str1 : POLYGON((530 -6890, 3530 -6890, 3680 -8240, 530 -6890))
str2 : POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426
-5976, -4073 -976, 6926 1523))

and not this :
str1 : POLYGON((4280 160, 5930 1810, 6980 1510, 6980 -4490, 5930 -7640, 4280
-7490, 4280 160))
str2 : POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426
-5976, -4073 -976, 6926 1523))

The read_wkt(str1,p1) et (str2,p2) get the right polygon each time.
The intersection(p1,p2,out) crashes only in the second case.



It does not crash but reports an exception.

Your second polygon POLYGON((6926 1523, 5926 -10976, 8426 -3476, -4073 -10976, 3426 -5976, -4073 -976, 6926 1523)) is self-intersecting:



The first intersection with this invalid polygon succeeds, because it probably happens to intersect it in a non-intersecting piece of it. Boost.Geometry does not checks self-intersectons before the process (for performance reasons). However, the second intersectoin is problematic, and then the polygons are checked on validity.

Regards, Barend





_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry



If you reply to this email, your message will be added to the discussion below:
http://boost-geometry.203548.n3.nabble.com/overlay-invalid-input-exception-in-1-50-tp4025097p4025098.html
To unsubscribe from overlay_invalid_input_exception in 1.50, click here.
NAML