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. ’PG:dbname=db user=grass’
53
54 format=string
55 Format for output vector data
56 Options: AmigoCloud, BNA, CSV, Carto, Cloudant, CouchDB, DGN, DXF,
57 ESRI_Shapefile, ElasticSearch, GFT, GML, GPKG, GPSBabel, GPSTrack‐
58 Maker, GPX, GeoJSON, GeoRSS, Geoconcept, Interlis_1, Interlis_2,
59 JML, KML, LIBKML, MBTiles, MSSQLSpatial, MVT, MapInfo_File, Memory,
60 MySQL, ODBC, ODS, OGR_GMT, PCIDSK, PDF, PGDUMP, PostgreSQL, S57,
61 SQLite, Selafin, TIGER, VDV, WAsP, XLSX, netCDF
62 Default: ESRI_Shapefile
63
64 options=string[,string,...]
65 Creation options
66 Examples:
67 ’SHPT=POINTZ’: create 3D point Shapefile data
68 ’GEOM_TYPE=geography’: use geography PostGIS data
69 ’SCHEMA=grass’: create new PostGIS tables in ’grass’ schema
70
71 loadsettings=name
72 Name of input file to read settings from
73
74 savesettings=name
75 Name for output file where to save current settings
76
78 v.external.out instructs GRASS to write vector maps in external data
79 format (e.g. ESRI Shapefile, Mapinfo, and others) using OGR library.
80 PostGIS data can be also written by built-in GRASS-PostGIS data
81 provider.
82
84 Number of available output formats (v.external.out -f) depends on OGR
85 installation. ’PostgreSQL’ format is presented also when GRASS comes
86 with PostgreSQL support (check for ’--with-postgres’ in g.version -b
87 output).
88
89 To store geometry and attribute data in PostGIS database (’PostgreSQL’
90 format) GRASS uses built-in GRASS-PostGIS data provider. PostGIS data
91 can be written also by OGR library when GRASS_VECTOR_OGR environmental
92 variable is defined or GRASS is not compiled with PostgreSQL support.
93
94 Creation options refer to the output format specified by format option.
95 See the list of valid creation options at OGR formats specification
96 page, example for ESRI Shapefile or PostgreSQL/PostGIS format (section
97 "Layer Creation Options"). Options are comma-separated pairs
98 (key=value), the options are case-insensitive, eg.
99 options="SCHEMA=myschema,FID=cat".
100
101 PostgreSQL/PostGIS Creation Options
102 Note that built-in GRASS-PostGIS data provider (format=PostgreSQL) sup‐
103 ports different creation options compared to PostgreSQL/PostGIS driver
104 from OGR library:
105
106 · SCHEMA=<name> - name of schema where to create feature tables.
107 If schema doesn’t exists, it’s automatically created when writ‐
108 ing PostGIS data.
109
110 · FID=<column> - name of column which will be used as primary key
111 (feature id), default: fid
112
113 · GEOMETRY_NAME=<column> name of column which will be used for
114 storing geometry data in feature table, default: geom
115
116 · SPATIAL_INDEX=YES|NO - enable/disable spatial index on geometry
117 column, default: YES
118
119 · PRIMARY_KEY=YES|NO - enable/disable primary key on FID column,
120 default: YES
121
122 · SRID=<value> - spatial reference identifier, default: not
123 defined
124
125 · TOPOLOGY=YES|NO - enable/disable native PostGIS topology,
126 default: NO
127 Options relevant only to topological output (TOPOLOGY=YES):
128
129 · TOPOSCHEMA_NAME=<schema name> - name of PostGIS Topology schema
130 (relevant only for TOPOLOGY=YES), default: topo_<input>
131
132 · TOPOGEOM_NAME=<column> - name of column which will be used for
133 storing topogeometry data in feature table, default: topo
134
135 · TOPO_TOLERANCE=<value> - tolerance for PostGIS Topology schema,
136 see CreateTopology function for defails, default: 0
137
138 · TOPO_GEO_ONLY=YES|NO - store in PostGIS Topology schema only
139 data relevant to Topo-Geo data model, default: NO
140
141 · SIMPLE_FEATURE=YES|NO - build simple features geometry in GEOM‐
142 ETRY_NAME column from topogeometry data, default: NO
143 Note that topological output requires PostGIS version 2 or later.
144
146 ESRI Shapefile
147 v.external.out can be used along with v.external to process external
148 geodata in GRASS while writing out the results directly eg. in ESRI
149 Shapefile format:
150 # register Shapefile in GRASS mapset:
151 v.external input=/path/to/shapefiles layer=cities
152 # define output directory for GRASS calculation results:
153 v.external.out output=$HOME/gisoutput
154 # do something (here: spatial query), write output directly as Shapefile
155 v.select ainput=cities atype=point binput=forests btype=area operator=within output=fcities
156 Current settings can be printed using -p or -g flag.
157 v.external.out -p
158 output: /path/to/home/gisoutput
159 format: ESRI Shapefile
160
161 PostGIS (simple features)
162 PostGIS data can be accessed directly using GRASS-PostGIS data provider
163 (GRASS must be compiled with PostgreSQL support).
164 # register PostGIS table in GRASS mapset:
165 v.external output=PG:dbname=gisdb layer=cities
166 # define output PostGIS database for GRASS calculation results stored as simple features:
167 v.external.out output=PG:dbname=gisdb format=PostgreSQL
168 # do some processing...
169 Note: If the environment variable GRASS_VECTOR_OGR is defined, or GRASS
170 is compiled without PostgreSQL support then GRASS will use PostgreSQL
171 driver from OGR library for reading and writing PostGIS data.
172
173 PostGIS Topology
174 # define output PostGIS database for GRASS calculation results stored as topological elements:
175 v.external.out output=PG:dbname=gisdb format=PostgreSQL options=topology=YES
176 # do some processing...
177 Note: PostGIS topological access is supported only in built-in
178 GRASS-PostGIS data provider.
179
180 GRASS native format
181 To restore original settings, ie. use the GRASS native format, type:
182 v.external.out -r
183
184 Restore settings
185 Current settings can be stored to file by specifying output option.
186 # define output PostGIS database for GRASS calculation with
187 # results stored as topological elements:
188 v.external.out output=PG:dbname=gisdb format=PostgreSQL \
189 options=topology=YES savesettings=gisdb_topo.txt
190 # ... and do some processing in PostGIS Topology
191 Back to native format:
192 v.external.out -r
193 # do some processing in native format
194 Restore previous settings from "gisdb_topo.txt" file by specifying
195 loadsettings option.
196 v.external.out loadsettings=gisdb_topo.txt
197 # ... and do some processing in PostGIS Topology
198
200 · GRASS-OGR data provider
201
202 · OGR vector library C API documentation
203
204 · GRASS-PostGIS data provider
205
206 · libpq - C Library
207
209 v.external, v.in.ogr, v.out.ogr, v.out.postgis
210
211 See also GRASS user wiki page for more examples.
212
214 Martin Landa, Czech Technical University in Prague, Czech Republic
215 (development supported by Fondazione Edmund Mach and Comune di Trento,
216 Italy)
217
218 Last changed: $Date: 2015-11-24 09:07:58 +0100 (Tue, 24 Nov 2015) $
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.4.4 Reference Manual
227
228
229
230GRASS 7.4.4 v.external.out(1)