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

Home » Public Forums » archive » Understanding IDLanROI
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Understanding IDLanROI [message #72853] Fri, 08 October 2010 14:13 Go to previous message
KRDean is currently offline  KRDean
Messages: 69
Registered: July 2006
Member
I am attempting to use IDLanROI to determine if Shapefiles overlap
another Shapefile.

Sometimes it works, sometimes it doesn't. Especially, if the polygon
lies within the interior.

I put together a test program that retrieves the States and uses
IDLanROI to determine if it lies within the US.

Why does Colorado not considered to be in the United States, among
some other interior States?

Is IDLanROI not the IDL routine to use to perform this check?

Kelly Dean
Milliken, CO

;+
;
;
;
;----------------------------------------------------------- -----------
PRO ITT_PolyOverlap


states_path = FILEPATH('states.shp',SUBDIR=['resource', 'maps',
'shape' ])
country_path = FILEPATH('country.shp',SUBDIR=['resource', 'maps',
'shape' ])

PRINT, states_path
PRINT, country_path

oSHP = OBJ_NEW('IDLffShape', country_path )
ent1 = oSHP -> GetEntity( 34, /ATTRIBUTES ) ; USA
OBJ_DESTROY, oSHP

PRINT, ' -- Working with country : ', (*ent1.attributes).attribute_4

oSHP = OBJ_NEW('IDLffShape', states_path )
oSHP -> GetProperty, N_ENTITIES = num_ent
FOR staten = 0, num_ent DO BEGIN

oSHP = OBJ_NEW('IDLffShape', states_path )
ent0 = oSHP -> GetEntity( staten, /ATTRIBUTES )

oROI = OBJ_NEW('IDLanROI', (*ent1.vertices) )
pttest = oROI -> ContainsPoints( (*ent0.vertices) )
OBJ_DESTROY, oROI

overlap = WHERE( ptTest GT 0, count )

IF ( count GT 0 ) THEN BEGIN
PRINT, ' === ' , (*ent0.attributes).attribute_1, ' inside ',
(*ent1.attributes).attribute_4, ' === ', count
ENDIF ELSE BEGIN
PRINT, ' <<< ' , (*ent0.attributes).attribute_1, ' outside ',
(*ent1.attributes).attribute_4, ' >>> ', count
ENDELSE

ENDFOR

OBJ_DESTROY, oSHP

END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Still missing features in IDL 8
Next Topic: Subtracting arrays of same dimension, different size - interpolating one to fit the other

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

Current Time: Thu Oct 09 05:12:41 PDT 2025

Total time taken to generate the page: 0.24260 seconds