2

I have a map saved in (AFAIK) Arc/Info ASCII format and I would like to convert it with gdal grid but I am getting errors.

My data (p.csv) is in the following format:

319053.25,319301.12,544.28
319074.57,319275.26,546.44
319075.00,319250.00,546.34
319075.00,319000.00,468.74
319075.00,318950.00,466.19
319075.00,318925.00,472.06

and I have a p.vrt written by myself:

<OGRVRTDataSource>
    <OGRVRTLayer name="dem">
      <SrcDataSource>p.csv</SrcDataSource> 
      <GeometryType>wkbPoint</GeometryType> 
      <GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

When I launch gdal_grid I get the following error :

$ gdal_grid -l dem p.vrt p.tiff
ERROR 1: Failed to find layer 'dem' on datasource 'p.csv'.
No point geometry found on layer dem, skipping.
5
  • I don't see any CRS definition in your workflow.
    – AndreJ
    Jul 31 '14 at 10:58
  • What can I do about it? How can I fix it? It's not even stated on gdal_grid website
    – Patryk
    Jul 31 '14 at 11:03
  • It is not the reason for the error, but you might get errors later on. <LayerSRS>WGS84</LayerSRS> might solve it. But your coordinates are not WGS84 in this case.
    – AndreJ
    Jul 31 '14 at 11:21
  • Where can I find some information on this SRS (CRS) ?
    – Patryk
    Jul 31 '14 at 11:50
  • See gdal.org/drv_vrt.html
    – AndreJ
    Jul 31 '14 at 12:23
2

Not sure why, but if you rename your layer to "p", it works for me:

<OGRVRTDataSource>
    <OGRVRTLayer name="p">
      <SrcDataSource>p.csv</SrcDataSource> 
      <GeometryType>wkbPoint</GeometryType> 
      <GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

to be used with:

gdal_grid -l p p.vrt p.tiff
2
  • Thanks, this worked but I got an empty tiff :( what am I doing wrong? This are the results of gdalinfo p.tiff: http://pastebin.com/wqYaajBU
    – Patryk
    Jul 31 '14 at 11:55
  • I will post that in different question since this problem is resolved.
    – Patryk
    Jul 31 '14 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.