[GRASSLIST:9074] Re: ArcView vs GRASS

Hamish hamish_nospam at yahoo.com
Tue Nov 15 03:59:38 EST 2005


> I should also add the importance of GRASS/QGIS interoperability and 
> interoperability with R, gstat, GMT, etc. Combined, these make an 
> incredibly powerful GIS environment that easily rivals the ESRI world.
> ESRI still holds the marketing edge with the perception of creating 
> stunning maps, which captures the attention of end-users. Probably a 
> stronger tie between GMT and GRASS would help.


Ok then,

I have written a r.out.gmt script which is for a large part based on the
GRASS -> GMT tutorial by Dylan Beaudette of UC Davis.
  http://169.237.35.250/~dylan/grass_user_group/map1.html

It is now on the GRASS Wiki add-ons page.
  http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassAddOns


It still needs a bit of refinement but the basics are done. (ie plea for
a real GMT user to take it from here) e.g. It could be updated to use
GMT's xyz2grd instead of writing the binary file directly (support for
export of DCELL maps)?


It outputs a GRASS map to a GMT binary grid; generates a GMT color table
from the GRASS color table; and prepares the GMT commands needed to make
PostScript output. You can (almost) do:
   GRASS> eval `r.out.gmt -p mapname`
and end up with a GMT PostScript file!

Probably better to do:
   GRASS> r.out.gmt -p mapname > map_gmt_script.sh
and flavour to suit for now.


It is much like the tutorial, with a few useful enhancements (and
probably several regressions as I know very little about GMT). The main
idea is to use the script as a pre-processor to get folks started, not
to do a full GMT session.

enhancements:
* auto DCELL -> FCELL  (sadly r.out.gdal netCDF support is read-only)
* auto GRASS -> GMT color table converter
* auto tick spacing
* uses awk not bc for FP math as bc isn't installed everywhere
* GRASSify region calculations a little
* with "r.out.gmt -p 2> /dev/null" you can generate a .ps script
(almost)

regressions:
* PostScript file is semi-broken: x,y offset & gv stalls
* more??

outstanding issues:
* still needs colr[colr2] file existence test. or make "r.colors -o"?
* default paper should be taken from /etc/papersize or $GRASS_PAPERSIZE
?
   (same issue for ps.map I guess, but a4 is default there)

possibilities:
* add a vect=map1[,map2,...] option to allow overlay of vector files
* more??


best,
Hamish




More information about the grass-user mailing list