Technical Notes on the Creation of Battlefield Maps

The following notes are intended to document the process with which these maps and images were created. The reader is assumed to have some knowledge or deeper interest in GRASS.

System Used

A powerful system is not needed to run GRASS. Here is the system I used:

Gateway P5-100
Pentium 100 microprocessor
16 M RAM
2.0 G SCSI hard drive
6 x CDROM
Epson Color II printer (for hardcopy output)
Linux OS version 1.3.95
XFree86 3.2 Xwindows
Andreas Holtz's "Grass 4.1.5 for Linux" CDROM

GRASS is designed to run under a UNIX host running Xwindows. I highly recommend the Linux GRASS CDROM (which can be found under the GRASS home page. The cost is minimal and it will save many hours of attempting to download, compile and install GRASS yourself.

There is a Windows-based version of GRASS (also available under the GRASS home page), and although it saves the trouble of installing Linux and Xwindows, the cost is rather steep (~$800). I'd like to hear from anybody who has tried it.

Creation of Base Maps

This section provides a very high level description of how the 1862.landuse and fences map layers were created.

As already described in the Preparation of Maps for this Document section, the coordinate pairs of about 1400 points were placed in a database, and a translation done to put the data into GRASS formate. The following GRASS operations where then performed:

When rendered for display, p.map.new was used to create colorful maps with different patterns for woods, orchards, corn, etc, labels and site markers for farmhouses and barns, and a legend.

Creation of Elevation Map

Although the Antietam National Park site contains a anti.elevation map, it was unsuitable for two reasons: the resolution is poor (10 meters), and the portion of the ground east of the creek has been clipped off (including the Pry House site). A new 2.elevation map was therefore created by first converting the Antietam National Park's anti.topo vector contour map into a raster map (v.to.rast) and then from that generating a true elevation map (r.surf.contour). This new elevation map covers the entire battlefield and is at a resolution of 2 meters; 1 meter was beyond the capability of my system's memory, and as it was, it took 3.5 days of runtime to create the 2 meter version.

A second, enhanced elevation map, n_elevation, was created to simulate the trees, orchards, and other upright features on the battlefield. r.mapcalc was used to add 50 meters to the elevation everywhere 1862.landuse contained woods, 15 meters to the elevation everywhere 1862.landuse contained orchards, 2 meter to the elevation everywhere 1862.landuse contained corn, and 5 meters to the elevation everywhere 1862.landuse contained buildings.

Creation of 3-D Perspective Views

The GRASS tool d.3d can be used to take a base raster map and a raster elevation map to create a full 3-D perspective view onto the active GRASS graphics monitor. In order to create a view that showed the ground with the familiar patterning scheme, a new raster base map 1862.CELL was creating via p.map.new with the painter set to preview and the CELL graphics monitor active. With 1862.CELL and n_elevation as inputs to d.3d, full 3-D views are possible where the ground cover is patterned and features with actual height (such as woods and corn) appear to 'rise up'.

Creation of Line of Site Views

A Line of Site View takes a map and a location from the map, and removes from the map all the ground that is not visible from the location. The result is a map that shows what you could see if you were on the battlefield standing at the given location.

The GRASS tool r.los takes an elevation map and a user specified location, and creates a new raster map, in which each cell which is visible from that location is marked with a value that represents the angle in degrees needed to see those cells. Once complete, the output is then turned into a binary raster map with r.mapcalc where all points visible are given a category of 1, and those not visible are given a category of zero. This map is then applied as the current mask (r.mask), and p.map.new is used to draw the base map; because of the mask, only those points visible are plotted. Then the mask is removed, and d.vect is used to draw the vector version of 1862.landuse to show the outlines of the terrain that are missing.

Creation of APB Maps

The maps shown in the Background and Source Notes on Battlefield Map section were created by overlaying wartime maps over the aerial map. The wartime map of the first image was created by scanning a small portion of the APB map, cleaning it up with the tools xv and xpaint, and saving it in ppm format. A raster version of this image was created by setting the painter to the preview device, activating the CELL graphics monitor, and using p.ppm to print the image to a raster file. r.support was used to redefine the coordinate boundaries of the raster file (chosen such that the wartime and modern locations of points 'A' and 'B' fall on top of each other). Lastly, r.grow was used to bolden the map. The final image was made by using d.rast to paint the aerial map onto the graphics monitor, and then d.rast was again invoked with the -o (overlay) option to paint the wartime version on top of it.

The second image was easy: d.rast was used to paint the aerial map, and d.vect was used to paint the vector versions of 1862.landuse and fences on top.

Creation of Virtual Reality Views

The so-called VR views presented in this document where created using a non-GRASS tool called POV-Ray (Persistence of Vision Ray-Tracer). Although POV-Ray does more or less what the GRASS tool d.3d does, POV-Ray is much better at rendering non-aerial views (ie, views from the ground). d.3d has severe limitations which lead to problems if any part of the scene is near the viewing location.

In order to import the GRASS data into a format suitable for POV-Ray, a translation tool called r.ppm was written to output the GRASS elevation and landuse maps into a special PPM format; due to GRASS's internal limitations on color mapping, it was not possible to simply 'print' these maps using the PPM painter.

In order to get the maximum resolution for the VR views, a special elevation map was prepared:

  1. The GRASS region was limited to the area to be depicted.
  2. r.describe was used to determine the highest and lowest points within this region.
  3. r.rescale was used to remap these lowest and highest elevations to a range of 1 to 65535 (16 bits).
  4. r.neighbors was then used with a method of 'average' to smooth out the terrain.
  5. r.ppm (written by the author) was used to generate a double precision (16 bit) ppm file for the elevation, and a single precision (8 bit) ppm file for the landuse.
  6. The elev.ppm file was then imported into POV-Ray as a Height Field, and the landuse.ppm file as imported as a Material Map. Beyond some very simple texturing for the different terrain types and a sky_sphere for the sky, virtually none of POV-Ray's advanced capabilities were needed to construct these views.


Return to the About The Maps Page

Back to Antietam - A Photographic Tour Home Page