2

I am trying to convert an imagine file with meter vertical and horizontal units to a foot projection. Using gdalwarp, I am able to convert the horizontal but the vertical units stays in meters. I did not see an option to either convert the z values or put the vertical unit type in the header.

I noticed gdal_grid has a -z_multiply option, but I would rather not have another step if possible.

Here is an example of my gdalwarp command:

gdalwarp -t_srs ESRI::C:\state_plane_foot.prj -tr 3.3 3.3 -r average -of HFA C:\utm_meter.img C:\state_plane_foot.img
6
  • 3
    Use gdal calc gdal.org/gdal_calc.html on the translated raster and apply the scale factor conversion from metres to feet 3.28084 (or other factor, apparently there's more than one foot but they aren't called left and right). gdal_calc.py -A input1.tif --outfile=result.tif --calc="A*3.28084". As far as I can tell gdalwarp doesn't have an option to change the vertical units, perhaps suggest that on the GDAL site. May 11, 2017 at 21:23
  • @MichaelMiles-Stimson I think you should turn your comment into a valuable answer.
    – AndreJ
    May 15, 2017 at 5:16
  • @warpjedi what is the sense of ESRI:: before the prj file path?
    – AndreJ
    May 15, 2017 at 5:19
  • @AndreJ After searching the web I don't know where/if I found it in reference to gdalwarp, but this page discusses using an ESRI WKT for the -a_srs option.
    – warpjedi
    May 15, 2017 at 19:27
  • @MichaelMiles-Stimson Like I said, I would rather not have to add another step before or after the warp. I have plenty of tools for scaling Z. I was hoping I was just missing an option in gdalwarp.
    – warpjedi
    May 15, 2017 at 19:28

1 Answer 1

2

The capability to automatically shift vertical datums was added to gdalwarp in GDAL 2.2. This should include unit conversions for vertical datums that it recognizes and for which it has shift files.

1
  • Thanks! We are a version behind. Is there a way to create overviews with gdalwarp? Currently, we are running gdaladdo afterwards.
    – warpjedi
    May 15, 2017 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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