Database Reference
In-Depth Information
How to do it...
The steps you need to follow to complete this recipe are as follows:
1. Analyzethestructureofthe Global_24h.csv CSVfile(inWindows,open
the CSV file with an editor such as Notepad).
$ cd ~/postgis_cookbook/data/chp01/
$ head -n 5 Global_24h.csv
latitude,longitude,brightness,scan,track,acq_date,acq_time,satellite,confidence,version,bright_t31,frp
-23.386,-46.197,307.5,1.1,1,2012-08-20,
0140,T,54,5.0 ,285.7,16.5
-22.952,-47.574,330.1,1.2,1.1,2012-08-20,
0140,T,100,5.0 ,285.2,53.9
-23.726,-56.108,333.3,4.7,2,2012-08-20,
0140,T,100,5.0 ,283.5,404.1
-23.729,-56.155,311.8,4.7,2,2012-08-20,
0140,T,61,5.0 ,272,143.1
2. Create a GDAL virtual data source composed of just one layer derived
from the Global_24h.csv file. To do so, create a text file named glob-
al_24h.vrt in the same directory where the CSV file is and edit it as fol-
lows:
<OGRVRTDataSource>
<OGRVRTLayer name="Global_24h">
<SrcDataSource>Global_24h.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>EPSG:4326</LayerSRS>
<GeometryField
encoding="PointFromColumns"x="longitude"
y="latitude"/>
</OGRVRTLayer>
</OGRVRTDataSource>
Search WWH ::




Custom Search