## NAME

v.out.ogr - Convert to one of the supported OGR vector formats.

## KEYWORDS

vector

## SYNOPSIS

v.out.ogr
v.out.ogr help
v.out.ogr [-cep] input=name [type=string[,string,...]] dsn=string olayer=string [layer=integer] [format=string] [dsco=string] [lco=string]

### Flags:

-c
  Export features with category (labeled) only. Otherwise all features are exported
-e
  Use ESRI-style .prj file format (applies to SHAPE output only)
-p
  Export lines as polygons

### Parameters:

input=name
  Name of input vector map
type=string[,string,...]
  Feature type. Combination of types is not supported by all formats.
  Options: point,kernel,centroid,line,boundary,area,face
  Default: line,boundary
dsn=string
  OGR output datasource name. For example:
  ESRI Shapefile: filename or directory for storage
  MapInfo File: filename or directory for storage
olayer=string
  OGR layer name.
  ESRI Shapefile: shapefile name
  MapInfo File: mapinfo file name
layer=integer
  Layer number
  Default: 1
format=string
  OGR format.
  Options: ESRI_Shapefile,TIGER,S57,MapInfo_File,DGN,Memory,CSV,GML
  Default: ESRI_Shapefile
dsco=string
  OGR dataset creation option (format specific, NAME=VALUE)
  Default:
lco=string
  OGR layer creation option (format specific, NAME=VALUE)
  Default:

## DESCRIPTION

v.out.ogr 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 v.out.ogr.
To export areas with holes into, e.g., a SHAPE file, while keeping the holes as holes, the flag -c has to be used.

### Supported OGR Vector Formats

ESRI Shapefile
CSV
GML
KML
Mapinfo File
PostgreSQL/PostGIS
TIGER

For further available drivers go here.

## EXAMPLES

### Export to SHAPE

Export lines from GRASS vector map to SHAPE format (generates /tmp/testogr.shp and related files):

    v.out.ogr input=multi type=line dsn=/tmp olayer=testogr

Export areas from GRASS vector map to SHAPE format (generates /tmp/testogr.shp and related files):

    v.out.ogr input=multi type=area dsn=/tmp olayer=testogr

### Export to GML

Export lines from GRASS vector map to GML format (generates /tmp/testogr.gml file with layer 'testogr'):

    v.out.ogr input=multi type=line dsn=/tmp/testogr.gml olayer=testogr format=GML

### Export to PostgreSQL/PostGIS

Export areas from GRASS vector map directly to PostGIS:

    v.out.ogr input=polygons type=area \
              dsn="PG:host=localhost dbname=postgis user=postgres" \
              olayer=polymap format=PostgreSQL

### Export to KML (Google Earth)

Export faces (3D vectors) from GRASS vector map in KML format for Google Earth:

    v.out.ogr in=buildings_3d dsn=buildings_3d.kml olayer=buildings_3d format=KML type=face

## REFERENCES

OGR vector library
OGR vector library C API documentation

## SEE ALSO

v.external, v.in.ogr

## AUTHORS

Radim Blazek, ITC-Irst, Trento, Italy
Some contributions: Markus Neteler

Last changed: $Date: 2006/06/13 16:17:53 $

Main index - vector index - Full index