OGR (Simple Features Library) is part of the GDAL library, so you need to install this library to use v.out.ogr.
The OGR library supports many various formats including:
For further available other supported formats go here.
v.out.ogr exports 3D vector data as 2.5D simple features if possible (not supported by all formats). For exporting 3D vector data as 2D simple features, use -2 flag.
By default, v.out.ogr converts GRASS vector data to single simple features. If GRASS feature has more categories defined in the given layer, then this feature is exported multiple times. GRASS features without category are skipped by default. To export features also without category, the -c flag must be given.
When -m flag is given, v.out.ogr export GRASS vector data as multi-features. Multi-feature is formed by GRASS features with the same category. When -c flag is given, the module also export GRASS features without category as one multi-feature. Note that multi-features are not supported by all formats.
v.out.ogr input=lines type=line dsn=lines.shp
Export areas from GRASS vector map to Shapefile format, converting islands (holes) to filled polygons:
v.out.ogr -c input=areas_islands type=area dsn=areas_islands.shp
Export 3D lines from GRASS vector map to Shapefile format:
v.out.ogr input=lines_3d type=line dsn=lines_3d.shp lco="SHPT=ARCZ"
Export 3D points (e.g., Lidar points) from GRASS vector map to Shapefile format
v.out.ogr points_3d type=point dsn=points_3d.shp lco="SHPT=POINTZ"
Export 3D faces from GRASS vector map to Shapefile format:
v.out.ogr input=objects_3d type=face dsn=faces_3d.shp lco="SHPT=POLYGONZ"
Export 3D faces from GRASS vector map to Shapefile format, automatic 3D setting:
v.out.ogr input=objects_3d type=face dsn=faces_3d.shp"
v.out.ogr input=multi type=line dsn=/tmp/testogr.gml olayer=testogr format=GML
v.out.ogr input=polygons type=area dsn="PG:host=localhost dbname=postgis user=postgres" olayer=polymap format=PostgreSQL
Export faces (3D vectors) from GRASS vector map to KML format for Google Earth:
v.out.ogr input=buildings_3d dsn=buildings_3d.kml olayer=buildings_3d format=KML type=face
Generate and export GRASS vector "asteroid" map (faces, 3D vectors) to KML format for Google Earth:
# near Raleigh (NC, USA) g.region n=35.73952587 s=35.73279182 w=-78.68263928 e=-78.67499517 # two layers of random points v.random -z output=random3d_a n=10 zmin=0 zmax=200 v.random -z output=random3d_b n=15 zmin=400 zmax=600 # merge into one 3D points map v.patch input=random3d_a,random3d_b output=random3d # generate 3D convex hull v.hull input=random3d output="random3d_hull" # export to KML 3D v.out.ogr input=random3d_hull dsn=random3d_hull.kml format=KML type=face dsco="AltitudeMode=absolute" # now open KML file 'random3d_hull.kml' in Google Earth or NASA WorldWind or ...
Last changed: $Date$