Provided by: grass-doc_6.4.3-3_all bug

NAME  - Convert OGR vector layers to GRASS vector map.


       vector, import

SYNOPSIS help    [-lfcztorew]    [dsn=string]     [output=name]     [layer=string[,string,...]]
       [spatial=xmin,ymin,xmax,ymax[,xmin,ymin,xmax,ymax,...]]                  [where=sql_query]
       [min_area=float]       [type=string[,string,...]]      [snap=float]      [location=string]
       [cnames=string[,string,...]]   [--overwrite]  [--verbose]  [--quiet]

           List available layers in data source and exit

           List supported formats and exit

           Do not clean polygons (not recommended)

           Create 3D output

           Do not create attribute table

           Override dataset projection (use location's projection)

           Limit import to the current region

           Extend region extents based on new dataset
           Also updates the default region if in the PERMANENT mapset

           Change column names to lowercase characters

           Allow output files to overwrite existing files

           Verbose module output

           Quiet module output

           OGR datasource name
                     ESRI  Shapefile:  directory   containing   shapefiles        MapInfo   File:
           directory containing mapinfo files

           Name for output vector map

           OGR layer name. If not given, all available layers are imported
                     ESRI Shapefile: shapefile name          MapInfo File: mapinfo file name

           Import subregion only
           Format: xmin,ymin,xmax,ymax - usually W,S,E,N

           WHERE conditions of SQL statement without 'where' keyword
           Example: income = 10000

           Minimum size of area to be imported (square units)
           Smaller areas and islands are ignored. Should be greater than snap^2
           Default: 0.0001

           Optionally change default input type
           Options: point,line,boundary,centroid
           point: import area centroids as points
           line: import area boundaries as lines
           boundary: import lines as area boundaries
           centroid: import points as centroids

           Snapping threshold for boundaries
           ’-1' for no snap
           Default: -1

           Name for new location to create

           List  of column names to be used instead of original names, first is used for category

DESCRIPTION converts OGR vectors to GRASS.  OGR (Simple Features Library) is part of the GDAL
       library, so you need to install GDAL to use

       If  the  layer parameter is not given, all available layers are imported as separate GRASS
       layers into one GRASS vector map. If several OGR layer names are given, all  these  layers
       are imported as separate GRASS layers into one GRASS vector map.

       The  optional  spatial parameter defines spatial query extents.  This parameter allows the
       user to restrict the region to a spatial subset  while  importing  the  data.  All  vector
       features  completely or partially falling into this rectangle subregion are imported.  The
       -r current region flag is identical, but uses the current region settings as  the  spatial
       bounds (see g.region).

       Topology cleaning on areas is automatically performed, but may fail in special cases (then
       use v.clean).

       The min_area threshold value is being specified  as  area  size  in  map  units  with  the
       exception  of latitude-longitude locations in which it is being specified solely in square

       The snap threshold value is used to snap boundary vertices to each other if  the  distance
       in map units between two vertices is not larger than the threshold. Snapping is by default
       disabled with -1. See also the v.clean manual.

   Supported OGR Vector Formats
       ESRI Shapefile
       Mapinfo File

       Further available drivers such as UK .NTF, SDTS, TIGER, IHO S-57 (ENC), DGN, GML,  AVCBin,
       REC,  Memory,  OGDI,  and  PostgreSQL  depend on the local installation (OGR library), for
       details see OGR web site.

   Overlapping polygons
       When importing overlapping polygons, the overlapping parts  will  become  new  areas  with
       multiple  categories,  one  unique category for each original polygon. An original polygon
       will thus be converted to multiple areas with the same  shared  category.  These  multiple
       areas will therefore also link to the same entry in the attribute table. A single category
       value may thus refer to  multiple  non-overlapping  areas  which  together  represent  the
       original  polygon  overlapping with another polygon. The original polygon can be recovered
       by using v.extract with the desired category value or where statement and the -d  flag  to
       dissolve common boundaries.

Location Creation attempts to preserve projection information when importing datasets if the source
       format includes projection information, and  if  the  OGR  driver  supports  it.   If  the
       projection  of  the  source  dataset does not match the projection of the current location will report an error message ("Projection of dataset does  not  appear  to  match
       current location") and then report the PROJ_INFO parameters of the source dataset.

       If  the user wishes to ignore the difference between the apparent coordinate system of the
       source data and the current location, they may pass the -o flag to override the projection

       If  the user wishes to import the data with the full projection definition, it is possible
       to have automatically create a new location based on the projection  and  extents
       of  the  file being read.  This is accomplished by passing the name to be used for the new
       location via the location parameter.  Upon completion of the command, a new location  will
       have  been  created  (with  only  a  PERMANENT  mapset), and the vector map will have been
       imported with the indicated output name into the PERMANENT mapset.


       The command imports various vector formats:

                     SHAPE files
            dsn=/home/user/shape_data/test_shape.shp output=grass_map
                      Alternate method:
            dsn=/home/user/shape_data layer=test_shape output=grass_map

                     MapInfo files
            dsn=./ layer=mapinfo_test output=grass_map

                     Arc Coverage
                     We import the Arcs and Label points, the module takes care to build areas:

            dsn=gemeinden layer=LAB,ARC type=centroid,boundary output=mymap

                     E00 file (see also
                     First we have to convert the E00 file to an Arc  Coverage  with  'avcimport'
                     (AVCE00 tools, use e00conv first in case that avcimport fails):

                     avcimport e00file coverage
            dsn=coverage layer=LAB,ARC type=centroid,boundary output=mymap

                     SDTS files (you have to select the CATD file)

            dsn=CITXCATD.DDF output=cities

                     TIGER files

            dsn=input/2000/56015/ layer=CompleteChain,PIP output=t56015_all \
                     type=boundary,centroid snap=-1

                     PostGIS maps (area example)

             dsn="PG:host=localhost dbname=postgis user=postgres" layer=polymap
                     output=polygons type=boundary,centroid

                     Oracle Spatial maps
                     Note that you have to set the environment-variables ORACLE_BASE, ORACLE_SID,
                     ORACLE_HOME and TNS_ADMIN accordingly.
               dsn=OCI:username/password@database_instance    output=grasslayer

   Support of database schema:
       For schema support, first set a default schema with db.connect. If schema support is  used
       the schema name must be specified whenever a db.* module is called.

       db.connect driver=pg database=test schema=user1 group=group1
       db.login driver=pg database=test user=user1 password=pwd1 dsn=./ layer=river output=river     # -> table user1.river table=user1.river
        The user can ignore schemas, if desired:
       db.connect driver=pg database=test
       db.login driver=pg database=test user=user1 password=pwd1 dsn=./ layer=river output=river     # -> table public.river table=river


       The characters used for table column names are limited. Supported are:

         This  means that SQL neither supports '.' (dots) nor '-' (minus) nor '#' in table column
       names. Also a table name must start with a character, not a number. converts '.', '-' and '#' to '_' (underscore) during import.  The -w flag changes
       capital  column  names  to  lowercase characters as a convenience for SQL usage (lowercase
       column names avoid the need to quote them if the attribute table is stored in a  SQL  DBMS
       such  as  PostgreSQL).   The  cnames  parameter  is used to define new column names during

       The DBF database specification limits column names to 10 characters.  If the default DB is
       set  to DBF and the input data contains longer column/field names, they will be truncated.
       If this results in multiple columns with the same  name  then  will  produce  an
       error.   In  this  case  you  will  either have to modify the input data or use's
       cnames parameter to rename columns to something unique. (hint: copy and  modify  the  list
       given with the error message).  Alternatively, change the local DB with db.connect.


       If  a message like "WARNING: Area size 1.3e-06, area not imported."  appears, the min_area
       may be adjusted to a smaller value so that all areas are imported.  Otherwise  tiny  areas
       are  filtered  out  during import (useful to polish digitization errors or non-topological


       "ERROR: DBMI-DBF driver error: SQL parser error: syntax error, unexpected DESC,  expecting
       NAME processing 'DESC'"
       indicates  that  a  column  name  corresponds  to  a  reserved SQL word (here: 'DESC').  A
       different column name should be used. The cnames parameter can be used to assign different
       column names on the fly.

       "ERROR: Projection of dataset does not appear to match the current location."
       You  need  to  create a location whose projection matches the data you wish to import. Try
       using location parameter to create a new location based upon the projection information in
       the file. If desired, you can then re-project it to another location with v.proj.


       OGR vector library
       OGR vector library C API documentation


        db.connect, v.clean, v.extract,, v.edit, v.external,,,
       PostGIS driver


       Radim Blazek, ITC-irst, Trento, Italy
       Location and spatial extent support by Markus Neteler and Paul Kelly

       Last changed: $Date: 2012-08-21 12:23:56 -0700 (Tue, 21 Aug 2012) $

       Full index

       © 2003-2013 GRASS Development Team