Link to USGS home page

U.S.G.S. Planetary GIS Web Server - PIGWAD

Planetary Interactive G.I.S.-on-the-Web Analyzable Database

PLANETARY G.I.S. FAQ (Frequently Asked Questions)

Please use the Planetary GIS Discussion site for more up-to-date questions and answers.


Table of Contents

  1. I need help!
  2. How do I project lon,lat (geographic) vector coverages
    real-time in ArcView 3.x?
  3. How do I project lon,lat (geographic) vector coverages
    real-time in ArcView 8.x?
  4. Can I project images or grids real-time in ArcView?
  5. How do I get my vector files and images to overlay?
  6. How come my data is mirrored on Mars?
  7. How does ArcView, Arc/INFO, and most other commercial software deal with positive west longitudes?
  8. How do I georeference planetary images like ISIS, PICS, and PDS and save their label information?

I need help!

The best help from this site is contained on the Planetary GIS Discussion site. This has information for applications and datasets. As a new user please browse over the old threads for morsels of good information and feel free to join and ask questions.

Back to Top

How do I project lon,lat (geographic) vector coverages
real-time in ArcView 8.x or 9.x?

Please see this ArcMap 8.x and 9.x tutorial.

Back to Top

How do I project lon,lat (geographic) vector coverages
real-time in ArcView 3.x?

The easiest way to accomplish this is to use the Projection Spheroid Extension. I have also a small ArcView scripts that show example of how to do this in Avenue (below). Both these methods, will allow you to bring over a decimal degree geographic graticule, geologic, etc. to overlay a georeferenced image or to just temporarily reproject the data.

If the vector coverage is pre-projected (ex. already in Sinusoidal) this will not work. The coverage must be in decimal degrees not meters or feet.

Sample Avenue code for setting projections.

Back to Top

Can I project images or grids real-time in Arcview 3.x?

ArcView 3.x cannot project images on-the-fly, it can only project vector (feature) files on-the-fly. ArcView, ArcEditor, and ArcInfo version 8.x and 9.x can project rasters on-the-fly. To project you images to different projection you will need an application like ISIS, ENVI, Arc/Info, or other image processing package. Although if you own Spatial Analyst, Kenneth R. McVay, has written an extension called Grid Projector that might be useful. Jeff Jenness has also generated a Grid Projector extension (and many other great tools).

Back to Top

How do I get my vector files and images to overlay?

If the vector data is in decimal degrees (latitude/ longitude) you must project it to the same projection as the image for them to overlay in ArcView 3.x. You can use the extension or avenue code in the ArcView project question above to help you along.  If you vector files are already in a projection then any other dataset you wish to view in the same space must be in the same projection whether it is vector or raster. To project you data from a known projection in meters to decimal degrees (lon/lat), ESRI supports a projection utility but it doesn't appear you can change the spheroid. If you modfiy the extension "projector!" with the Avenue code above you can get from meters to decimal degrees with planetary datasets. I hope to modify the projection and spheroid extension to allow for this conversion. For imagery registration please read the sections on image registration to properly register your imagery.

Back to Top

How come my data is mirrored on Mars?

How does ArcView, ArcInfo, and most other commercial software deal with positive west longitudes?

ArcView and Arc/INFO and most other mapping software can only deal with positive east coordinate systems (without enhancements). Because of this, all our GIS datasets are stored in a positive east coordinate system. Thus when one is working with older Mars data or another body that is defined as positive west, you must convert the longitudes to emulate Earth.  Recently, the Mars longitude system was standardized to use east. Thus older data will be west and new datasets will be east. See figures for examples.

-------------------------------------------------------
|                           MARS (west)               |
|                            |                        |
180     <---(90)-----        0                        |
|                           and                       |
|                            0    -----(-90)----->  -180
|                            |                        |
|                            |                        |
|                            |                        |
-------------------------------------------------------

Again ArcView 3.x prefers positive east 180 system (-180 to 180).  So you must convert the coordinates (basically NEGATE ALL LONGITUDES for Mars to fit in a Earth based system). ArcMap versions 8 and up can use positive 180 and 360 (0 to 360) decimal degree systems.
longitude = longitude * -1

-------------------------------------------------------
|                 EARTH or Mars (east)                |
|                            |                        |
-180    <---(-90)-----       0                        |
|                           and                       |
|                            0     -----(90)----->  -180
|                            |                        |
|                            |                        |
|                            |                        |
-------------------------------------------------------


