1v.external.out(1) Grass User's Manual v.external.out(1)
2
3
4
6 v.external.out - Defines vector output format.
7
9 vector, export, output, external, OGR, PostGIS
10
12 v.external.out
13 v.external.out --help
14 v.external.out [-frpg] [output=string] [format=string]
15 [options=string[,string,...]] [loadsettings=name] [saveset‐
16 tings=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui]
17
18 Flags:
19 -f
20 List supported formats and exit
21
22 -r
23 Cease using OGR/PostGIS, revert to native output and exit
24
25 -p
26 Print current status
27
28 -g
29 Print current status in shell script style
30
31 --overwrite
32 Allow output files to overwrite existing files
33
34 --help
35 Print usage summary
36
37 --verbose
38 Verbose module output
39
40 --quiet
41 Quiet module output
42
43 --ui
44 Force launching GUI dialog
45
46 Parameters:
47 output=string
48 Name of output directory or OGR or PostGIS data source
49 Examples:
50 Â Â Â Â Â Â Â Â ESRI Shapefile: directory containing a shapefile
51 Â Â Â Â Â Â Â Â MapInfo File: directory containing a mapinfo file
52 Â Â Â Â Â Â Â Â PostGIS database: connection string, eg.
53 ’PG:dbname=db user=grass’
54
55 format=string
56 Format for output vector data
57 Options: AmigoCloud, BNA, CSV, Carto, Cloudant, CouchDB, DGN, DXF,
58 ESRI_Shapefile, ElasticSearch, GFT, GML, GPKG, GPSBabel, GPSTrack‐
59 Maker, GPX, GeoJSON, GeoRSS, Geoconcept, Interlis_1, Interlis_2,
60 JML, KML, LIBKML, MBTiles, MSSQLSpatial, MVT, MapInfo_File, Memory,
61 MySQL, ODBC, ODS, OGR_GMT, PCIDSK, PDF, PGDUMP, PostgreSQL, S57,
62 SQLite, Selafin, TIGER, VDV, WAsP, XLSX, netCDF
63 Default: ESRI_Shapefile
64
65 options=string[,string,...]
66 Creation options
67 Examples:
68 Â Â Â Â Â Â Â Â ’SHPT=POINTZ’: create 3D point Shapefile data
69 Â Â Â Â Â Â Â Â ’GEOM_TYPE=geography’: use geography PostGIS data
70 Â Â Â Â Â Â Â Â ’SCHEMA=grass’: create new PostGIS tables in
71 ’grass’ schema
72
73 loadsettings=name
74 Name of input file to read settings from
75
76 savesettings=name
77 Name for output file where to save current settings
78
80 v.external.out instructs GRASS to write vector maps in external data
81 format (e.g. ESRI Shapefile, Mapinfo, and others) using OGR library.
82 PostGIS data can be also written by built-in GRASS-PostGIS data
83 provider.
84
86 Number of available output formats (v.external.out -f) depends on OGR
87 installation. ’PostgreSQL’ format is presented also when GRASS comes
88 with PostgreSQL support (check for ’--with-postgres’ in g.version -b
89 output).
90
91 To store geometry and attribute data in PostGIS database (’PostgreSQL’
92 format) GRASS uses built-in GRASS-PostGIS data provider. PostGIS data
93 can be written also by OGR library when GRASS_VECTOR_OGR environmental
94 variable is defined or GRASS is not compiled with PostgreSQL support.
95
96 Creation options refer to the output format specified by format option.
97 See the list of valid creation options at OGR formats specification
98 page, example for ESRI Shapefile or PostgreSQL/PostGIS format (section
99 "Layer Creation Options"). Options are comma-separated pairs
100 (key=value), the options are case-insensitive, eg.
101 options="SCHEMA=myschema,FID=cat".
102
103 PostgreSQL/PostGIS Creation Options
104 Note that built-in GRASS-PostGIS data provider (format=PostgreSQL) sup‐
105 ports different creation options compared to PostgreSQL/PostGIS driver
106 from OGR library:
107
108 · SCHEMA=<name> - name of schema where to create feature tables.
109 If schema doesn’t exists, it’s automatically created when writ‐
110 ing PostGIS data.
111
112 · FID=<column> - name of column which will be used as primary key
113 (feature id), default: fid
114
115 · GEOMETRY_NAME=<column> name of column which will be used for
116 storing geometry data in feature table, default: geom
117
118 · SPATIAL_INDEX=YES|NO - enable/disable spatial index on geometry
119 column, default: YES
120
121 · PRIMARY_KEY=YES|NO - enable/disable primary key on FID column,
122 default: YES
123
124 · SRID=<value> - spatial reference identifier, default: not
125 defined
126
127 · TOPOLOGY=YES|NO - enable/disable native PostGIS topology,
128 default: NO
129 Options relevant only to topological output (TOPOLOGY=YES):
130
131 · TOPOSCHEMA_NAME=<schema name> - name of PostGIS Topology schema
132 (relevant only for TOPOLOGY=YES), default: topo_<input>
133
134 · TOPOGEOM_NAME=<column> - name of column which will be used for
135 storing topogeometry data in feature table, default: topo
136
137 · TOPO_TOLERANCE=<value> - tolerance for PostGIS Topology schema,
138 see CreateTopology function for defails, default: 0
139
140 · TOPO_GEO_ONLY=YES|NO - store in PostGIS Topology schema only
141 data relevant to Topo-Geo data model, default: NO
142
143 · SIMPLE_FEATURE=YES|NO - build simple features geometry in GEOM‐
144 ETRY_NAME column from topogeometry data, default: NO
145 Note that topological output requires PostGIS version 2 or later.
146
148 ESRI Shapefile
149 v.external.out can be used along with v.external to process external
150 geodata in GRASS while writing out the results directly eg. in ESRI
151 Shapefile format:
152 # register Shapefile in GRASS mapset:
153 v.external input=/path/to/shapefiles layer=cities
154 # define output directory for GRASS calculation results:
155 v.external.out output=$HOME/gisoutput
156 # do something (here: spatial query), write output directly as Shapefile
157 v.select ainput=cities atype=point binput=forests btype=area operator=within output=fcities
158 Current settings can be printed using -p or -g flag.
159 v.external.out -p
160 output: /path/to/home/gisoutput
161 format: ESRI Shapefile
162
163 PostGIS (simple features)
164 PostGIS data can be accessed directly using GRASS-PostGIS data provider
165 (GRASS must be compiled with PostgreSQL support).
166 # register PostGIS table in GRASS mapset:
167 v.external output=PG:dbname=gisdb layer=cities
168 # define output PostGIS database for GRASS calculation results stored as simple features:
169 v.external.out output=PG:dbname=gisdb format=PostgreSQL
170 # do some processing...
171 Note: If the environment variable GRASS_VECTOR_OGR is defined, or GRASS
172 is compiled without PostgreSQL support then GRASS will use PostgreSQL
173 driver from OGR library for reading and writing PostGIS data.
174
175 PostGIS Topology
176 # define output PostGIS database for GRASS calculation results stored as topological elements:
177 v.external.out output=PG:dbname=gisdb format=PostgreSQL options=topology=YES
178 # do some processing...
179 Note: PostGIS topological access is supported only in built-in
180 GRASS-PostGIS data provider.
181
182 GRASS native format
183 To restore original settings, ie. use the GRASS native format, type:
184 v.external.out -r
185
186 Restore settings
187 Current settings can be stored to file by specifying output option.
188 # define output PostGIS database for GRASS calculation with
189 # results stored as topological elements:
190 v.external.out output=PG:dbname=gisdb format=PostgreSQL \
191 options=topology=YES savesettings=gisdb_topo.txt
192 # ... and do some processing in PostGIS Topology
193 Back to native format:
194 v.external.out -r
195 # do some processing in native format
196 Restore previous settings from "gisdb_topo.txt" file by specifying
197 loadsettings option.
198 v.external.out loadsettings=gisdb_topo.txt
199 # ... and do some processing in PostGIS Topology
200
202 · GRASS-OGR data provider
203
204 · OGR vector library C API documentation
205
206 · GRASS-PostGIS data provider
207
208 · libpq - C Library
209
211 v.external, v.in.ogr, v.out.ogr, v.out.postgis
212
213 See also GRASS user wiki page for more examples.
214
216 Martin Landa, Czech Technical University in Prague, Czech Republic
217 (development supported by Fondazione Edmund Mach and Comune di Trento,
218 Italy)
219
221 Available at: v.external.out source code (history)
222
223 Main index | Vector index | Topics index | Keywords index | Graphical
224 index | Full index
225
226 © 2003-2019 GRASS Development Team, GRASS GIS 7.8.2 Reference Manual
227
228
229
230GRASS 7.8.2 v.external.out(1)