Pima County Department of Transportation
Geographic Information Services Division
Developing GIS data for the Web
Making GIF (raster) files from ARC/INFO
GIF files (along with JPEG files) can be browsed natively by
all web browsers, Netscape, Mosaic, Internet Explorer, etc.
No plug-ins or other changes are required by the end user.
This and relatively small size is GIF's big advantage. The disadvantage
is that being a raster image, pan and zoom is not possible without
unacceptable loss of detail.
The current Version 7 ARC/INFO cannot generate GIF files directly.
ESRI
is planning this capability for a future release.
For now, the best way to get a GIF file from ARC/INFO is to use ArcPLOT to generate
a GRA plot file, DRAW that file on the screen, and then use a screen capture tool such as
xv
to grab the selected image and write the GIF file.
Optimizing maps for web viewing as GIF files
- Eliminate borders and white space.
- File size: Consider compression with acceptable loss.
- Image size: Should images be optimized for a certain screen resolution such as 800x600 or 1024x768?
- Moving titles.
- Possible legend changes.
Consider making the legend an html file rather than an image.
- Consider removing text from the graphic image and including it as true text on a web page.
Problems we've solved
- Snapshot and Imagetool produce corrupt GIF files at random. Solution:
xv works fine.
- Hardcopy plots use black lines on a white background. Screen plots are the reverse. Sometimes white lines don't
have enough contrast with surrounding colors. Solution: Use setenv CANVASCOLOR WHITE in .cshrc
- Some screen colors are different than those on the paper plots for some unknown reason. There were correct when re-done.
Maybe this is corruption similar to above and xv is the solution.
- Order of drawing in the plot AML is important.
Where layers can be drawn "on top" of other layers quite successfully on paper, on screen,
when there are features from more than one layer in the same place, only the last layer drawn is seen on the screen.
Solution: Adjust drawing order in Arcplot aml.
- Thumbnails are different sizes, sometimes due to source size and aspect ratio differences. Other times because of ???
Solution: Again, use xv. Display "Image Info" to see pixel size, and use keyboard to make fine adjustments.
- Avoid any re-sizing or scaling of GIF images. Generally, raster images can't be resized without introducing
significant distortion. Avoid using WIDTH and HEIGHT to do re-sizing when specifying the image in HTML.
Manual procedure for using xv to capture ARC/INFO images as GIF files
- Start xv.
- Run the plot aml or "draw filename.gra 9999 3" from the Arc prompt to display the image on the screen.
- Adjust the window to the desired size of the final image.
Since you want to avoid re-sizing or scaling, the size of what you see (in pixels) is what you will get in the GIF file.
Keep in mind that a workstation display may have more pixels per inch than the user's
web display, but it's usually pretty close.
- Press the right mouse button in the xv window to bring up the xv controls.
(Pressing the right mouse toggles the xv controls.)
Note that you can generally have any xv windows on top of what you want to grab and
xv will know not to grab its own windows.
- Press "Grab" to bring up the xv grab dialog.
- Press "Grab" on the grab dialog.
- Make a rough cut to pull the image into the xv window.
Drag with the middle mouse button to define the rectangular grab window.
When you release, the result appears in xv's opening window.
- Press the right mouse button to bring up xv's controls window.
- If your image has a clearly defined outline, you can use Autocrop to crop it down to size.
Otherwise, drag a box with the left mouse and press "Crop".
- To have more control over the cropped image size or location, press "Windows" and select "Image Info" before
doing the crop.
This window displays the image size in pixels.
Drag a box with the left mouse to the approximate size and location, but do not press "Crop".
- Arrow keys move the box one pixel at a time.
- Shift and the arrow keys move the lower right corner of the box to resize it one pixel at a time.
- You can also move the box by dragging its corners with the mouse.
- See page 4 of the xv manual for more details.
When you have the crop box just where you want it, press "Crop"
- Press "Save"
- Select Format: GIF
- Locate the desired save location, enter the "Save file:" name, and press "OK"
Automated command line capture of ARC/INFO images as GIF files
The xv process above is a manual process.
It works great and provides precise control.
It is nice to have an automated way to generate GIF files so they can
be generated automatically each time a coverage changes or for generating large
numbers of GIF files.
This requires a command line interface to the conversion process.
There are several options for doing this:
ImageMagick
An alternative suggested by Scott Kreiter is to use the free package
ImageMagick
as a file coverter.
ImageMagick has a number of command tools. See the
online command documentation
or the program's Unix man pages.
Frank Chang,
, explains how to use ImageMagick's
convert command
to make a GIF file:
Use "screensave" in arcplot to save the ArcPlot stuff
to Sun raster file format. Then you can use "convert" from
ImageMagick to port it to GIF format. This way you
can include all of these into your aml:
ap
display 9999
mape xxxx
shadeset xxxx
polygonsh xxxx
xxxx plot stuff
...
screensave filename.ras
quit
&sys convert filename.ras filename.gif
The desired output type is more explicit with gif: in front of the output file name like this:
convert filename.ras gif:filename.gif
"gif" tells the convert command to make a GIF 89a formatted file.
Some programs can't handle GIF 89a format and need GIF 87a instead.
If you need GIF 87a format, use "gif87" in the convert command:
convert filename.ras gif87:filename.gif
You can
have your image processed on the web with ImageMagick
provided you can specify a web location (URL) where it can be found.
NETPBM (formerly PBMPLUS)
A query by Bruce Hunt on the ESRI-L Listserver resulted in the following:
Most everyone who responded suggested using
NETPBM (formerly PBMPLUS),
to batch convert
numerous Sunraster files to GIF for internet use.
Here's a
list of sources for NETPBM.
NETPBM handles these
file formats.
See the
manual pages
for the NETPBM commands.
Other suggestions included UNIX power
tools, which also contains the "rasttopnm" and "ppmtogif" utilities.
ARC/INFO Plotter Driver
Another alternative was provided by Prashant Bhandary, who has written
a plotter driver to accomplish the file conversion in batch mode from
a GRA to GIF.
It can also make a GIF file directly in ArcPlot.
The plotter driver source used to be at
ftp://ftp.blm.gov/pub/gis/rtagif.tar.Z. This address is no longer valid
and we haven't been able to find a current address.
You need the rtagif.tar.Z file and:
- A C compiler (gcc is available freely on the web)
- A Fortran compiler (g77 is available freely on the web)
- The gd library (also on the web)