Re: Shape to raster [message #78114] |
Thu, 27 October 2011 09:55  |
MarioIncandenza
Messages: 231 Registered: February 2005
|
Senior Member |
|
|
On Oct 26, 12:52 pm, Fabzou <fabien.mauss...@tu-berlin.de> wrote:
> Dear IDLers,
>
> My apologies if this question has been posted before.
>
> I have a polygon vector file from which I know the coordinates within a
> grid (subpixel precision) and I would like to make a mask from this
> information (within the polygon = 1, outside = 0).
I have a routine INSIDE.PRO which does this. I don't remember where it
came from, and I'm not in front of my computer to check the file, but
it does the job without any ENVI nonsense.
Do a web search for it, and if it doesn't turn up, repost to this
thread and I'll turn up the provenance.
--Edward H.
|
|
|
Re: Shape to raster [message #78117 is a reply to message #78114] |
Thu, 27 October 2011 05:30   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Fabzou writes:
> Wow, I am just starting to realize that this IDLanROI object is going to
> change a lot of things in my programs!
>
> But, as far as I understand the documentation, it only stores one
> entity. So, if I have many entities (often the case in my shapefiles), I
> have to instance many IDLanROI objects, generate a mask for all of them
> and then combine the masks together? Or did I miss something again?
No, you can do all this with one IDLanROI object. Simply
use the MASK_IN keyword to the Compute_Mask method to
pass in and modify the mask from previous polygons.
Yes, the IDLanROI object is one of those game changers
in IDL, once you learn of its existence. :-)
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.")
|
|
|
|
|
Re: Shape to raster [message #78180 is a reply to message #78117] |
Mon, 31 October 2011 07:18  |
Fabzou
Messages: 76 Registered: November 2010
|
Member |
|
|
Hi again,
On 10/27/2011 02:30 PM, David Fanning wrote:
> Fabzou writes:
>> But, as far as I understand the documentation, it only stores one
>> entity. So, if I have many entities (often the case in my shapefiles), I
>> have to instance many IDLanROI objects, generate a mask for all of them
>> and then combine the masks together? Or did I miss something again?
>
> No, you can do all this with one IDLanROI object. Simply
> use the MASK_IN keyword to the Compute_Mask method to
> pass in and modify the mask from previous polygons.
I ended up using IDLanROIgroup. It crashes (fatal error!) when there are
too many entities (thousands of them) but this was just for a test and
everything works fine in "normal" cases.
I have an other question though. How will the IDLanROI object
"understand" the XY coordinates [0.5,0.5]? In my conception, these
coordinates correspond to the center of the first down left pixel, but
my first tests tend to show that this may not be the case...
Thanks!
|
|
|