Geoscience Reference
In-Depth Information
PARAMETER["central_meridian",-8],
PARAMETER["scale_factor",1.000035],
PARAMETER["false_easting",200000],
PARAMETER["false_northing",250000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH],
AUTHORITY["EPSG","29900"]]
line_id: String (0.0)
Lines: String (0.0)
It is often necessary to generate a spatial layer from a set of coordinates that may
be stored as a comma separated value (CSV). For instance you may have a list of field
plots defined by their geo-coordinates with associated attributes. We can extend the
VRT created previously to also hold a set of plot data (plots.csv) listed as follows:
X;Y;ID;LUT
199223;224322;1;Forest
56102;102324;2;Water
250253;254203;3;Agriculture
199212;134242;4;Forest
We can then append a new layer to the VRT.
<OGRVRTDataSource>
...
<LayerSRS>EPSG:29900</LayerSRS>
<GeometryField encoding="WKT"field="Lines"/>
</OGRVRTLayer>
<OGRVRTLayer name="plots">
<SrcDataSource
Separator="SEMICOLON">plots.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>EPSG:29900</LayerSRS>
<GeometryField encoding="PointFromColumns"x="X"y="Y"/>
</OGRVRTLayer>
<!-- FINAL XML TAG -->
</OGRVRTDataSource>
To check its contents, we use ogrinfo :
ogrinfo -so virtual.vrt
INFO: Open of 'virtual.vrt'
using driver 'VRT' successful.
1: gps_paths (Multi Line String)
2: plots (Point)
 
 
Search WWH ::




Custom Search