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"
.
SCHEMA=<name>
- name of schema where to create
feature tables. If schema doesn't exists, it's automatically created
when writing PostGIS data.FID=<column>
- name of column which will be used as
primary key (feature id), default: fid
GEOMETRY_NAME=<column>
name of column which will
be used for storing geometry data in feature table, default: geom
SPATIAL_INDEX=YES|NO
- enable/disable spatial index on geometry column, default: YESPRIMARY_KEY=YES|NO
- enable/disable primary key on FID column, default: YESSRID=<value>
- spatial reference identifier,
default: not definedTOPOLOGY=YES|NO
- enable/disable
native PostGIS
topology, default: NOTOPOLOGY=YES
):
TOPOSCHEMA_NAME=<schema name>
- name of PostGIS
Topology schema (relevant only for TOPOLOGY=YES
),
default: topo_<input>
TOPOGEOM_NAME=<column>
- name of column which
will be used for storing topogeometry data in feature table,
default: topo
TOPO_TOLERANCE=<value>
- tolerance for PostGIS
Topology schema,
see CreateTopology
function for defails, default: 0
TOPO_GEO_ONLY=YES|NO
- store in PostGIS Topology schema
only data relevant to Topo-Geo data model, default: NO
SIMPLE_FEATURE=YES|NO
- build simple features geometry
in GEOMETRY_NAME
column from topogeometry data, default:
NO# 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
v.external.out -p output: /path/to/home/gisoutput format: ESRI Shapefile
# 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...
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...
v.external.out -r
# 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
v.external.out -r # do some processing in native format
v.external.out loadsettings=gisdb_topo.txt # ... and do some processing in PostGIS Topology
See also GRASS user wiki page for more examples.
Available at: v.external.out source code (history)
Latest change: Tuesday Dec 17 20:17:20 2024 in commit: ab90c5e5a9b668894da360fa97ffd4a51a38931e
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
© 2003-2024 GRASS Development Team, GRASS GIS 8.5.0dev Reference Manual