ÐÐÐСÐÐÐÐ v.in.ogr converts [1]OGR vectors to GRASS. OGR (Simple Features Library) is part of the [2]GDAL library, so you need to install GDAL to use v.in.ogr. If the layer parameter is not given, all available layers are imported. 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 [3]g.region). Topology cleaning on areas is automatically performed, but may fail in special cases (then use [4]v.clean). Supported OGR Vector Formats [5]ESRI Shapefile [6]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 [7]OGR web site. Location Creation v.in.ogr 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 v.in.ogr 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 check. If the user wishes to import the data with the full projection definition, it is possible to have v.in.ogr 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 v.in.ogr dsn=/home/user/shape_data/test_shape.shp output=grass_map Alternate method: v.in.ogr dsn=/home/user/shape_data layer=test_shape output=grass_map * MapInfo files v.in.ogr dsn=./ layer=mapinfo_test output=grass_map * Arc Coverage We import the Arcs and Label points, the module takes care to build areas: v.in.ogr dsn=gemeinden layer=LAB,ARC type=centroid,boundary output=mymap * E00 file (see also [8]v.in.e00) First we have to convert the E00 file to an Arc Coverage with 'avcimport' ([9]AVCE00 tools, use e00conv first in case that avcimport fails): avcimport e00file coverage v.in.ogr dsn=coverage layer=LAB,ARC type=centroid,boundary output=mymap * SDTS files (you have to select the CATD file) v.in.ogr dsn=CITXCATD.DDF output=cities * TIGER files v.in.ogr dsn=input/2000/56015/ layer=CompleteChain,PIP output=t56015_all \ type=boundary,centroid snap=-1 * PostGIS maps (area example) v.in.ogr 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. v.in.ogr dsn=OCI:username/password@database_instance output=grasslayer layer=ro ads_oci Support of database schema: For schema support, first set a default schema with [10]db.connect. If schema support is used the schema name must be specified whenever a db.* module is called. Example: db.connect driver=pg database=test schema=user1 group=group1 db.login driver=pg database=test user=user1 password=pwd1 v.in.ogr dsn=./ layer=river output=river # -> table user1.river db.select 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 v.in.ogr dsn=./ layer=river output=river # -> table public.river db.select table=river ÐÐ ÐÐÐЧÐÐÐЯ The characters used for table column names are limited. Supported are: [A-Za-z][A-Za-z0-9_]* 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. v.in.ogr 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 import. 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 v.in.ogr will produce an error. In this case you will either have to modify the input data or use v.in.ogr'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 [11]db.connect. WARNINGS 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 data). ERROR MESSAGES "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 g.proj with the -c flag and the location= and georef= options to create a new location based upon the projection information in the file. You should then be able to import the file into that location with v.in.ogr. If desired, you can then re-project it to another location with v.proj. ССЫÐÐÐ [12]OGR vector library [13]OGR vector library C API documentation СÐ. ТÐÐÐÐ [14]db.connect, [15]g.proj, [16]v.clean, [17]v.build.polylines, [18]v.edit, [19]v.external, [20]v.in.db, [21]v.in.e00, [22]v.out.ogr, [23]PostGIS driver ÐÐТÐÐ Radim Blazek, ITC-irst, Trento, Italy Location and spatial extent support by Markus Neteler and Paul Kelly Last changed: $Date: 2008-02-17 14:07:11 -0600 (ÐÑ, 17 Ñев 2008) $ ÐвÑÐ¾Ñ Ð¿ÐµÑевода References 1. http://www.gdal.org/ogr/ 2. http://www.gdal.org/ 3. file://localhost/root/tmp/2/fin/g.region.html 4. file://localhost/root/tmp/2/fin/v.clean.html 5. http://www.gdal.org/ogr/drv_shapefile.html 6. http://www.gdal.org/ogr/drv_mitab.html 7. http://www.gdal.org/ogr/ogr_formats.html 8. file://localhost/root/tmp/2/fin/v.in.e00.html 9. http://avce00.maptools.org/avce00/index.html 10. file://localhost/root/tmp/2/fin/db.connect.html 11. file://localhost/root/tmp/2/fin/db.connect.html 12. http://www.gdal.org/ogr/ 13. http://www.gdal.org/ogr/ogr__api_8h.html 14. file://localhost/root/tmp/2/fin/db.connect.html 15. file://localhost/root/tmp/2/fin/g.proj.html 16. file://localhost/root/tmp/2/fin/v.clean.html 17. file://localhost/root/tmp/2/fin/v.build.polylines.html 18. file://localhost/root/tmp/2/fin/v.edit.html 19. file://localhost/root/tmp/2/fin/v.external.html 20. file://localhost/root/tmp/2/fin/v.in.db.html 21. file://localhost/root/tmp/2/fin/v.in.e00.html 22. file://localhost/root/tmp/2/fin/v.out.ogr.html 23. file://localhost/root/tmp/2/fin/grass-pg.html