Working with external data in GRASS 7: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
Line 48: Line 48:


  {{cmd|v.transform}} -w input=obce_b output=obce_b_jtsk xscale=-1 yscale=-1
  {{cmd|v.transform}} -w input=obce_b output=obce_b_jtsk xscale=-1 yscale=-1
{{cmd|v.external}} dsn="PG:dbname=grass" -l
<pre>
...
obce_b
obce_b_jtsk
...
</pre>


  {{cmd|v.out.ascii}} input=obce_b_jtsk where="cat < 10" --q
  {{cmd|v.out.ascii}} input=obce_b_jtsk where="cat < 10" --q

Revision as of 16:01, 20 January 2011

This page explains how to work with external data in GRASS 7.

(to be expanded)

Raster data

External raster data can be linked via r.external. List of supported formats can be determined by

r.external -f

To link file-based data formats, eg. GeoTiff

r.external input=ncrast/urban.tif output=urban

Vector data

External vector data can be linked via v.external. List of supported formats can be determined by

v.external -f

To link file-based data formats, eg. ESRI Shapefile

 v.external dsn=ncshape/ layer=railroads output=railroads

Assuming that 'railroads.shp' is located in directory 'ncshape'.

Write access

The module also supports write access to the external data (currently only geometry can be edited). Showcase bellow:

v.external dsn="PG:dbname=grass" layer=obce_b output=obce_b
v.out.ascii input=obce_b where="cat < 10" --q
-742600|-1043000|1
-728486|-1079285|2
-698411|-1095121|3
-716384|-1083350|4
-694125|-1101920|5
-706726|-1097059|6
-732348|-1074146|7
-730615|-1084553|8
-713628|-1086298|9
v.external.out dsn="PG:dbname=grass" format=PostgreSQL
v.transform -w input=obce_b output=obce_b_jtsk xscale=-1 yscale=-1
v.external dsn="PG:dbname=grass" -l
...
obce_b
obce_b_jtsk
...
v.out.ascii input=obce_b_jtsk where="cat < 10" --q
1043000|742600|1
1079285|728486|2
1095121|698411|3
1083350|716384|4
1101920|694125|5
1097059|706726|6
1074146|732348|7
1084553|730615|8
1086298|713628|9

Using wxGUI

From menu

File -> Link external formats
Link external data - Layer Manager menu

or from toolbar in Layer Manager.

Link external data - Layer Manager toolbar (1)
Link external data - Layer Manager toolbar (2)