.TH v.external 1grass "" "GRASS 8.3.1" "GRASS GIS User's Manual" .SH NAME \fI\fBv.external\fR\fR \- Creates a new pseudo\-vector map as a link to an OGR\-supported layer or a PostGIS feature table. .SH KEYWORDS vector, import, external, OGR, PostGIS, level1 .SH SYNOPSIS \fBv.external\fR .br \fBv.external \-\-help\fR .br \fBv.external\fR [\-\fBojfltb\fR] \fBinput\fR=\fIstring\fR [\fBlayer\fR=\fIname\fR] [\fBwhere\fR=\fIsql_query\fR] [\fBoutput\fR=\fIname\fR] [\-\-\fBoverwrite\fR] [\-\-\fBhelp\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] [\-\-\fBui\fR] .SS Flags: .IP "\fB\-o\fR" 4m .br Override projection check (use current location\(cqs projection) .br Assume that the dataset has the same projection as the current location .IP "\fB\-j\fR" 4m .br Perform projection check only and exit .IP "\fB\-f\fR" 4m .br List supported formats and exit .IP "\fB\-l\fR" 4m .br List available layers in data source and exit .IP "\fB\-t\fR" 4m .br List available layers including feature type in data source and exit .br Format: layer name,type,projection check,geometry .IP "\fB\-b\fR" 4m .br Do not build topology .br Advantageous when handling a large number of points .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-help\fR" 4m .br Print usage summary .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .IP "\fB\-\-ui\fR" 4m .br Force launching GUI dialog .SS Parameters: .IP "\fBinput\fR=\fIstring\fR \fB[required]\fR" 4m .br Name of input OGR or PostGIS data source .br Examples: .br         ESRI Shapefile: directory containing a shapefile .br         MapInfo File: directory containing a mapinfo file .br         PostGIS database: connection string, eg. \(cqPG:dbname=db user=grass\(cq .IP "\fBlayer\fR=\fIname\fR" 4m .br Name of OGR layer or PostGIS feature table to be linked .br Examples: .br         ESRI Shapefile: shapefile name .br         MapInfo File: mapinfo file name .br         PostGIS database: table name .IP "\fBwhere\fR=\fIsql_query\fR" 4m .br WHERE conditions of SQL statement without \(cqwhere\(cq keyword .br Example: income < 1000 and population >= 10000 .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output GRASS vector map (default: input layer) .SH DESCRIPTION \fIv.external\fR creates new vector map as a link to external OGR layer or PostGIS feature table. OGR (Simple Features Library) is part of the GDAL library, so you need to install GDAL to use \fIv.external\fR for external OGR layers. Note that a PostGIS feature table can be linked also using built\-in \fIGRASS\-PostGIS data driver\fR (requires GRASS to be built with PostgreSQL support). .SH NOTES .PP 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 \(cqpseudo topology\(cq is created for data linked by \fIv.external\fR. User should learn the difference between those two formats, because \fBsome modules\fR working correctly with GRASS native data, \fBcan produce wrong results\fR with input vector maps created by \fIv.external\fR. .PP \fBLimitations:\fR .PP Due to these data model differences \fIv.external\fR 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 \fIv.external\fR. In many cases it does not make sense to use \fIv.external\fR linked data with simple features, instead vector data should be imported with \fIv.import\fR or \fIv.in.ogr\fR to get true topology support. Importantly, point cloud data which do not have topology, can be linked with \fIv.external\fR 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. .PP See \fIv.db.connect\fR for an example of maintaining attributes in external DBMS in also writable mode. .SS Supported OGR vector formats To list supported OGR formats, type .br .nf \fC v.external \-f \fR .fi For details see GDAL web site. .SH EXAMPLES .SS ESRI Shapefile Assuming that \(cqtest_shape.shp\(cq is located in directory \(cq/home/user/shape_data\(cq. .br .nf \fC v.external input=/home/user/shape_data layer=test_shape output=grass_map \fR .fi .SS PostGIS layers By default, PostGIS links are created by built\-in PostGIS support, ie. using \fIGRASS\-PostGIS data driver\fR. If the environment variable GRASS_VECTOR_OGR exists, or GRASS is compiled without PostgreSQL support then GRASS will use OGR\-PostgreSQL driver for creating a link. .PP List of layers for given data source can be printed by \fB\-l\fR flag. .br .nf \fC v.external input=\(dqPG:host=localhost user=postgres dbname=postgis\(dq \-l \&... polymap \&... \fR .fi .br .nf \fC v.external input=\(dqPG:host=localhost user=postgres dbname=postgis\(dq layer=polymap \fR .fi Note: Authentication details (user password) can be preferably defined by \fIdb.login\fR. .SS MapInfo files Assuming that \(cqmapinfo_test\(cq MapInfo file is located in the current directory (\(dq.\(dq). .br .nf \fC v.external input=./ layer=mapinfo_test output=grass_map \fR .fi .SS SDTS files Note: you have to select the CATD file .br .nf \fC v.external input=CITXCATD.DDF output=cities \fR .fi .SS TIGER files .br .nf \fC v.external input=input/2000/56015/ layer=CompleteChain,PIP output=t56015_all \fR .fi .SS Linking subset of features By \fBwhere\fR 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. .br .nf \fC v.external in=\(dqPG:dbname=tiles\(dq layer=wrs2_descending where=\(dqpr=191026\(dq \&... Number of areas: 1 \&... \fR .fi .SH REFERENCES OGR vector library C API documentation .SH SEE ALSO \fI v.external.out, v.clean, v.db.connect, v.import, v.in.db, v.in.ogr, v.out.ogr \fR .PP GDAL Library .br PostGIS .PP See also GRASS user wiki page for more examples. .SH AUTHORS Radim Blazek, ITC\-Irst, Trento, Italy .br PostGIS support by Martin Landa, GeoForAll (OSGeoREL) Lab, Czech Technical University in Prague, Czech Republic .SH SOURCE CODE .PP Available at: v.external source code (history) .PP Accessed: Sunday Dec 17 17:22:33 2023 .PP Main index | Vector index | Topics index | Keywords index | Graphical index | Full index .PP © 2003\-2023 GRASS Development Team, GRASS GIS 8.3.1 Reference Manual