Technical Tips

Displaying and re-projecting images in ArcIMS

by Ian Miller, Information Technology Strategist

Defining image layers in the mapservice file

Re-projecting images

Summary

ESRI’s Internet Map Server (ArcIMS) is widely used for publishing GIS information via the web and whilst it is well supported by documentation, it can be a bit tricky getting images displaying correctly alongside your vector information. This technical tip will describe the image formats supported by ArcIMS, how to add them to your mapservices and how to deal with projection and datum issues.

ArcIMS supports the display of a range of image types and formats and also enables images to be re-projected on the fly. You can also have ArcIMS apply a datum transformation to your image if required, however only transformations to and from WGS84 are supported. Whilst this might seem to be a significant limitation, the current Australian datum, GDA94, is very close to WGS84, with about a metre difference between the two on the ground. In most cases therefore, WGS84 can be used as a very good approximation of GDA94.

ArcIMS supports most of the commonly used geo-referenced image formats including BIL, TIFF and GeoTiff, JFIF and JPG, PNG, MrSID (on most platforms) and ECW (via a connector available from Earth Resource Mapping). ArcIMS can also display image catalogues and raster data stored in ArcSDE.

ArcIMS Author supports only a subset of these image types – it will allow you to add and view JPEG, TIF, GIF, BMP and PNG files and will save their definition into the mapservice AXL file. Author will also allow you to add but not view image formats with a standard file extension, such as BIL files. If you wish to add the other image types, you will need to directly edit the AXL file to add them and beware – once you have added such an image definition you should not open the AXL file in Author again as it will strip that definition out when re-saving the file.

To be able to view images in ArcIMS, they must, of course, be geo-referenced so that ArcIMS knows where to display them in relationship to your vector layers. For most image types this means providing a “world” file which is a small text file which defines the transformation of the image pixels into real world coordinates. If your images are not already geo-referenced, you can do this via ArcMap – search for “georeferencing” in ArcMap help.

ArcIMS expects the world file for an image to be located in the same directory as the image and to have the same base filename and a standard extension for a world file for that image type. For example, the image “myphoto.tif” must have a world file called “myphoto.tfw”. A full list of the image file and related world file extensions is in the “Using ArcIMS” reference book or at:
http://support.esri.com/

back to top

Defining image layers in the mapservice file

A standard image file requires two tags when added to a mapservice, firstly the IMAGEWORKSPACE tag which defines where the image(s) reside eg:

<IMAGEWORKSPACE directory="C:\ArcIMS\images" name="jai_ws-0"/>

and secondly the image layer definition itself eg:

<LAYER type="image" name="Airphoto" visible="true" id="ap1" maxscale="1:500000">
<DATASET name="R136.tif" type="image" workspace="jai_ws-0"/><
</LAYER>

To add an image catalogue, you reference the related DBF file in the <dataset> tag for the image layer. An example of doing this, including a sample image catalogue to download, is available on the ESRI support site at:
http://support.esri.com/
As shown in this article, the image catalogue is referenced as:

<LAYER type="image" name="Example Image Catalog" visible="true" id="image">
<DATASET name="img_cat.dbf" type="image" workspace="img_ws-0"/>
</LAYER>

where the image workspace “img_ws-0” is the directory in which the img_cat.dbf file resides.

The following technical article on the ESRI support site gives details of how to reference an ArcSDE raster dataset:
http://support.esri.com/
The LAYER tag for an ArcSDE raster dataset is defined as:

<LAYER type="image" name="2004 Orthophoto" visible="true" id="2004_orthophoto">
<DATASET name="ARCIMS.ARCIMS.ORTHOPHOTO.IMAGE" type="image" workspace="sde_ws-0" />
</LAYER>

Note that the article referenced is for ArcIMS 3.x and 4.x, in ArcIMS 9.x the extension for denoting raster layers has changed from “.IMAGE” to “.RASTER”, as shown in the ArcIMS 9.x version of this technical article:
http://support.esri.com/

back to top

Re-projecting images

If your image dataset is georeferenced to a different projection and/or datum to your mapservice, you will need to add a <COORDSYS> tag to your image layer definition to cause ArcIMS to re-project it on the fly.

To define the projection and datum that you want your mapservice to display in, you will first need to add <FEATURECOORDSYS> and <FILTERCOORDSYS> tags to your mapservice definition e.g:

