X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 09 Dec 2008 01:18 PM by  anon
Set map projection information to a dataset
 6 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
09 Dec 2008 01:18 PM
    Hi, there I have got a 2-D array (eg. image[4000,4000] ), the data type is float, this array could be visuaized by ENVI / open image files, but there is no map information in "avaiblae bands list". So I want to set some kinds of map projection information to this dataset, for example Albers Conical Equal Area map projection,the central point would be N 20, W 35. which procedures in IDL should I use? Acturally, I search in IDL help, but I am totally confused by MAP_SET, MAP_IMAGE, and other MAP_ functions. So, Thank you very much if youcan explain these functions to me. Tanks

    Deleted User



    New Member


    Posts:
    New Member


    --
    22 Dec 2008 09:33 AM
    Is there anybody can help me with this question?

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    22 Dec 2008 12:50 PM
    If you want this information to show up in ENVI's Available Bands List, you would want to use ENVI's routines for defining the projection.  These are called ENVI_PROJ_CREATE and ENVI_MAP_INFO_CREATE.  Be aware that these routines are used for setting the projection, not projecting an image into this projection.  It is important to first set the projection of the image to the existing projection, if there is one.  Then you can convert it to a different projection if you choose using ENVI_CONVERT_FILE_MAP_PROJECTION.  If the image is raw and has not yet been projected, then you must first use one of the standard projection techniques (using GCPs or orthorectificaiton using RPCs).

    Deleted User



    New Member


    Posts:
    New Member


    --
    22 Dec 2008 02:46 PM
    Hi, mminari Again, thank you very much for you suggestion. My dataset is raw and has not been projected. acturally, I use HDF_SD_START(/create), HDF_SD_CREATE, and HDF_SD_ADDDATA to generate a HDF dataset. so there is no map projection information or GCPs files. However, I know the extent of the dataset (its latitude and longitude are known). I mean, is "standard projection techniques" in your suggestion necessary? or is there any way instead? Thanks.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    23 Dec 2008 07:28 AM
    If the dataset has not been projected to a map projection, then it would be inaccurate to create map info for the file.  If the image is in a geographic coordinate system, you could set the projection structure to a geographic projection and set the upper left lat/lon as the MC array in the Map Info structure.  However, if the image is projected and not north up (there is rotation), then the coordinates repoted in ENVI (when say, using the cursor location/value tool) will not be accurate and it would be better to actually perform an image registration.

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Dec 2008 07:56 AM
    Hi,mminari, Thank you.  I have read the online ENVI / IDL help last night, and I try to use ENVI_GET_PROJECTION to get prijection information from other external file, then use ENVI_MAP_INFO_CREATE to get the map information. After that, I suppose to use ENVI_SETUP_HEAD to generate a head file for my data. Now, I am testing the codes, hope that it will see me through. Thanks.  

    Deleted User



    New Member


    Posts:
    New Member


    --
    05 Jan 2009 11:41 AM
    Hi, after I use these functions to add projection information to a disk file, I can not load the disk file in ENVI (from available bands list), the error information is "the array has too many elements" and when I check the cursor location / value, I found that the value is not the content of the array. I suppose the value is DN but not the VALUE of the image(array). But I can check the dataset array by using HDF Explorer, can someone tell me the reason? ps: the code I use to add map projection information is: ENVI_OPEN_FILE,'E:\My Documents\Data\test\ia07nass_cdl_reSize_231_resample',R_FID=cdlFID PROJ_STRUCTURE = ENVI_GET_PROJECTION(FID=cdlFID) MC=[0.0,0.0,-7783644.6621,4846534.2049] PROJ=PROJ_STRUCTURE PS=[231.65671784,231.65671784] ROTATION=0.0 UNITS=ENVI_TRANSLATE_PROJECTION_UNITS('Meters')         MAP_INFO_STRUCTURE=ENVI_MAP_INFO_CREATE(MC=MC,PROJ=PROJ,PS=PS,ROTATION=ROTATION,UNITS=UNITS) ENVI_SETUP_HEAD,DATA_TYPE=4,FNAME=FILE_PATH_1+'NDVIFILE_'+DATE[i]+'.HDF',$         INTERLEAVE=0,NB=1,NL=1511,NS=2302,OFFSET=0,MAP_INFO=MAP_INFO_STRUCTURE,$         /write,/open   Thank you
    You are not authorized to post a reply.