
366
|
Chapter 6, Mapping on Your Desktop
#75 Share Your GRASS Maps with the World
HACK
HACK
#75
Share Your GRASS Maps with the World Hack #75
Export your carefully crafted GIS layers into human-compatible formats.
If you’ve worked through the GRASS hacks in this book, you might have
noticed a standard finale: “Now see “Share Your GRASS Maps with the
World”
[Hack #75] to export your maps to an image file.” Having got this far,
congratulations! Now the world can know of your triumphant ascent of the
GRASS learning curve.
The r.out set of GRASS functions provides many ways to export your raster
layers into different GIS-compatible formats, such as ESRI’s ArcInfo, binary
vector format, etc. However, the most useful formats to share map data in—
PNG for viewing on the Web, or PostScript for print publication—both
involve some fiddling.
Publish Raster Maps as PNG Images
In the simplest case, you might just have a raster layer in GRASS that you
want to export as a PNG image. r.out.png is ideal for these purposes:
GRASS:~ > r.out.png in=nations out=nations.png
rows = 2250, cols = 4500
Converting nations... 96%
Done.
You should note that r.out.png, like most GRASS raster functions, only
operates on the current region. Be sure to run
g.region rast=... first if you
want to export the whole raster layer.
Publish PNG Images via the Display Monitor
If you have a whole set of different layers you want to export together,