v.import(1grass)
π v.import β the GRASS manual, bestie edition π
okay so you found v.import in the GRASS User's Manual and you're about to have the best time. this page is gonna walk you through the whole thing, no gatekeeping. π«Ά
NAME (aka the vibe) β v.import imports vector data into a GRASS vector map using the OGR library, and it reprojects on the fly. literally does both. β¨
KEYWORDS (the tags on the post) β vector, import, projection
β¨ SYNOPSIS β¨
v.import
v.import --help
v.import [-flo] input=string [layer=string[,string,...]]
[output=name] [extent=string] [encoding=string] [snap=float]
[epsg=integer] [datum_trans=integer] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π Flags π
-fβ list every OGR format it supports, then exit. little window-shopping moment. π-lβ list the available OGR layers in the datasource, then exit. also dipping out after.-oβ override the projection check and just use the current project's CRS. basically: "assume the dataset has the same coordinate reference system (CRS) as the current project." do this with your whole chest only if you're sure, okay? π--overwriteβ let the output files overwrite existing files. chaos option, use responsibly.--helpβ print the usage summary.--verboseβ verbose module output, aka it will yap.--quietβ quiet module output, aka it shuts up.--uiβ force launching the GUI dialog. for the visual learners. π
π¦ Parameters π¦
input=string[required] β name of the OGR datasource you wanna import. yes this one's mandatory, no skipping.layer=string[,string,...]β OGR layer name. if you don't give one, all available layers get imported. all of them. the full collection. πoutput=nameβ name for the output vector map. default isinput, so if you're lazy it just reuses that.extent=stringβ output vector map extent. Options:input,region. Default:input.inputβ extent of input mapregionβ extent of current region
encoding=stringβ encoding value for attribute data.snap=floatβ snapping threshold for boundaries, in map units. a suitable threshold is estimated during import. Default:-1.epsg=integerβ EPSG projection code. Options:1-1000000.datum_trans=integerβ index number of datum transform parameters.-1lists the available datum transform parameters. Options:-1-100.
π DESCRIPTION π
v.import imports vector data from files and database connections that the OGR library supports into the current project (yes, bestie, this is what we used to call a location) and the mapset. If the coordinate reference system (CRS) of the input doesn't match the CRS of the project, the input gets reprojected into the current project. and if the CRS of the input map does match the project's CRS? then it's imported directly, no glow-up needed. β¨
πΈ Supported Vector Formats πΈ
v.import uses the OGR library, which supports a whole lineup of vector data formats β ESRI Shapefile, Mapinfo File, UK .NTF, SDTS, TIGER, IHO S-57 (ENC), DGN, GML, GPX, AVCBin, REC, Memory, OGDI, and PostgreSQL β depending on your local OGR installation. so like, it depends on the setup. for the details, see the OGR web site. the OGR (Simple Features Library) is part of the GDAL library, which means GDAL has to be installed to use v.import. no GDAL, no party. π
the actual list of supported formats can be printed with the -f flag. periodt.
π NOTES π
v.import checks the CRS metadata of the dataset you're importing against the current project's. if they're not identical, it shows you a related error message. it's not being mean, it's being honest.
to override this CRS check β i.e. to use the current project's CRS β by assuming the dataset has the same CRS as the current project, you can use the -o flag. this is also useful when the geodata you're importing has no CRS metadata at all. but listen: you must be sure the CRS is identical in order to avoid introducing data errors. no cap, this one matters.
π¨ do not just slap -o on everything because it's the fast path. the fast path is how data errors get born.
π§ Topology cleaning π§
when importing polygons, non-topological polygons get converted to topological areas. if the input polygons contain errors β unexpected overlapping areas, small gaps between polygons, or warnings about being unable to calculate centroids β you might need to repeat the import using a snap value as suggested in the output messages. the default value of snap=-1 means no snapping will be done. as in, zero. none. π
the snap threshold defines the maximal distance from one vertex to another vertex in map units (for latitude-longitude projects, that's in degrees). if there's no other vertex within snap distance, no snapping will be done. and note: a too large value can severely damage area topology, beyond repair. that's not a drill, that's a death sentence for your geoms. π
Post-processing: snapped boundaries may need to be cleaned with v.clean, using its tools break,rmdupl,rmsa. for the details, refer to the v.clean manual page. go read it. π
β EXAMPLE β
# import SHAPE file at full extent and reproject to current project CRS
v.import input=research_area.shp output=research_area extent=input
π SEE ALSO π
v.clean, v.in.lines, v.in.ogr, v.proj
the friend group. π
π AUTHORS π
- Markus Metz
- Improvements: Martin Landa, Anna Petrasova
π SOURCE CODE π
Available at: v.import source code (history)
Latest change: Sunday Nov 09 19:22:25 2025 in commit: 7335bd572fec91187fef5f9a6c2e984caf4650fc
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie. π«Ά you read all of it, i'm so proud. the source and the receipts: Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual. also this doc goes out to GRASS 8.5.0 β v.import(1grass). slay, go import something. π
β¨πΈ
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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