.TH v.out.ogr 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBv.out.ogr\fR\fR - Converts GRASS vector map to one of the supported OGR vector formats. .SH KEYWORDS vector, export .SH SYNOPSIS \fBv.out.ogr\fR .br \fBv.out.ogr help\fR .br \fBv.out.ogr\fR [\-\fBuscezp\fR] \fBinput\fR=\fIname\fR [\fBtype\fR=\fIstring\fR[,\fIstring\fR,...]] \fBdsn\fR=\fIstring\fR [\fBolayer\fR=\fIstring\fR] [\fBlayer\fR=\fIinteger\fR] [\fBformat\fR=\fIstring\fR] [\fBdsco\fR=\fIstring\fR[,\fIstring\fR,...]] [\fBlco\fR=\fIstring\fR[,\fIstring\fR,...]] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-u\fR" 4m .br Open an existing datasource for update .IP "\fB\-s\fR" 4m .br Skip export of GRASS category ID ('cat') attribute .IP "\fB\-c\fR" 4m .br Export features with category (labeled) only. Otherwise all features are exported .IP "\fB\-e\fR" 4m .br Use ESRI-style .prj file format (applies to Shapefile output only) .IP "\fB\-z\fR" 4m .br Create 3D output if input is 3D (applies to Shapefile output only) .IP "\fB\-p\fR" 4m .br Export lines as polygons .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBinput\fR=\fIname\fR" 4m .br Name of input vector map .IP "\fBtype\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br Feature type(s). Combinations not supported by all output formats. Default: first type found in input. .br Options: \fIpoint,line,boundary,centroid,area,face,kernel,auto\fR .br Default: \fIline,boundary\fR .IP "\fBdsn\fR=\fIstring\fR" 4m .br OGR output datasource name .br For example: ESRI Shapefile: filename or directory for storage .IP "\fBolayer\fR=\fIstring\fR" 4m .br OGR layer name. If not specified, input name is used. .br For example: ESRI Shapefile: shapefile name .IP "\fBlayer\fR=\fIinteger\fR" 4m .br Layer number .br A single vector map can be connected to multiple database tables. This number determines which table to use. .br Default: \fI1\fR .IP "\fBformat\fR=\fIstring\fR" 4m .br OGR format .br Options: \fIESRI_Shapefile,MapInfo_File,TIGER,S57,DGN,Memory,BNA,CSV,GML,GPX,LIBKML,KML,GeoJSON,Interlis_1,Interlis_2,GMT,SQLite,ODBC,MSSQLSpatial,PostgreSQL,MySQL,PCIDSK,DXF,Geoconcept,GeoRSS,GPSTrackMaker,PGDump,GPSBabel,GFT,CouchDB,ODS,XLSX,ElasticSearch,PDF\fR .br Default: \fIESRI_Shapefile\fR .IP "\fBdsco\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br OGR dataset creation option (format specific, NAME=VALUE) .br Default: \fI\fR .IP "\fBlco\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br OGR layer creation option (format specific, NAME=VALUE) .br Default: \fI\fR .PP .SH DESCRIPTION \fIv.out.ogr\fR converts GRASS vector data to OGR format. OGR (Simple Features Library) is part of the GDAL library, so you need to install gdal to use \fIv.out.ogr\fR. .SS Supported OGR Vector Formats ESRI Shapefile .br CSV .br GML .br KML .br Mapinfo File .br PostgreSQL/PostGIS .br TIGER .PP For further available drivers go here. .SH NOTES To export areas with holes into, e.g., a Shapefile, while keeping the holes as holes, the flag \fI-c\fR has to be used. .PP The "-z" flag can be used to automatically export a 3D map to a 3D Shapefile, instead of setting the correct \fIlco=\fR option manually. .SH EXAMPLES .SS Export to Shapefile Export lines from GRASS vector map to Shapefile format: \fC .DS .br v.out.ogr input=lines type=line dsn=lines.shp .br .DE \fR .PP Export areas from GRASS vector map to Shapefile format, preserving islands: \fC .DS .br v.out.ogr \-c input=areas_islands type=area dsn=areas_islands.shp .br .DE \fR .PP Export 3D lines from GRASS vector map to Shapefile format: \fC .DS .br v.out.ogr input=lines_3d type=line dsn=lines_3d.shp lco="SHPT=ARCZ" .br .DE \fR .PP Export 3D points (e.g., Lidar points) from GRASS vector map to Shapefile format \fC .DS .br v.out.ogr points_3d type=point dsn=points_3d.shp lco="SHPT=POINTZ" .br .DE \fR .PP Export 3D faces from GRASS vector map to Shapefile format: \fC .DS .br v.out.ogr input=objects_3d type=face dsn=faces_3d.shp lco="SHPT=POLYGONZ" .br .DE \fR .PP Export 3D faces from GRASS vector map to Shapefile format, automatic 3D setting: \fC .DS .br v.out.ogr input=objects_3d type=face dsn=faces_3d.shp \-z .br .DE \fR .SS Export to GML Export lines from GRASS vector map to GML format (generates /tmp/testogr.gml file with layer 'testogr'): \fC .DS .br v.out.ogr input=multi type=line dsn=/tmp/testogr.gml olayer=testogr format=GML .br .DE \fR .SS Export to PostgreSQL/PostGIS Export areas from GRASS vector map directly to PostGIS: \fC .DS .br v.out.ogr input=polygons type=area \(rs .br dsn="PG:host=localhost dbname=postgis user=postgres" \(rs .br olayer=polymap format=PostgreSQL .br .DE \fR .SS Export to KML (Google Earth) \fBExample 1 (Latitude-Longitude location):\fR .br Export faces (3D vectors) from GRASS vector map to KML format for Google Earth: \fC .DS .br v.out.ogr input=buildings_3d dsn=buildings_3d.kml olayer=buildings_3d \(rs .br format=KML type=face .br .DE \fR .PP \fBExample 2 (Latitude-Longitude location):\fR .br Generate and export GRASS vector "asteroid" map (faces, 3D vectors) to KML format for Google Earth: \fC .DS .br # near Raleigh (NC, USA) .br g.region n=35.73952587 s=35.73279182 w=-78.68263928 e=-78.67499517 .br .br # two layers of random points .br v.random \-z output=random3d_a n=10 zmin=0 zmax=200 .br v.random \-z output=random3d_b n=15 zmin=400 zmax=600 .br .br # merge into one 3D points map .br v.patch input=random3d_a,random3d_b output=random3d .br .br # generate 3D convex hull .br v.hull input=random3d output="random3d_hull" .br .br # export to KML 3D .br v.out.ogr input=random3d_hull dsn=random3d_hull.kml format=KML \(rs .br type=face dsco="AltitudeMode=absolute" .br .br # now open KML file 'random3d_hull.kml' in Google Earth or NASA WorldWind or ... .br .DE \fR .SH REFERENCES OGR vector library .br OGR vector library C API documentation .SH SEE ALSO \fI db.out.ogr, v.external, v.in.ogr \fR .SH AUTHORS Radim Blazek, ITC-Irst, Trento, Italy .br Some contributions: Markus Neteler, Martin Landa .PP \fILast changed: $Date: 2014-01-02 22:54:21 +0100 (Thu, 02 Jan 2014) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team