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

Home » Public Forums » archive » reading shapefiles & IDL objects
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: reading shapefiles & IDL objects [message #78849 is a reply to message #78778] Wed, 21 December 2011 12:12 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
desertdryad writes:

> Ok, I've managed to read in my shapefile (I seemed to have to put my
> shapefile where the 'states.shp' file was, at lest for now).

This suggests to me that your "shape" file doesn't have all
the other pieces that a shape file needs. In other words,
the *.shx and *.dbf files have to be in the same directory
as the *.shp file, or the shape file ain't a shape file!

> But I'm
> not sure how to so what I want to do with it! I want to correlate the
> location of the entities in my shapefile with an image that covers the
> same geographic extent. In other words, I want to know what the
> coordinates of the entities are so that I can extract the date in the
> image that they overlay - I don't need to draw the shapefile on the
> image/map, but I do need to know where on the map its entities are.
> I'm not seeing an obvious way to do that?

The simplest way is just to march through the entities
and keep track of the entities's bounds. This is how
cgDrawShapes works, when you set the AutoDraw keyword.

FOR j=0,N_Elements(*entities)-1 DO BEGIN
thisEntity = (*entities)[j]
entityMinX[j] = thisEntity.bounds[0]
entityMaxX[j] = thisEntity.bounds[4]
entityMiny[j] = thisEntity.bounds[1]
entityMaxY[j] = thisEntity.bounds[5]
ENDFOR
xrange = [Min(entityMinX), Max(entityMaxX)]
yrange = [Min(entityMinY), Max(entityMaxY)]
cgPlot, xrange, yrange, ....

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Widget Object graphics code crashes V8.2
Next Topic: Re: IDL/ENVI Attempt to call undefined procedure/function - ENVI_PROJ_CREATE

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

Current Time: Tue Dec 02 11:12:00 PST 2025

Total time taken to generate the page: 3.35623 seconds