Mars  can also look like:
(this also needs to be change to Earth coordinates above)
-------------------------------------------------------
|                      MARS (west 360)                |
|                            |                        |
180     <---(90)-----        0                        |
|                            |                        |
|                           and                       |
|                            |                        |
|                           360    <-----(270)-----  180
|                            |                        |
|                            |                        |
-------------------------------------------------------  

To change Martian longitudes from a 360 West system to a 180 East system: 
if (longitude > 0) then longitude = longitude * -1
else longitude = 360 - longitude 

To change Martian longitudes from a 360 West system to a 360 East system: longitude = 360 - longitude

Back to Top

How do I georeference planetary images like ISIS, PICS, and PDS and save their label information?

By renaming the the ISIS, PDS or PICS image and creating an ASCII header and an ASCII georeference world file you can read these natives formats into most GIS/Remote Sensing applications.

The three things you need are:
1.) The Image (*.cub,*.pic,*.img renamed to *.bil, *.bsq, *.bip)
2.) One must create the external ASCII header file (*.hdr)
3.) One must create the ASCII georeference world file (*.bqw ...)

There are two major problems one must understand as to why there is not a simple solution.

First, ISIS Cubes/PICS/PDS images are originally defined by latitude and longitude coordinates no matter what projection they are in. However, 'hidden' in label is the necessary information to georeference the images if they are in a map projection. 

Second, GIS packages like Arc/INFO and ArcView only work in positive east longitude systems. Mars is historically positive west. To get older Mars images to work in most packages you must fool the software. This is also explained above.

There are two sections below - one for the image header file which defines the number lines and samples, bands, ... and the second defines the georeferencing information.

1.) Creation of the ASCII header file:

1A.) Procedure for ISIS cube header
We have created a PERL script, called isis2world.pl and a very rough "C" routine, called isis_hdr.c, that strips information out of an ISIS Cub header and makes an external header file. The PERL script also generates the georeferencing world file. With this header file several programs like ENVI, ArcInfo, ArcView, ERDAS and others can read an ISIS cube in its' native format.

Here are examples of how to create your own header file for an ISIS cub:

1.) The image or .cub file must be renamed to have an extension defined by the layout parameter

  • .bil - Band Interleave by Line
  • .bsq Band Sequential
  • .bip Band Interleaved by Pixel 
    • Note: for a single band image the extension doesn't matter

2.) edit (vi or xedit) myISIScub.hdr (for the file myISIScub.bil)

