Author Topic: Converting ISIS3 cubes for ArcMap 10  (Read 2221 times)

Planetary Researcher

  • Ra (Power Member)
  • *****
  • Posts: 134
Converting ISIS3 cubes for ArcMap 10
« on: May 01, 2012, 10:51:53 AM »
I've installed ArcGIS v10 and have been trying to open isis cubes with no luck at all. First I used isis2std on cubes within the 2GB file limit. This created a .jp2 and .j2w files. Arc can read the .jp2 file but does not see the .j2w file, which as I understand it, is necessary for the correct projection of the image right?

I also tried using gdal_translate to first make a tif file: 
> gdal_translate -a_srs .prj .jp2 .tif
(I made the .prj file with the help of isis3world.pl). Gdal keeps failing everytime I try this. Again, the files are within he filesize limit of 4GB, so I'm not sure what I'm doing wrong.

I have been searching high and low for some sort of instructions on what kind of processes need to be carried out on the files but haven't been able to find anything which is clear. Also is there any alternative for files that are bigger than 2GB? Or will I have to crop all my files and process them in smaller pieces?

thare

  • GIS Support Team
  • Isis (Extreme Power Member)
  • *****
  • Posts: 1185
    • http://webgis.wr.usgs.gov
    • Email
Re: Converting ISIS3 cubes for ArcMap 10
« Reply #1 on: May 01, 2012, 11:00:42 AM »
I've installed ArcGIS v10 and have been trying to open isis cubes with no luck at all.
Have you tried to open the cube directly? You may want to try this on the cube first to get the image to an easier to use 8bit format from 32bit. in ISIS3
> stretch from=ctx_level2.cub to=ctx_8bit.cub+UnsignedByte+0.0:255.0 usepercent=yes pairs="0.5:1.0 99.5:254" lis=1 lrs=1 his=254 hrs=254

Now try to load in the file "ctx_8bit.cub" directly into ArcMap. If it has issues run one more command:
> editlab from=ctx_8bit.cub options=delg grpname=Radiometry
This is trying to guess which section might have a unsupported continuation line in the ISIS label. This has been fixed in recent version of GDAL but ArcMap uses an older version of GDAL. see: https://isis.astrogeology.usgs.gov/IsisSupport/index.php/topic,3310.msg12934.html#msg12934

I also tried using gdal_translate to first make a tif file
For gdal_translate you still might want to run the stretch command but no need for "-a_srs", it will figure that out for you.
> stretch from=ctx_level2.cub to=ctx_8bit.cub+UnsignedByte+0.0:255.0 usepercent=yes pairs="0.5:1.0 99.5:254" lis=1 lrs=1 his=254 hrs=254
> gdal_translate ctx_8bit.cub ctx_8bit_geo.tif

So GeoTiffs can work above 4GB. These are called BigTiffs and ArcMap supports them. If it is failing above 4GB, you can force GDAL to use bigtiff.
> gdal_translate ctx_8bit.cub ctx_8bit_geo.tif -bigtiff=if_safer

You can also add-in some compression (optional):
> gdal_translate ctx_8bit.cub ctx_8bit_geo.tif -bigtiff=if_safer -co compress=lzw

Note: if the file is not really a simple image (e.g. CTX image) but it is "data" (e.g. DEM), don't stretch it first before conversion. ArcMap can handle 32bit files but you will need to tell ArcMap to calculate statistics and you may have to set the outside special pixel values to Nodata.

All these gdal commands should work unless the GDAL version is old. You can check with
> gdal_translate --version
Anything 1.8 and above should work and most of 1.7 should work for ISIS3 files.

Once they load in ArcMap feel free to build pyramids to speed up the draw time or use the new "basemap" layer to cache it for speed.

-Trent

related gdal tips: https://isis.astrogeology.usgs.gov/IsisSupport/index.php?topic=2172.0

Note: isis2std doesn't write out "geo" headers for geotiffs or geojpeg2000 formats. It writes out a simple GIS worlfile (*.j2w) which ArcMap can use to position the image but it doesn't define the projection. Open the worldfile up in a text file - it is just the X,Y cellsize in meters and where to start the first pixel in X,Y Cartesian space as defined by the map projection. It is only enough for ArcMap if all the other files are in the exact same projection (and you should set ArcMap's data frame to that projection also).
« Last Edit: May 01, 2012, 03:30:09 PM by thare »

ejones

  • Osiris (Active Member)
  • **
  • Posts: 10
    • E Jones
    • Email
Re: Converting ISIS3 cubes for ArcMap 10
« Reply #2 on: May 10, 2012, 08:45:17 PM »
Not sure if this will help you, but this is the way I do it for hirise jp2 files in ArcMap10:

i.   Download .JP2 (jpeg2000 image file) and .LBL (metadata file) to the same directory
ii.   Within ISIS3, run the perl procedure ‘pds2world.pl’ on the .LBL files with the following command:
for i in *.LBL; do perl pds2world.pl –J –prj $i; done
The –J command produces .jpw world files and the –prj command produces projection files.  Together they contain the spatial information associated with each image that ArcGIS requires to geo-reference and project the images.
iii.   Ensure that the naming of .jpw and .prj files matches the images, and they are placed in the same directory
iv.   Within ArcGIS, run the USGS Image Toolbox v1.5 tool ‘Batch set image projection from PRJ’.  This directs ArcMap to read the spatial information for each image from the .prj file.
v.   Import the .jp2 files into ArcMap with the setting ‘Use world file to define the coordinates of the raster’ unchecked.