v.in.osm
Imports OpenStreetMap data into GRASS GIS.
v.in.osm [-ol] input=name [output=name] [where=sql_query] [type=string [,string,...]] [table=name] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
v.in.osm input=name
grass.script.run_command("v.in.osm", input, output=None, where=None, type="point,line,boundary,centroid", table=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("v.in.osm", input="name")
Parameters
input=name [required]
Table file to be imported or DB connection string
output=name
Name for output vector map
where=sql_query
WHERE conditions of SQL statement without 'where' keyword
Example: income < 1000 and population >= 10000
type=string [,string,...]
Name for output vector map
Allowed values: point, line, boundary, centroid
Default: point,line,boundary,centroid
table=name
Name of attribute table
-o
Override projection check (use current location's projection)
Assume that the dataset has the same projection as the current location
-l
List available OGR layers in data source and exit
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
input : str, required
Table file to be imported or DB connection string
Used as: input, file, name
output : str, optional
Name for output vector map
Used as: output, vector, name
where : str, optional
WHERE conditions of SQL statement without 'where' keyword
Example: income < 1000 and population >= 10000
Used as: input, sql_query, sql_query
type : str | list[str], optional
Name for output vector map
Allowed values: point, line, boundary, centroid
Default: point,line,boundary,centroid
table : str, optional
Name of attribute table
Used as: input, dbtable, name
flags : str, optional
Allowed values: o, l
o
Override projection check (use current location's projection)
Assume that the dataset has the same projection as the current location
l
List available OGR layers in data source and exit
overwrite: bool, optional
Allow output files to overwrite existing files
Default: False
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
v.in.osm imports OpenStreetMap data.
EXAMPLES
Import from PostgreSQL DB:
v.in.osm input="PG:host=localhost dbname=gis user=ostepok" table=planet_osm_line \
type=point,line output=roads where="highway is not null"
Import from OSM PBF file:
v.in.osm input=saarland-latest.osm.pbf table=lines type=point,line output=roads \
where="highway is not null"
REQUIREMENTS
PostgreSQL, PostGIS, osm2pgsql
SEE ALSO
AUTHOR
Stepan Turek
SOURCE CODE
Available at: v.in.osm source code
(history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819