/* START OF FILE
nrows 3050           /* nrows = nl
ncols 4570             /* ncols = ns
nbands 1                /* number of bands
nbits 8                    /* bit type of image (8,16,...)
byteorder I             /* M,I for hardware arch. (doesn't matter for 8bit), Motorola (Sun, Mac), Intel (PCs)
layout bil                 /* format of data (BIL,BSQ,BIP)
skipbytes 22016     /* skipbytes = RECORD_BYTES * (^QUBE - 1)
/* END OF FILE

Note: the /* allows you have comments in the header. It is a good idea to keep them in there so you don't forget what they mean.

Note: RECORD_BYTES and ^QUBE are both in the Cub header. Just
type at the UNIX prompt: more myISIScub.cub or open in your favorite
text editor.

Warning: This doesn't take into consideration of CORE_MULTIPLIER, special pixels, ...

***********************************************************
1B.) Procedure for PICS image header file
***********************************************************
1.) The image or myPICSimage.pic file should be renamed to myPICSimage.bil

2.) edit (vi or emacs) x.hdr:

/* START OF FILE
nrows 3050             /* nrows = nl
ncols 4570              /* ncols = ns
nbands 1                 /*** always for 1 planed pics
nbits 8                     /* bit type of image (8,16)
byteorder I              /*** always for pics
layout bil                  /*** format of data (Suggest BIL)
skipbytes 22016      /*** always for pics
bandrowbytes 4608 /*** [nint((ncols*nbits/4096) + .49999)] * 512
/* |-> nint means to round up if greater than or equal to .5

/* END OF FILE
Note: the /* allows you have comments in the header. It is a good idea to keep them in there so you don't forget what they mean.


***********************************************************
1C.) Procedure for PDS image header file
***********************************************************

1.) The image or .img file must be renamed to have an extension defined by the layout parameter

  • .bil - Band Interleave by Line
  • .bsq Band Sequential
  • .bip Band Interleaved by Pixel 
    • Note: for a single band image the extension doesn't matter.
    • This will not work for Jpeg compresses PDS images.

2.) edit (vi or xedit) myPDSimage.hdr (for the file myPDSimage.bil)

/* START OF FILE

nrows 3050         /* nrows = nl
ncols 4570          /* ncols = ns
nbands 1             /* number of bands
nbits 8                 /* bit type of image (8,16,...)
byteorder I          /* M,I for hardware arch. (doesn't matter for 8bit), Motorola (Sun, Mac), Intel (PCs)
layout bil             /* format of data (BIL,BSQ,BIP)
skipbytes 22016 /* skipbytes = RECORD_BYTES * (^IMAGE - 1)

/* END OF FILE

Note: the /* allows you have comments in the header. It is a good idea to keep them in there so you don't forget what they mean.

Note: RECORD_BYTES and ^IMAGE are both in the PDS header. Just type at the UNIX prompt: more myPDSimage.img or open in your favorite text editor.


***********************************************************************
2). Creation of the georefencing "world" file 
***********************************************************************
We have created a PERL scripts, called isis2world.pl and pds2world.pl that will help generate world files from ISIS or PDS images. Also, the Projection and Spheroid extension for ArcView 3.x allows you to generate world files (activating this extension and setting the images projection will produce a button that will calculate a world file from a lat/long and image resolution).

Here is what a world file contains:

  • x,y cell size
  • rotation (should always be zero)
    and top left pixel lat,lon in meters/feet (coords for the center of the
    pixel)

FOR THE WORLD FILE: (This file georeferences the image)
x,y cell size
rotation (should always be zero)
and top left pixel lat,lon in meters/feet (coords for the center of the
pixel)
file name: x.blw
******example file format*******
28.50000000000000 -> X cellsize (ex. 28.5 meters)
0.00000000000000 -> must be zero if not rectifying (rotation)
0.00000000000000 -> must be zero if not rectifying (rotation)
-28.50000000000000 -> Y cellsize(usually same as X and NEGATIVE)
13356427.02278839100000 -> x in projected meters or feet
813809.65608045168000 -> y in project meters or feet
*********************************

If image is a Sunraster then world file is image.rsw
if image is a raw Band Sequential (BSQ) then image.bqw
if image is raw Band Interleave by Line (BIL) then image.blw
if image is raw Band Interleave by Pixel (BIP) then image.bpw
if image is a TIFF then image.tfw
if image is JPG then image.jgw
if image is a GIF then image.gfw


To get the lon,lat into x,y you can do the commands in ARC:
create a new file with the lon,lat (x,y) on one line
Example File: mars_tic.txt
120.245345 45.4534533

Note: This projection method works for coverages and grids also.

ARC> project file mars_tic.txt mars_merc.tic
input
projection geographic
units dd
parameter
output
projection mercator
units meters
parameter 3393400.0 3375730.0 (semi-major/minor axis for MARS)

In this area fill out parameters that are needed like central meridian, parallels ... Always skip "SHIFT" for planets

END

Now look at the file mars_merc.tic and it will have the lon, lat in meters in projection.

If you only have the top left of the top left pixel then subtract 1/2 of the x cell size to the coordinate and add 1/2 of the y cell size. Here is an illustration:

Top left pixel:
*-------------
|             |
|             | 
|      @      | 
|             | 
|             | 
 -------------
The world file needs the @ location but usually only the * location is known, this is when you need to shift the coordinates by 1/2 of the x and y cell size to get to the @ location.

-------------------------------------------------------------------

You can also have the georeferencing info in this header file.
This is accomplished by adding the following keywords:
(I usually use a world file instead - explained below section 2.).

xulcorner 345.535 /* for georeferencing middle of upper left pixel
yulcorner 7456.565 /* for georeferencing middle of upper left pixel
OR
xllcorner 345.535 /* for georeferencing middle of lower left pixel
yllcorner -6456.565 /* for georeferencing middle of lower left pixel
cellsize 100 /* for georeferencing (size of pixel on ground)

Note: you only need one pair of xulcorner,yulcorner or
xllcorner,yllcorner for georeferencing.

other keywords that might also work in replace of the above
ulxmap 345.535 /* for georeferencing middle of upper left pixel
ulymap 7456.565 /* for georeferencing middle of upper left pixel
xdim 100 /* for georeferencing x (size of pixel on ground)
ydim 100 /* for georeferencing y (size of pixel on ground)

Back to Top
U.S. Department of the Interior | U.S. Geological Survey | Astrogeology Research Program
HOME | Search | Disclaimers & Privacy
Send Comments to: thare@usgs.gov
URL:
Last modified: