Database Reference
In-Depth Information
9. Note how the coordinates have been projected from EPSG:4326 to
EPSG:3857 :
postgis_cookbook=# SELECT
ST_AsEWKT(the_geom) FROM chp01.global_24h
LIMIT 1;
st_asewkt
------------------------------------------------------
SRID=3857;POINT(-5142626.51617686
-2678766.03496892)
(1 row)
How it works...
As mentioned in the GDAL documentation:
"OGR Virtual Format is a driver that transforms features read from other drivers
based on criteria specified in an XML control file."
GDAL supports the reading and writing of nonspatial tabular data stored as a CSV
file,butweneedtouseavirtualformattoderivethegeometryofthelayersfromat-
tributecolumnsintheCSVfile(thelongitudeandlatitudecoordinatesforeachpoint).
For this purpose, you need to at least specify in the driver the path to the CSV file
(the SrcDataSource element), the geometry type (the GeometryType element),
the spatial reference definition for the layer (the LayerSRS element), and the way
the driver can derive the geometric information (the GeometryField element).
TherearemanyotheroptionsandreasonsforusingOGRvirtualformats;ifyouare
interestedinhavingabetterunderstanding,pleaserefertotheGDALdocumentation
available at http://www.gdal.org/ogr/drv_vrt.html .
Afteravirtualformatiscorrectlycreated,theoriginalflatnonspatialdatasetisspa-
tiallysupportedbyGDALandthesoftwarebasedonGDAL.Thisisthereasonwhy
wecanmanipulatethesefileswithGDALcommandssuchas ogrinfo and ogr2o-
gr , and with Desktop GIS software such as QGIS.
Search WWH ::




Custom Search