[GRASSLIST:8910] Automatic GpsDrive background maps from GRASS GIS

Hamish hamish_nospam at yahoo.com
Mon Nov 7 02:02:47 EST 2005


Hi GpsDrivers and GRASSers,

I have written an export script that takes a GRASS GIS 6.1 (CVS version)
display window and saves it to a gpsdrive background image. The file is
placed in ~/.gpsdrive and the map_koord.txt index file is updated with
the georeferencing information.

This is nice as GRASS supports plotting almost every spatial data format
out there (thanks in large part to GDAL), and (at least for me) the
Expedia maps suck quite badly. www.multimap.com is nice but no support
from gpsfetchmap.pl currently. GRASS does all sorts of nice things like
overlaying of geographic grids and placement of rotated street names
(via v.label + d.paint.labels).

As GpsDrive uses a simple projection scaling method* things get wrong in
a hurry if you try and make images covering regional scales. Things are
not too bad if you are zoomed in, and I have it issue a warning if you
are beyond 125,000 (totally arbitrary choice).

Export from a Lat/Lon location gives really bad scaling in the x for
images bigger than ~50km wide. Suggestions on fixing this welcome,

[*] Georeferencing in gpsdrive is accomplished by coordinate of center
of image (LatLon) + a scaling factor proportional to meters/pixel [image
is always 1280x1024]. GRASS displays all projections (incl Lat/Lon) with
x and y the same, ie 1deg Lat x 1deg Lon is a perfect square.
I imagine someone smart could tell me custom Proj4 settings for
gdal_translate,gdalwarp to make things perfect &/or what params to use 
to set the GRASS projection settings correctly in the first instance.


If the script proves useful and correct (ie we fix the scaling problems)
I can add it into GRASS CVS, but for now it can be found on the GRASS-
Wiki Add-ons page as d.out.gpsdrive:

http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassAddOns


Also note it would be really easy to write a GRASS script to pan over 
a large area spitting out many fine scale gpsdrive image tiles--

Get region extents with `g.region -e` then do:
    g.region w="w+$ew_width"` e="e+$ew_width"
    `g.region -l` # or -c to get new center lat/lon
    d.redraw
    d.out.gpsdrive city_${cent_lat}_${cent_lon}__${i}_${j}
in a big loop.

feedback encouraged.


http://grass.ibiblio.org/index.php
http://gpsdrive.kraftvoll.at


enjoy,
Hamish




More information about the grass-user mailing list