
NAME
v.external.out - Defines vector output format.
KEYWORDS
vector, export, output, external, OGR, PostGIS
SYNOPSIS
v.external.out
v.external.out help
v.external.out [-frpg] dsn=string format=string [options=string[,string,...]] [--verbose] [--quiet]
Flags:
- -f
- List supported formats and exit
- -r
- Cease using OGR/PostGIS, revert to native output and exit
- -p
- Print current status
- -g
- Print current status in shell script style
- --verbose
- Verbose module output
- --quiet
- Quiet module output
Parameters:
- dsn=string [required]
- Name of input OGR or PostGIS data source
- Examples:
ESRI Shapefile: directory containing a shapefile
MapInfo File: directory containing a mapinfo file
PostGIS database: connection string, eg. 'PG:dbname=db user=grass'
- format=string [required]
- Format for output vector data
- Options: BNA, CSV, DGN, ESRI_Shapefile, GML, GMT, GPX, GeoJSON, Geoconcept, Interlis_1, Interlis_2, KML, MapInfo_File, Memory, MySQL, ODBC, PostgreSQL, S57, SQLite, TIGER
- Default: ESRI_Shapefile
- options=string[,string,...]
- Creation options
- Examples:
'SHPT=POINTZ': create 3D point Shapefile data
'GEOM_TYPE=geography': use geography PostGIS data
'SCHEMA=grass': create new PostGIS tables in 'grass' schema
DESCRIPTION
v.external.out instructs GRASS to write vector maps in
external data format (e.g. ESRI Shapefile) using OGR
library. PostGIS data can be also written by
built-in GRASS-PostGIS data driver.
EXAMPLES
ESRI Shapefile
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 dsn=/path/to/shapefiles layer=cities
# define output directory for GRASS calculation results:
v.external.out dsn=$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
dsn: /path/to/home/gisoutput
format: ESRI Shapefile
PostGIS
PostGIS data can be accessed directly using GRASS-PostGIS data
driver (it requires that GRASS is compiled with PostgreSQL
support).
# register PostGIS table in GRASS mapset:
v.external dsn=PG:dbname=gisdb layer=cities
# define output directory for GRASS calculation results:
v.external.out dsn=PG:dbname=gisdb format=PostgreSQL
# do some processing...
Note: If the environment variable GRASS_VECTOR_OGR exists, or
GRASS is compiled without PostgreSQL support then GRASS will use
OGR-PostgreSQL driver for reading and writing PostGIS data.
GRASS native format
To restore original settings, ie. use GRASS native format, type:
REFERENCES
OGR vector library C API documentation
SEE ALSO
v.external,
v.in.ogr,
v.out.ogr
OGR Library
PostGIS
See
also GRASS user wiki page for more examples.
AUTHOR
Martin Landa, Czech Technical University in Prague, Czech Republic
Last changed: $Date: 2012-03-28 06:51:46 -0700 (Wed, 28 Mar 2012) $
Main index - Vector index - Full index
© 2003-2012 GRASS Development Team