comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Finding a points inside polygon
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Finding a points inside polygon [message #32646 is a reply to message #32630] Thu, 24 October 2002 14:06 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
I plotted the polygon and the point as you specify. It looks to me that
the point does lie outside the polygon, some 0.0001x and 0.001y to the
right and below the border, to be exact. Check the coordinates, make
sure the floating point precision does not play a joke on you.
David's INSIDE returns zero also.
Make sure your polygon is closed:
vx = [vx, [vx[0]]
vy = [vy, vy[0]]
IDL> print, inside(x, y, vx, vy)
0
So I suspect that there is nothing wrong with the ROI object in this case.
Good luck,
Pavel

Gunho Sohn wrote:
>
> 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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL --> C++ ?
Next Topic: Map_Set and Sat_P

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:32:58 PDT 2025

Total time taken to generate the page: 1.27891 seconds