[gdal-dev] Ogr2ogr does not apply transform to CSV

Nathan Thomas nmthomas28 at gmail.com
Fri Jul 3 11:13:21 PDT 2020


I have a CSV with X, Y coordinates and height (Z). These heights are ellipsoid heights and I want them corrected to orthometric height, preferably using EGM2008. I try the following with ogr2ogr, 

ogr2ogr -f CSV photon_2018-10-23_t387_1593614567696_EGM2008.csv photon_2018-10-23_t387_1593614567696_EGM2008.vrt -s_srs EPSG:4979 -t_srs EPSG:4326+3855

passing it a vrt file:

<OGRVRTDataSource>
    <OGRVRTLayer name="photon_2018-10-23_t387_1593614567696">
        <SrcDataSource>photon_2018-10-23_t387_1593614567696.csv</SrcDataSource>
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding="PointFromColumns" x="X" y="Y" z="Z"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

However the output file, 'photon_2018-10-23_t387_1593614567696_EGM2008.csv’  is the same as the input CSV and the vertical values are not corrected. If I loop over each set of coordinates and try gdaltransform, I get the correct result although this is not an efficient process:

    cmd = 'echo ' + '"' + str(X[i]) + ' ' + str(Y[i]) + ' ' + str(Z[i]) + '"' + ' | gdaltransform -s_srs "+proj=longlat +datum=WGS84 +no_def" -t_srs "+proj=longlat +datum=WGS84 +no_defs +geoidgrids=egm08_25.gtx"'

Is there a reason why ogr2ogr is not converting the data?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200703/34f95f99/attachment.html>


More information about the gdal-dev mailing list