Finding a points inside polygon [message #32651] |
Thu, 24 October 2002 06:32 |
Gunho Sohn
Messages: 3 Registered: October 2002
|
Junior Member |
|
|
Dear All,
I have a problem to determine whether a point (x,y) is inside the polygon.
Simply I've used IDLanROI::ContainsPoints method in my code. However, it
seems to make a serious problem. Please, check this problem together. I used
following polygons and point
polygon vertices (vx,vy):
vx=[35.859278 55.591451 155.00000 155.00000]
vy=[0.00000000 0.00000000 19.279154 23.105984]
point (x,y):
x=122.87897 y=13.049367
When I simply coded this as follows, it printes as 0 which means this point
is located outside of polygon. But, it is not!
o_poly=obj_new('IDLanROI', vx,vy)
print, o_poly->ContainsPoints(x,y)
I compared this using fanning's inside.pro, as I expected 'inside.pro' said
this point is in the polygon.
Do I something wrong using IDLanROI object?
I hope to hear anything from you soon.
Many thanks,
Gunho
|
|
|