[gdal-dev] save raster as point-vector file

Mateusz Kędzior matandked at gmail.com
Sat Aug 13 04:20:22 EDT 2011

W dniu 13 sierpnia 2011 08:05 użytkownik Chaitanya kumar CH <
chaitanya.ch at gmail.com> napisał:

> Mateusz,
> This is what I did to process evap_OBC.asc ...
> 1. Run the command "gdal2xyz.py -csv evap_OBC.asc evap_OBC.csv". I got a
> csv file.
> 2. Edited the file evap_OBC.csv to add the line "Longitude,Latitude,Value"
> (without the quotes) at the beginning.

This may be a source of problem...
I add in every CSV heading


(Name instead of Value)

> 3. Created a file named evap_OBC.vrt with the following content...
> <OGRVRTDataSource>
>     <OGRVRTLayer name="evap_OBC">
>         <SrcDataSource>evap_OBC.csv</SrcDataSource>
>         <GeometryType>wkbPoint</GeometryType>
>         <GeometryField encoding="PointFromColumns" x="Longitude"
> y="Latitude"/>
>     </OGRVRTLayer>
> </OGRVRTDataSource>
> 4. Run the command "ogr2ogr -select Value evap_OBC.shp evap_OBC.vrt". I got
> the file evap_OBC.shp and two other associated files.
> In step 3, if I wanted to mention the absolute path instead of the relative
> path of the file 'evap_OBC.csv', I would have added the attribute
> 'relativeToVRT=0' to the SrcDataSource element like so.
> <SrcDataSource relativeToVRT="0">evap_OBC.csv</SrcDataSource>

So if I would like to insert absolute path I should add:
 <SrcDataSource relativeToVRT="1">"/home/mateuszk/folder/evap_OBC.
> csv"</SrcDataSource>

Thank You for support and patient.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110813/6c3c1274/attachment.html

More information about the gdal-dev mailing list