[Xastir] Re: Starting with a scanned USGS 7.5" paper map....

Tom Russo russo at bogodyn.org
Sat Jan 19 13:27:54 EST 2008


On Sat, Jan 19, 2008 at 12:12:22PM -0600, we recorded a bogon-computron collision of the <RiverRidge at CenturyTel.net> flavor, containing:
> I am collecting the USGS topographic maps for  my area and I am fortunate 
> in that all except one were on Libre Map.  The one that was missing, The 
> good folks at UW Madison Geography Library had the paper map and scanned it 
> for me.  So now I have a 454MB scanned image in tif format.

Nice.

> Setting aside the fact that for one map, I would probably be better off 
> just buying the proper Geotiff map files............  How do I go from this 
> scanned image to a georeferenced digital file?  Can I get there from here?

Yes, but you need a tool that you probably don't have yet.  There are two
tools of choice, GRASS (http://grass.itc.it/) and QGIS (http://www.qgis.org/).  
GRASS can do more with your data, but QGIS has a simpler georeferencing tool.  
GRASS has a learning curve as steep that looks a lot like Everest, QGIS is
a bit of a PITA to install but is comparatively easy to use.

The trick is to carefully select points of known coordinates (in the 
coordinate system of the map, which in this case are probably UTM) and give 
the georeferencer the locations of those points in the image (the USGS uses 
the 16 lat/lon graticule points).  It then computes the affine transformation 
from image coordinates to geographic coordinates and puts in the 
necessary TIFF tags.

It is a fairly involved process.  I might be willing to do it for you --- I've
done it for a few other people on the list.  It just so happens that this
weekend I've chosen to set aside a lot of time to do GIS work, so if you 
put your data somewhere where I could grab it today, I'd take a look.  

> Looking at the other fdg files in the set, it seems that they indicate that 
> the USGS 7.5" maps are reduced to 250dpi.  When I do that, my files are ~3X 
> the other geotif files in the set (10MB vs 3.7 MB). 

In addition, you might not be using "PACKBITS" compression, *AND* the USGS
does a lot of work to standardize their color scheme.  USGS maps have only 
twelve colors, and because of that they can be stored in a single 8-bit
band.  Your maps are, dollars to donuts, 3-band 24 bit color.  Between the 
two I could easily imagine a 3X size difference.

To figure that out, take a look at the output of "gdalinfo" on your tiff file.
If it lists a color map at the end, you've got an 8 bit image, if it just 
gives you three lines listing what each band represents, you have a 24 bit
color image.

To duplicate a USGS DRG, you'd have to map all the complex colors in the file
to the 12 standard colors USGS uses.  Doing *THAT* is serious work, and might 
not be worth your trouble.  If your goal is just to get a map that looks nice
in xastir, you could just use the GDAL tool "rgb2pct.py" which takes a 24
bit image and constructs an 8-bit pseudocolor image by dithering down to a 
smaller range of colors.  It can be good enough as long as you don't try to
use the feature of xastir that lets you pick and choose which colors of a 
USGS map to display (i.e. with that feature you could display only the contour
lines and let everything else be transparent, but it requires that the image
have the 12 standard colors).

> Using GeoTiffExaminer  
> (http://www.mentorsoftwareinc.com/FREEBIE/FREE0699.HTM ), it would seem 
> that I could convert a scanned tif image into a Geotiff file if I knew what 
> georeferencing info to give it.

Yes, you definitely could, but as I said, it requires some tools you'd have to
install and get familiar with.

> In trying to understand README.MAPS, it seems that those instructions 
> assume that you are starting with a GeoTiff map of some extraction.

Yes, it does.  Georeferencing scanned images is tricky and time consuming, so
it is expected that few will want to do it.  I've done it many times, and I
try to avoid doing it if possible.  But with the right tools and a little
care it can be done.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick



More information about the Xastir mailing list