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

Home » Public Forums » archive » Re: How to extract pixel values from a GeoTIFF using an Esri Shapefile
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: How to extract pixel values from a GeoTIFF using an Esri Shapefile [message #74091 is a reply to message #74079] Thu, 23 December 2010 13:34 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul Magdon writes:

> ;Convert SHP to ROI object
> myroi = OBJ_NEW( 'IDLanROI',( *ent.vertices)[0,*] ,(*ent.vertices)
> [1,*] )
>
> ;Apply ComputMask method
> maskResult = myroi -> ComputeMask(DIMENSIONS = [s[0],
> s[1]],MASK_RULE=2)
>
> ; Here starts the problem; I have a 5000x5000 raster (img) and the
> image coordinate system start with [0,0] but the myroi coordinates are
> much higher (eg 227984.00 ; 991472.00) Thus everything is masked.
> ;There is a keyword LOCATION for ComputeMask but I am not sure how to
> use it and where to get the right values for it

I have to admit I have never done this before. (Although
I would like to try if you could make the image and
shape file available to me.) But, it seems to me
that when you create the ROI, you will have to give
the ROI the range of the image to make this work.

mapCoord -> GetProperty, XRANGE=xr, YRANGE=yr
myroi = OBJ_NEW( 'IDLanROI',( *ent.vertices)[0,*] ,$
(*ent.vertices)[1,*], ROI_XRANGE=xr, $
ROI_YRANGE=yr )

That way, the ROI and the image are mapped to the same
coordinate system.

I'm curious to know if that works. :-)

Cheers,

David

P.S. The next book I am thinking of writing is a small
book about map projections in IDL. The more examples I
have like this, the better. I have to write this book
before I forget everything I've learned in the past four
years. :-)


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: division to move a decimal point
Next Topic: array handling

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

Current Time: Fri Oct 10 09:48:07 PDT 2025

Total time taken to generate the page: 0.40274 seconds