[Xastir] georeferencing maps on osx?

Tom Russo russo at bogodyn.org
Tue Dec 28 22:02:03 EST 2004


On Tue, Dec 28, 2004 at 09:38:41PM -0500, we recorded a bogon-computron collision of the <shadow at dementia.org> flavor, containing:
> On Tue, 28 Dec 2004, Tom Russo wrote:
> 
> >You need at least 5 points to do it right, more for better accuracy.
> 
> well, there are grid lines, so i guess i can get em.
> 
> >I recommend GRASS, a free GIS package that you can even download in binary
> >form for your OS X machine.  http://grass.itc.it/
> 
> last time i touched grass it ended in sadness. i suppose i can try again.

It is a scary package.  But very powerful and worth the trouble.  Don't 
bother with 5.3x or 5.4x, go right to the supposedly experimental 5.7
version.  It has much better vector support than any previous version ever
did.  For what you're doing right now that doesn't matter, but if you ever
decide to use your georeferenced rasters with shapefiles and complex vector
attributes or to digitize your own vector layers you'll really appreciate not 
having to deal with the older versions.

> >If you choose to go this route I can send you some pointers for what 
> >modules
> >in grass you need to run to get the job done.  It's kinda labor intensive, 
> >but
> >it gives you properly georeferenced rasters.
> 
> hm. that's unfortunate, since i want to do it for like 900 maps. but if 
> you have something, sure, please.

Ouch.  Well after the 100th or so you'll be so familiar with the procedure
it'll be a piece of cake to do the remaining 800.  I can't think of any simple 
way to automate it with rasters that don't start out georeferenced and that
you scanned yourself.  If you find one, I'd be delighted to hear of it.

I've only done it four times, and have had to go back and consult the text book
each time.  Chapter 5, section 5.2.2 of "Open Source GIS: A GRASS GIS Approach,"
first edition, Markus Neteler and Helena Mitasova if you can get your hands
on a copy in the library.  The book itself is very pricey (>$100), but has 
a lot of good info in it.  The second edition just came out a month or two
ago, but the steps for this type of application remain the same.

The process goes like this:

0) Create a GRASS location in the right coordinate system/datum and with the 
   correct extent to contain your finished map.  If these are USGS maps,
   using UTM coordinates is best because of the UTM grid you can digitize off
   of. 
1)  Scan map with appropriate resolution to give the meters-per-pixel you want.
   (for a 1:24K map 300dpi leads to about 2m/pixel)
2) Create a new GRASS location with no projected coordinate system (they call it
   an "XY" location) that's just the size of your image in pixels.
3) Use r.in.gdal in the XY location to import your raster.
4) Create an imagery group with i.group, designate your new raster as a member
5) use i.target to designate the location you created in step 0 as the place 
   the georeferenced raster will go
6) Use the i.points module to pick points around your unreferenced map and
   assign them coordinates (grid intersections work pretty well, you want them
   scattered around the edge and near the center).  Use the "analyze" function
   of that module to check how well your RMS error is doing.  When it is below
   half of your map resolution (i.e. 1m in the case of a 300dpi 1:24k map),
   you can declare victory.  When I did this on an unreferenced map of 
   the southeastern coast of Ireland that had nice grid lines in a recognizable
   coordinate system, it only took 5 points for me to get down to that 
   RMS error in one try.  When I tried to do this on a map of Los Alamos
   County I had with really bad color and no grid lines, it took for bloody
   ever, because I had to match up features by hand with a different map that
   *did* have grid lines, and could only read off coordinates to the nearest 
   10 meters with a UTM interpolator.   How long this step takes you will
   depend a lot on the quality of your source image and the number of control
   points you can identify accurately.  
7) Rectify the image with i.rectify.  When it finishes a georeferenced raster
   will be in the location you chose in step 5 (and created in step 0).
8) Restart grass in the step 0 location, export the raster to whatever format
   you like (e.g. with r.out.gdal).  If you export to geotiff the file will
   contain correct datum and projection information so that you can do all 
   manner of tweakage with it (e.g. reprojecting to other projections than
   UTM, datum conversion, reading into Xastir...)

It is not actually all that difficult, but with 900 rasters to do I'd probably
try to end-run the process and look for some source of previously digitized
and georeferenced files instead.

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "When life gives you lemons, find someone with a paper cut."




More information about the Xastir mailing list