<PROPERTIES>
<ENVELOPE minx="2090939" miny="2248317" maxx="2975536" maxy="2843146" name="Initial_Extent"/>
<MAPUNITS units="meters"/>
<FEATURECOORDSYS id="102171"/>
<FILTERCOORDSYS id="102171"/>
</PROPERTIES>

This fragment of AXL shows the properties section of the mapservice AXL file ands defines the mapservice to display in VICGRID94, a standard projection in use in Victoria. All three coordinate system tags; COORDSYS, FEATURECOORDSYS and FILTERCOORDSYS allow the coordinate system to be defined either via an id or via a standard string. The set of standard projections that ArcIMS knows, and their ids can be found in the HTML version of the ArcXML reference installed with ArcIMS, typically at:

C:\Program Files\ArcGIS\ArcIMS\Documentation\ArcXML_Guide\ArcXML_reference.htm
in a Windows installation. You can also find this information on the ESRI support site at
http://downloads.esri.com/ for the ArcIMS 4.x version.

The standard strings are like:

PROJCS["AGD_1966_AMG_Zone_55",
GEOGCS["GCS_Australian_1966",DATUM ["D_Australian_1966",SPHEROID ["Australian",6378160.0,298.25]],
PRIMEM["Greenwich",0.0],UNIT ["Degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"], PARAMETER["False_Easting",500000.0],
PARAMETER["False_Northing",10000000.0], PARAMETER["Central_Meridian",147.0],
PARAMETER["Scale_Factor",0.9996],PARAMETER ["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

and it is generally easier to use the ids if defined.

Some common projections and their ids for Australia are:

ID
Coordinate System
20254
AGD_1966_AMG_Zone_54
20255
AGD_1966_AMG_Zone_55
20256
AGD_1966_AMG_Zone_56
28354
GDA_1994_MGA_Zone_54
28355
GDA_1994_MGA_Zone_55
28356
GDA_1994_MGA_Zone_56
102170
AGD_1966_VICGRID
102171
GDA_1994_VICGRID94
102172
GDA_1994_South_Australia_Lambert
4202
GCS_Australian_1966
4203
GCS_Australian_1984
4283
GCS_GDA_1994

Once you have defined the coordinate system in which your mapservice will be displayed, you need to add a COORDSYS tag to your image layer to let ArcIMS know what its source coordinate system is, so that it can be transformed. An example of this is:

<LAYER type="image" name="Airphoto" visible="true" id="ap1" maxscale="1:500000">
<COORDSYS id="20255" />
<DATASET name="R136.tif" type="image" workspace="jai_ws-0"/>
</LAYER

which defines the image to have been geo-referenced in AGD66 AMG Zone 55. With the mapservice properties shown above, this results in the following view: Figure 1

It can be seen that the image is out of sync with the vector layers, since it was georeferenced to the AGD66 datum whilst the mapservice is being displayed in the GDA94 datum. Although ArcIMS does not support transformations to the GDA94 datum, it does support the WGS84 datum, which is very close. To cause this datum transformation, an additional parameter, datumtransformid is added to the COORDSYS tag for the image layer, resulting in the following tag:

<COORDSYS id="20255" datumtransformid="8008"/>

where 8008 is the id for the datum transformation from AGD66 to WGS84 as defined in the ArcXML reference guide. Once we apply this new tag, the ArcIMS map looks like: Figure 2

with the image now closely aligned to the vector layers.

back to top

Summary

ArcIMS supports a comprehensive range of image types, although some will require direct editing of the mapservice AXL file. ArcIMS is also able to transform the image coordinate system on the fly by the addition of COORDSYS tags and the relevant coordinate system ids. Further details can be found in the ArcIMS documentation, especially “Using ArcIMS” and the “ArcXML Programmers Reference Guide”, both installed with ArcIMS or available on the ESRI support site.

For further information about how Spatial Vision may assist you, please contact:

Ian Miller on (03) 9691 3000
email: ian.miller@spatialvision.com.au

back to top

Copyright © Spatial Vision, Wednesday, 27-October-2004

Go
Back
Print
Page

Latest News

 ■ eNewsletter

 ■ Press Releases

 ■ Client Success Stories

 ■ Technical Tips & Papers

-- --

Spatial Vision Level 2 170 Queen Street Melbourne 3000 Phone: 03 9691 3000 Fax: 03 9691 3001 email:info@spatialvision.com.au

Site designed & produced by Spatial Vision - Copyright © 2005