Re: [GRASS-user] new GRASS virtual raster in trunk

Nikos Alexandris <[email protected]> Mon, 4 Jun 2018 16:19:39 +0200
Newsgroups gmane.comp.gis.grass.devel,gmane.comp.gis.grass.user
Message-ID <[email protected]>
* Markus Metz <[email protected]> [2018-06-04 14:37:41 +0200]:

>A new GRASS virtual raster format has been added to trunk in r72761-4,
>together with a new module to build a GRASS VRT: r.buildvrt.
>
>*r.buildvrt* builds a virtual raster (VRT) that is a mosaic of the list of
>input raster maps. The purpose of such a VRT is to provide fast access to
>small subsets of the VRT, also with multiple simultaneous read requests.
>
>*r.buildvrt* creates a list of raster maps that can be located in different
>mapsets. The ouput is a read-only link to the original raster maps which is
>only valid if the original raster maps remain in the originally indicated
>mapset. A VRT can also be built from raster maps registered with
>*r.external*.
>
>Reading the whole VRT is slower than reading the equivalent single raster
>map. Only reading small parts of the VRT provides a performance benefit.
>Please test!
>
>Markus M

Speechless! Respect Mr. Metz.


A working test:

# get extents
g.region -ec raster=L5192028_02820090723_Rad_ref_TRC_BYTE_FROMGLCaggV1@PERMANENT res=1000

north-south extent: 214230.000000
east-west extent:   246330.000000
center easting:     741150.000000
center northing:    5100000.000000

# set east to center easting of landcover map
g.region -a e=738150.000000 res=1000

# build a "half" map
r.mapcalc "WestHalf = 1" --o

# set west to center easting of land cover map, reset east
g.region w=738150.000000 e=$(echo "246330/2 + 741150" |bc) res=1000 -a

# build other half
r.mapcalc "EastHalf = 2" --o

# combine
r.buildvrt input=WestHalf,EastHalf out=fIRSTgRASSYvRT --o title="First GRASS GIS Virtual Raster Map"

# ?
r.info -ge fIRSTgRASSYvRT

north=5208000
south=4992000
east=865000
west=617000
nsres=1000
ewres=1000
rows=216
cols=248
cells=53568
datatype=CELL
ncats=0
map=fIRSTgRASSYvRT
mapset=lst
location=lst_time_series
database=/geo37/grassdb
date="Mon Jun  4 16:02:58 2018"
creator="nik"
title="First GRASS GIS Virtual Raster Map"
timestamp="none"
units="none"
vdatum="none"
source1=""
source2=""
description="generated by r.buildvrt"
comments="r.buildvrt --overwrite input="WestHalf,EastHalf" output="fIRSTgRASSY\vRT" title="First GRASS GIS Virtual Raster Map""

# see in-terminal
g.region -a raster=L5192028_02820090723_Rad_ref_TRC_BYTE_FROMGLCaggV1@PERMANENT res=1000
ty.d.rast fIRSTgRASSYvRT  # terminology's `tycat`

Thank you so very much Markus, Nikos

_______________________________________________
grass-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-dev
grass_render_file.png (image/png, 5.2 KB) - not displayed
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEAREKAB0WIQRvnUUG88ooOAl00xqQU1NLaTxPswUCWxVKegAKCRCQU1NLaTxP
s74HAQCnMxSjZom2UZBuNq97qRxIWzyXfB9pvEU2gXdFedF5CQD8D1BG3DKhO+qj
eOKY/oU6Tm0xDO6HmB8OydEivTDTDaw=
=VLPl
-----END PGP SIGNATURE-----