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

Home » Public Forums » archive » Re: Apply a shapefile to raster images in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Apply a shapefile to raster images in IDL [message #41255] Mon, 04 October 2004 15:38 Go to next message
envi35 is currently offline  envi35
Messages: 8
Registered: October 2004
Junior Member
Hi David,
Thank you very much for your reply. I've taken a quick look at Jim
Pendleton's code. you are right, as an IDL novice, I don't think I can
do it within the timeline. I guess I have to try something else, like
rasterize the shapefile in ENVI and then interpolate it to my raster
image grid...

Regards, Jenny


David Fanning <david@dfanning.com> wrote in message news:<MPG.1bcae028e3b99943989692@news.frii.com>...
> Jenny writes:
>
>> I'm a novice in IDL, not sure if my questions are totally improper. I
>> want to use an Arcview format shapefile as a mask, to a huge number of
>> raster images, which are in a polar stereographic grid format with
>> separate image data files and lat/lon files. I would really appreciate
>> if you could give me any hint about the following questions:
>>
>> 1. How to read the shapefile into an IDL variable?
>> 2. How to tailor the shapefile to my raster image grid?
>> 3. If the above questions are not proper or impossible in IDL, would
>> you give me some suggestions to do the work?
>
> It's not that it is impossible to do 1 and 2 in IDL, it
> certainly is possible. The problem is that it is impossible
> to tell a novice IDL user how to do it. :-(
>
> Here is a suggestion. Go to the RSI User Contribution site
> and search on "shapefile". There is a shapefile viewer there
> written my Jim Pendleton. I'd study that code a bit, and see if
> it doesn't at least go a little ways towards answering some
> of your questions.
>
> We need a good shapefile example somewhere. Does anyone
> have anything I could clean up a bit and make available
> on my web page?
>
> Cheers,
>
> David
Re: Apply a shapefile to raster images in IDL [message #41260 is a reply to message #41255] Mon, 04 October 2004 13:17 Go to previous messageGo to next message
Kelly Dean is currently offline  Kelly Dean
Messages: 92
Registered: March 1997
Member
It certainly can be done, but as David has pointed out, it is not
trivial. The IDL shapefile read routine requires knowledge of IDL's Objects.

I use shapefiles to add the graphics to satellite imagery using IDL's
shapefile read routines. See my image contribution to RSI's User
Contributions at www.rsinc.com. I use the county.shp to add the Colorado
county boundaries to the AVHHR imagery centered over Colorado.

To avoid the shapefile issue, I suggestion you use ArcView (or ArcGIS)
and save the shapefile as an Excel spread sheet. Then within Excel, save
the columns of latitude and longitude values as a text file and use the
IDL's OPEN/READ routines to read the text file and save the values in
separate latitude and longitude arrays. Then use the IDL's MAP_COORD
routine to convert the latitude and longitude values to window
coordinates, assuming the polar stereographic grid you desire is the
same as IDL's MAP_SET, /Stereo --- just a suggestion. However, learning
to read shapefiles directly with the IDL objects is the best and long
term why to go. The opportunities are endless.

Kelly Dean
Colorado State University
Fort Collins, Colorado

Jenny wrote:
> Dear Listers,
> I'm a novice in IDL, not sure if my questions are totally improper. I
> want to use an Arcview format shapefile as a mask, to a huge number of
> raster images, which are in a polar stereographic grid format with
> separate image data files and lat/lon files. I would really appreciate
> if you could give me any hint about the following questions:
>
> 1. How to read the shapefile into an IDL variable?
> 2. How to tailor the shapefile to my raster image grid?
> 3. If the above questions are not proper or impossible in IDL, would
> you give me some suggestions to do the work?
>
> Thank you in advance,
> Jenny
Re: Apply a shapefile to raster images in IDL [message #41271 is a reply to message #41260] Mon, 04 October 2004 04:21 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jenny writes:

> I'm a novice in IDL, not sure if my questions are totally improper. I
> want to use an Arcview format shapefile as a mask, to a huge number of
> raster images, which are in a polar stereographic grid format with
> separate image data files and lat/lon files. I would really appreciate
> if you could give me any hint about the following questions:
>
> 1. How to read the shapefile into an IDL variable?
> 2. How to tailor the shapefile to my raster image grid?
> 3. If the above questions are not proper or impossible in IDL, would
> you give me some suggestions to do the work?

It's not that it is impossible to do 1 and 2 in IDL, it
certainly is possible. The problem is that it is impossible
to tell a novice IDL user how to do it. :-(

Here is a suggestion. Go to the RSI User Contribution site
and search on "shapefile". There is a shapefile viewer there
written my Jim Pendleton. I'd study that code a bit, and see if
it doesn't at least go a little ways towards answering some
of your questions.

We need a good shapefile example somewhere. Does anyone
have anything I could clean up a bit and make available
on my web page?

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Apply a shapefile to raster images in IDL [message #41342 is a reply to message #41260] Tue, 05 October 2004 18:49 Go to previous messageGo to next message
envi35 is currently offline  envi35
Messages: 8
Registered: October 2004
Junior Member
Hi Kelly,
Thanks for your suggestion. I'd like to try it. But my polar
stereographic grid is a special one. Can I set parameters such as the
origin of the projection and the grid size (resolution) with map_set
in IDL? Sorry, I've looked the online help of map_set in IDL, but I'm
still not sure. Are P0lat and P0lon in map_set the origin of the
projection?

Many thanks, Jenny


Kelly Dean <krdean@lamar.colostate.edu> wrote in message news:<4161afcf@news.ColoState.EDU>...
> It certainly can be done, but as David has pointed out, it is not
> trivial. The IDL shapefile read routine requires knowledge of IDL's Objects.
>
> I use shapefiles to add the graphics to satellite imagery using IDL's
> shapefile read routines. See my image contribution to RSI's User
> Contributions at www.rsinc.com. I use the county.shp to add the Colorado
> county boundaries to the AVHHR imagery centered over Colorado.
>
> To avoid the shapefile issue, I suggestion you use ArcView (or ArcGIS)
> and save the shapefile as an Excel spread sheet. Then within Excel, save
> the columns of latitude and longitude values as a text file and use the
> IDL's OPEN/READ routines to read the text file and save the values in
> separate latitude and longitude arrays. Then use the IDL's MAP_COORD
> routine to convert the latitude and longitude values to window
> coordinates, assuming the polar stereographic grid you desire is the
> same as IDL's MAP_SET, /Stereo --- just a suggestion. However, learning
> to read shapefiles directly with the IDL objects is the best and long
> term why to go. The opportunities are endless.
>
> Kelly Dean
> Colorado State University
> Fort Collins, Colorado
>
> Jenny wrote:
>> Dear Listers,
>> I'm a novice in IDL, not sure if my questions are totally improper. I
>> want to use an Arcview format shapefile as a mask, to a huge number of
>> raster images, which are in a polar stereographic grid format with
>> separate image data files and lat/lon files. I would really appreciate
>> if you could give me any hint about the following questions:
>>
>> 1. How to read the shapefile into an IDL variable?
>> 2. How to tailor the shapefile to my raster image grid?
>> 3. If the above questions are not proper or impossible in IDL, would
>> you give me some suggestions to do the work?
>>
>> Thank you in advance,
>> Jenny
Re: Apply a shapefile to raster images in IDL [message #92907 is a reply to message #41271] Mon, 21 March 2016 00:37 Go to previous message
Puneeth Shankar is currently offline  Puneeth Shankar
Messages: 21
Registered: June 2015
Junior Member
Hi,
while i'm able to overlay a polygon shapefile over raster(geotiff) using imap as shown below:

imap,REFORM(ortho2[0,*,*]),/order,GEOTIFF=gtiff_VI_l_shrinke d,RGB_TABLE=8
imap,roi_shapefile,OVERPLOT=1

I'm unable to do the same using MAP function, which replaces the functionality of imap.My objective is to do this without using itools.Can this be done?

Regards,
Puneeth
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Illegal variable name
Next Topic: How can I restore many files

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

Current Time: Wed Oct 08 15:07:16 PDT 2025

Total time taken to generate the page: 0.00713 seconds