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 is input, so if you're lazy it just reuses that.
  • extent=string β€” output vector map extent. Options: input, region. Default: input.
    • input β€” extent of input map
    • region β€” 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. -1 lists 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