[gdal-dev] gdalwarp vertical datum shift question

Mark Warren mark1 at pml.ac.uk
Wed Apr 27 14:42:25 EDT 2011


Hi, I have a question regarding gdalwarp.

We would like to update gdalwarp to be able to be used for DEM files
such that a vertical datum shift can be added to the files, as well as
the horizontal warp. Especially we would want to be able to use the
geoidgrids vertical grid shift option.

As an experiment I have edited a line in the gdalwarpkernal.cpp file in
the function:

static CPLErr GWKNearestNoMasksFloat( GDALWarpKernel *poWK )

((float *)poWK->papabyDstImage[iBand])[iDstOffset] =
    ((float *)poWK->papabySrcImage[iBand])[iSrcOffset]-padfZ[iDstX];

such that instead of assigning the src image value, it assigns that
value with the Z coordinate transform value subtracted. I have checked
this with some warp transformations from WGS84 to OSGB36 and it appears
to work to a certain accuracy (within 10's of cm).

One thing I'm unsure of is whether the fact that the transformation from
destination grid to source grid with the Z value =0 is going to be
inaccurate or not. Should the "proper" way be to assign this the actual
Z value from the source file prior to calculating the transformed
values? This seems that it may be difficult to do as it is using a
backwards transformation (dest to src) so we don't know the src pixel
that relates to the dest pixel until after the transformation.

Another obvious issue would be that we would only want this to happen for 
images with a vertical datum associated (like DEMs) and not for other 
georeferenced imagery that we may want to warp.

So before we go down this route too far (since a lot of changes may be
needed to the code) - does anyone think that this is a feasible idea or
have any other suggestions (other than using a GIS :) )?

Thanks,
Mark

--------------------------------------------------------------------------------
Plymouth Marine Laboratory
 
Registered Office:
Prospect Place 
The Hoe
Plymouth  PL1 3DH
 
Website: www.pml.ac.uk
Click here for PML Annual Review 2010
Registered Charity No. 1091222
PML is a company limited by guarantee
registered in England & Wales
company number 4178503

Please think before you print

--------------------------------------------------------------------------------
This e-mail, its content and any file attachments are confidential.

If you have received this e-mail in error please do not copy, disclose it to any third party or use the contents or attachments in any way. Please notify the sender by replying to this e-mail or e-mail forinfo at pml.ac.uk and then delete the email without making any copies or using it in any other way.

The content of this message may contain personal views which are not the views of Plymouth Marine Laboratory unless specifically stated.

You are reminded that e-mail communications are not secure and may contain viruses. Plymouth Marine Laboratory accepts no liability for any loss or damage which may be caused by viruses.
--------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110427/5a42454a/attachment.html


More information about the gdal-dev mailing list