[GRASS-user] External Database and projections

Markus Neteler neteler at osgeo.org
Wed Oct 7 12:09:11 PDT 2015


On Wed, Oct 7, 2015 at 12:55 PM, Blumentrath, Stefan
<Stefan.Blumentrath at nina.no> wrote:
...
> My suggestion is to not use PostGIS for big rasters, unless you have to,
> because you want to use the data in a specific application for example.

Note r.external and r.external.out of GRASS GIS 7 for avoiding data duplication:

https://grass.osgeo.org/grass70/manuals/r.external.html
https://grass.osgeo.org/grass70/manuals/r.external.out.html

Here an example:

# register (rather than import) a GeoTIFF file in GRASS GIS:
r.external input=terra_lst1km20030314.LST_Day.tif output=modis_celsius

# define output directory for files resulting from subsequent calculations:
r.external.out directory=$HOME/gisoutput/ format="GTiff"

# perform calculations (here: extract pixels > 20 deg C)
# store output directly as GeoTIFF file, hence add the .tif extension:
r.mapcalc "warm.tif = if(modis_celsius > 20.0, modis_celsius, null() )"

# cease GDAL output connection and turn back to write standard GRASS
raster files:
r.external.out -r

# use the result elsewhere
qgis $HOME/gisoutput/warm.tif

Best
Markus


More information about the grass-user mailing list