X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Aug 2014 11:00 AM by  anon
Opening NITF files --> ENVI not storing geographic information
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
11 Aug 2014 11:00 AM
    I am trying to run ENVI's FX image segmentation doit on QuickBird NITF files, but the resulting shapefile contains no information about geographic location or projection. The lat/lons appear as pixel number values from the lower left. ENVI appears to have trouble decoding the information stored in NITF files. Is there a better way to open NITF files? My code is below. CD, CURRENT=c & PRINT, c files=FILE_SEARCH(c + '\' + '*.ntf') ; i=0 ; will eventually batch these files, just trying to get the basics to run envi_open_data_file, files[i], /nitf raster=e.OpenRaster(files[i]) fid=ENVIRasterToFID(raster[0]) envi_file_query, fid, nb=nb, fname=fname, dims=dims then i run the envi_doit, 'envi_fx_segmentonly_doit'. Thanks!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    11 Aug 2014 12:37 PM
    When you open the NITF, does it show the projection as RPC projected? If so, then the data may not really be projected but instead contains polynomials describing the geometry of the file which allows ENVI to report projected coordinates. The RPC information cannot be passed on to a vector file. If this is the case, you need to first perform RPC Orthorectification on the image, then use this result in the FX module.

    Deleted User



    New Member


    Posts:
    New Member


    --
    12 Aug 2014 10:49 AM
    Hi MariM, thank you for your quick reply. You help was crucial in understanding this problem! Yes, as you suggest, my data is RPC projected so I will need to perform an RPC Orthorectification on the image. This is super easy in ERDAS Imagine where i can choose to orthorectify without GCP, can choose the geometric model to be QuickBird RPC, and change the coordinates to polar stereograph. The RPC Orthorectification Workflow tool in the ENVI toolbox only allows me to resample the image in geographic coordinates. What tool should I use for the orthorectification and reprojection, and is there an accompanying IDL doit? Ideally, I want an to automate the process to run the RPC orthorectification on all my images. UPDATE: When i use the "rigorous orthorectification" toolbox, i have the option of choosing the geometric model to be QuickBird, but I do not have the option to change the reprojection from geographic to project coordinates. I also get the error message: "Unable to add DigitalGlobeFormat file. IDL_IDLBRIDGE ERROR:...Compressed image not supported: JPEG2000. " The NITF images ARE compressed by JPEG, so I must need to uncompress the images and find where the Digital Globe Format file is located? For an attempt at automation, i tried the code written here: http://www.exelisvis.com/...orectification.html. With some adjusting with file names, the error i get is at "DataColl.Add, Task.Output_Raster" The error is that "Required arguments are missing". Back to the fundamental question - how to automate loading NITF images into ENVI? How do I perform an RPC Orthorectification and a reprojection into polar sterographic coordinates (and is uncompressing the JPEG and finding the DigitalGlobe Format File necessary?). Thank you!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    13 Aug 2014 08:03 AM
    I would use the RPC Orthorectification rather than the rigorous ortho for processing a single file. If you have a bundle that needed to be mosaicked at the same time, then the Ortho module would be more useful here. Also, there does appear to be an issue using compressed NITF files in the module. Saving the uncompressed product in ENVI format would probably not work in the module since it requires the original datasets. Can you successfully run the RPC Orthorectification workflow in the GUI? You are not required to add GCPs but you are required to use a DEM. When you get the error regarding the "DataColl.Add, Task.Output_Raster", this is using information from the previous call: ; Get the data collection DataColl = e.Data Is DataColl valid? It is true that RPC Orthorectification only projects to UTM/WGS. From here you would need to use the Reproject Raster tool in ENVI 5.x. Unfortunately, there currently is no Reproject Raster programming routine to do this (it may be coming in ENVI 5.2). You could use ENVI Classic's ENVI_CONVERT_FILE_MAP_PROJECTION for this. Uncompressing the NITF file should not be necessary with these routines although it can take significantly longer processing compressed NITF files. So, you can use the e.OpenRaster to open the files, ENVITaskRPCOrthorectification to orthorectify the data, ENVI_CONVERT_FILE_MAP_PROJECTION to project to the projection of your choice.

    Deleted User



    New Member


    Posts:
    New Member


    --
    08 Sep 2014 10:39 AM
    Great, got this all figured out. Thank you for your help!
    You are not authorized to post a reply.