v.external.out(1)
π v.external.out β the GRASS GIS User's Manual glow-up edition π
okay bestie, sit down, hydrate, because this is the page that tells GRASS how to write your vector maps in external formats instead of the native ones. it's v.external.out, and it is lowkey the main character of the "I want a Shapefile actually" storyline. π¦
β¨ NAME β¨
v.external.out β Defines vector output format. periodt. that's the whole job description.
π KEYWORDS π
vector, export, output, external, OGR, PostGIS
πΈ SYNOPSIS πΈ
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]
π«Ά Flags:
-fβ list every supported format and then dip. bye. π-rβ stop using OGR/PostGIS, go back to native output, and exit. it's giving "we're so back".-pβ print the current status.-gβ print the current status but in shell script style. iykyk.--overwriteβ allow output files to overwrite existing files. yes, it means what it says. π--helpβ print the usage summary.--verboseβ verbose module output.--quietβ quiet module output. shhh.--uiβ force launching the GUI dialog. slay, clicky edition. π
β Parameters:
output=stringβ name of output directory or 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β format for output vector data.
Options: AmigoCloud, Arrow, BAG, CSV, Carto, DGN, DXF, ESRI_Shapefile, Elasticsearch, FITS, FlatGeobuf, GML, GPKG, GPSBabel, GPX, GeoJSON, GeoJSONSeq, GeoRSS, JML, JSONFG, KML, LIBKML, MBTiles, MEM, MSSQLSpatial, MVT, MapInfo_File, MapML, MiraMonVector, MySQL, NGW, ODS, OGR_GMT, OpenFileGDB, PCIDSK, PDF, PDS4, PGDUMP, PMTiles, Parquet, PostgreSQL, S57, SQLite, Selafin, VDV, VICAR, WAsP, XLSX, netCDF
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
loadsettings=nameβ name of input file to read settings from.savesettings=nameβ name for output file where to save current settings.
π DESCRIPTION π
v.external.out instructs GRASS to write vector maps in external data format (e.g. ESRI Shapefile, Mapinfo, and others) using the OGR library. no cap. and PostGIS data can also be written by the built-in GRASS-PostGIS data provider. π¦
π NOTES π
the number of available output formats (v.external.out -f) depends on your OGR installation, bestie. and the '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 a PostGIS database ('PostgreSQL' format), GRASS uses the built-in GRASS-PostGIS data provider. PostGIS data can be written also by the OGR library when the GRASS_VECTOR_OGR environmental variable is defined, or when GRASS is not compiled with PostgreSQL support.
Creation options refer to the output format specified by the format option. see the list of valid creation options at the 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". π
π PostgreSQL/PostGIS Creation Options π
note that the built-in GRASS-PostGIS data provider (format=PostgreSQL) supports different creation options compared to the PostgreSQL/PostGIS driver from the OGR library. (iconic of them, honestly.)
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:fidGEOMETRY_NAME=<column>β name of column which will be used for storing geometry data in feature table, default:geomSPATIAL_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:NO
Options relevant only to topological output (TOPOLOGY=YES):
TOPOSCHEMA_NAME=<schema name>β name of PostGIS Topology schema (relevant only forTOPOLOGY=YES), default:topo_<input>TOPOGEOM_NAME=<column>β name of column which will be used for storing topogeometry data in feature table, default:topoTOPO_TOLERANCE=<value>β tolerance for PostGIS Topology schema, seeCreateTopologyfunction for defails, default:0TOPO_GEO_ONLY=YES|NOβ store in PostGIS Topology schema only data relevant to Topo-Geo data model, default:NOSIMPLE_FEATURE=YES|NOβ build simple features geometry inGEOMETRY_NAMEcolumn from topogeometry data, default:NO
π¨ note that topological output requires PostGIS version 2 or later. don't say we didn't warn you, bestie.
π₯ 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 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 (simple features) π
PostGIS data can be accessed directly using the 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 the PostgreSQL driver from the OGR library for reading and writing PostGIS data.
π§ PostGIS Topology π§
# 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 the built-in GRASS-PostGIS data provider.
πΈ GRASS native format πΈ
to restore original settings, ie. use the GRASS native format, type:
v.external.out -r
π¦ Restore settings π¦
current settings can be stored to file by specifying the output option. (yes, we know, savesettings is the one that names the file β that's what the page says, so that's what we say. π
)
# 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 the loadsettings option.
v.external.out loadsettings=gisdb_topo.txt
# ... and do some processing in PostGIS Topology
π REFERENCES π
- GRASS-OGR data provider
- OGR vector library C API documentation
- GRASS-PostGIS data provider
- libpq - C Library
π SEE ALSO π
v.external, v.in.ogr, v.out.ogr, v.out.postgis
see also GRASS user wiki page for more examples.
π AUTHOR π
Martin Landa, Czech Technical University in Prague, Czech Republic (development supported by Fondazione Edmund Mach and Comune di Trento, Italy)
π SOURCE CODE π
available at: v.external.out source code (history)
accessed: Saturday Jan 17 05:41:34 2026
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie!! π₯³ no cap, every last flag, format, option and default is still in there, untouched, exactly as written β the facts did not get a makeover, only the vibe did. this was GRASS GIS 8.4.2's v.external.out(1) from the GRASS GIS User's Manual, accessed Saturday Jan 17 05:41:34 2026, and it's all Β© 2003-2025 GRASS Development Team. go write some Shapefiles, you absolute icon. π¦β¨π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms