v.external.out(1grass) | Grass User's Manual | v.external.out(1grass) |
v.external.out - Defines vector output format.
vector, export, output, external, OGR, PostGIS
v.external.out
v.external.out --help
v.external.out [-frpg] [output=string]
[format=string]
[options=string[,string,...]]
[loadsettings=name] [savesettings=name]
[--overwrite] [--help] [--verbose] [--quiet]
[--ui]
v.external.out instructs GRASS to write vector maps in external data format (e.g. ESRI Shapefile, Mapinfo, and others) using OGR library. PostGIS data can be also written by built-in GRASS-PostGIS data provider.
Number of available output formats (v.external.out -f) depends on OGR installation. ’PostgreSQL’ format is presented also when GRASS comes with PostgreSQL support (check for ’--with-postgres’ in g.version -b output).
To store geometry and attribute data in PostGIS database (’PostgreSQL’ format) GRASS uses built-in GRASS-PostGIS data provider. PostGIS data can be written also by OGR library when GRASS_VECTOR_OGR environmental variable is defined or GRASS is not compiled with PostgreSQL support.
Creation options refer to the output format specified by format option. See the list of valid creation options at OGR formats specification page, example for ESRI Shapefile or PostgreSQL/PostGIS format (section "Layer Creation Options"). Options are comma-separated pairs (key=value), the options are case-insensitive, eg. options="SCHEMA=myschema,FID=cat".
Note that built-in GRASS-PostGIS data provider (format=PostgreSQL) supports different creation options compared to PostgreSQL/PostGIS driver from OGR library:
v.external.out can be used along with v.external to
process external geodata in GRASS while writing out the results directly eg.
in ESRI Shapefile format:
# register Shapefile in GRASS mapset: v.external input=/path/to/shapefiles layer=cities # define output directory for GRASS calculation results: v.external.out output=$HOME/gisoutput # do something (here: spatial query), write output directly as Shapefile v.select ainput=cities atype=point binput=forests btype=area operator=within output=fcities
Current settings can be printed using -p or -g flag.
v.external.out -p output: /path/to/home/gisoutput format: ESRI Shapefile
PostGIS data can be accessed directly using GRASS-PostGIS
data provider (GRASS must be compiled with PostgreSQL support).
# register PostGIS table in GRASS mapset: v.external output=PG:dbname=gisdb layer=cities # define output PostGIS database for GRASS calculation results stored as simple features: v.external.out output=PG:dbname=gisdb format=PostgreSQL # do some processing...
Note: If the environment variable GRASS_VECTOR_OGR is defined, or GRASS is compiled without PostgreSQL support then GRASS will use PostgreSQL driver from OGR library for reading and writing PostGIS data.
# define output PostGIS database for GRASS calculation results stored as topological elements: v.external.out output=PG:dbname=gisdb format=PostgreSQL options=topology=YES # do some processing...
Note: PostGIS topological access is supported only in built-in GRASS-PostGIS data provider.
To restore original settings, ie. use the GRASS native format,
type:
v.external.out -r
Current settings can be stored to file by specifying output
option.
# define output PostGIS database for GRASS calculation with # results stored as topological elements: v.external.out output=PG:dbname=gisdb format=PostgreSQL \
options=topology=YES savesettings=gisdb_topo.txt # ... and do some processing in PostGIS Topology
Back to native format:
v.external.out -r # do some processing in native format
Restore previous settings from "gisdb_topo.txt" file by
specifying loadsettings option.
v.external.out loadsettings=gisdb_topo.txt # ... and do some processing in PostGIS Topology
v.external, v.in.ogr, v.out.ogr, v.out.postgis
See also GRASS user wiki page for more examples.
Martin Landa, Czech Technical University in Prague, Czech Republic (development supported by Fondazione Edmund Mach and Comune di Trento, Italy)
Last changed: $Date: 2015-11-24 09:07:58 +0100 (Tue, 24 Nov 2015) $
Available at: v.external.out source code (history)
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
© 2003-2019 GRASS Development Team, GRASS GIS 7.6.0 Reference Manual
GRASS 7.6.0 |