123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <h2>DESCRIPTION</h2>
- <em>v.external</em> creates new vector map as a link to external OGR
- layer or PostGIS feature table. OGR (Simple Features Library) is part
- of the
- <a href="http://www.gdal.org">GDAL</a> library, so you need to install
- GDAL to use <em>v.external</em> for external OGR layers. Note that a
- PostGIS feature table can be linked also using built-in <em>GRASS-PostGIS
- data driver</em> (requires GRASS to be built with PostgreSQL support).
- <h2>NOTES</h2>
- <p>The simple feature data model used by OGR (or PostGIS) is very
- different from the topological format used by GRASS. Instead of true
- topology, so called 'pseudo topology' is created for data linked by
- <em>v.external</em>. User should learn the difference between those
- two formats, because <b>some modules</b> working correctly with GRASS native
- data, <b>can produce wrong results</b> with input vector maps created
- by <em>v.external</em>.
- <p>
- <b>Limitations:</b>
- <p>
- Due to these data model differences <em>v.external</em> does not work
- with all data formats. In general, for all formats that do not have a
- key column (e.g. SHAPE file), attributes are not accessible, and attributes
- would get lost when modifying the geometries. Therefore it is generally
- not safe to link vector data with <em>v.external</em>. In many cases it
- does not make sense to use <em>v.external</em> linked data with simple
- features, instead vector data should be imported with <em>v.import</em>
- or <em>v.in.ogr</em> to get true topology support. Importantly, point
- cloud data which do not have topology, can be linked with <em>v.external</em>
- as long as there are no attributes attached to these point cloud data, or
- if the format of the point cloud data has a key column that allows linking
- vector geometries to attributes.
- <p>See <em><a href="v.db.connect.html">v.db.connect</a></em> for an
- example of maintaining attributes in external DBMS in also writable
- mode.
- <h3>Supported OGR vector formats</h3>
- To list supported OGR formats, type
- <div class="code"><pre>
- v.external -f
- </pre></div>
- For details see
- <a href="https://gdal.org/drivers/vector/">GDAL web site</a>.
- <h2>EXAMPLES</h2>
- <h3>ESRI Shapefile</h3>
- Assuming that 'test_shape.shp' is located in directory
- '/home/user/shape_data'.
- <div class="code"><pre>
- v.external input=/home/user/shape_data layer=test_shape output=grass_map
- </pre></div>
- <h3>PostGIS layers</h3>
- By default, PostGIS links are created by built-in PostGIS support,
- ie. using <em>GRASS-PostGIS data driver</em>. If the environment
- variable <tt>GRASS_VECTOR_OGR</tt> exists, or GRASS is compiled
- without PostgreSQL support then GRASS will use OGR-PostgreSQL driver
- for creating a link.
- <p>List of layers for given data source can be printed by <b>-l</b>
- flag.
- <div class="code"><pre>
- v.external input="PG:host=localhost user=postgres dbname=postgis" -l
- ...
- polymap
- ...
- </pre></div>
- <div class="code"><pre>
- v.external input="PG:host=localhost user=postgres dbname=postgis" layer=polymap
- </pre></div>
- Note: Authentication details (user password) can be preferably defined
- by <em><a href="db.login.html">db.login</a></em>.
- <h3>MapInfo files</h3>
- Assuming that 'mapinfo_test' MapInfo file is located in the current
- directory (".").
- <div class="code"><pre>
- v.external input=./ layer=mapinfo_test output=grass_map
- </pre></div>
- <h3>SDTS files</h3>
- Note: you have to select the CATD file
- <div class="code"><pre>
- v.external input=CITXCATD.DDF output=cities
- </pre></div>
- <h3>TIGER files</h3>
- <div class="code"><pre>
- v.external input=input/2000/56015/ layer=CompleteChain,PIP output=t56015_all
- </pre></div>
- <h3>Linking subset of features</h3>
- By <b>where</b> option only subset of features can be linked. In the
- example below only one feature (in this case a vector tile) will be
- linked as a new GRASS vector map.
- <div class="code"><pre>
- v.external in="PG:dbname=tiles" layer=wrs2_descending where="pr=191026"
- ...
- Number of areas: 1
- ...
- </pre></div>
- <h2>REFERENCES</h2>
- <a href="https://gdal.org/api/">OGR vector library C
- API</a> documentation
- <h2>SEE ALSO</h2>
- <em>
- <a href="v.external.out.html">v.external.out</a>,
- <a href="v.clean.html">v.clean</a>,
- <a href="v.db.connect.html">v.db.connect</a>,
- <a href="v.import.html">v.import</a>,
- <a href="v.in.db.html">v.in.db</a>,
- <a href="v.in.ogr.html">v.in.ogr</a>,
- <a href="v.out.ogr.html">v.out.ogr</a>
- </em>
- <p>
- <a href="http://www.gdal.org/">GDAL Library</a>
- <br>
- <a href="http://postgis.org/">PostGIS</a>
- <p>
- See
- also GRASS <a href="https://grasswiki.osgeo.org/wiki/Working_with_external_data_in_GRASS_7">user wiki page</a> for more examples.
- <h2>AUTHORS</h2>
- Radim Blazek, ITC-Irst, Trento, Italy
- <br>
- PostGIS support by Martin Landa, GeoForAll (OSGeoREL) Lab, Czech
- Technical University in Prague, Czech Republic
- <!--
- <p>
- <i>Last changed: $Date$</i>
- -->
|