<div dir="ltr">Hi Even, that is excellent, thank you. <div><br></div><div>I have one question about the resampling workaround: <br><br><div class="gmail_quote">On Wed, 20 May 2015 at 19:34 Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Mike,<br>
<br>
><br>
> By my reading of <a href="https://trac.osgeo.org/gdal/wiki/rfc4_geolocate" target="_blank">https://trac.osgeo.org/gdal/wiki/rfc4_geolocate</a> that means<br>
> the Geolocation tag from gdalinfo should have a PIXEL_STEP and LINE_STEP of<br>
> 5, and if I do this I get a much better result but it's still not right.<br>
<br>
I've just committed a patch in trunk that should put more sensible values for<br>
those values :<br>
r29212 "HDF4: ProcessModisSDSGeolocation(): set more correct values for<br>
PIXEL_/LINE_ OFFSET/STEP by comparing longitude and latitude subdatasets<br>
dimensions with main subdataset dimensions"<br>
<br>
<br>
> I've put a jpeg image of the result, with the coastline mapped and not<br>
> lining up, here:<br>
><br>
> <a href="http://staff.acecrc.org.au/~mdsumner/mod1.jpg" target="_blank">http://staff.acecrc.org.au/~mdsumner/mod1.jpg</a><br>
<br>
Either the data itself is wrong, either there's an issue with the geolocation<br>
transformer... Later hypothesis is the more likely, although I've managed to<br>
make it work with L1B datasets where the tps or geoloc transformers gave<br>
roughly the same results.<br>
<br>
I've gotten smoother results by resizing the longitude&latitude subdatasets to<br>
the main subdataset dimension<br>
<br>
gdal_translate<br>
HDF4_SDS:UNKNOWN:"MOD021KM.A2012062.0455.006.2014220083128.hdf":1<br>
longitude.tif -outsize 1354 2030 -r cubic<br>
<br>
gdal_translate<br>
HDF4_SDS:UNKNOWN:"MOD021KM.A2012062.0455.006.2014220083128.hdf":0 latitude.tif<br>
-outsize 1354 2030 -r cubic<br>
<br>
and then referencing them in the VRT produced with<br>
<br>
gdal_translate -of VRT<br>
HDF4_SDS:UNKNOWN:"MOD021KM.A2012062.0455.006.2014220083128.hdf":2 data.vrt<br>
<br>
(and then by correcting the offset and step values to 0 and 1 respectively)<br>
<br></blockquote><div><br></div><div>Is this what occurs when warping generally? Or, even with your fix for PIXEL/LINE STEP/OFFSET is present will it still be better to do these external steps to improve the result? </div><div><br></div><div>Thanks again, I've really learnt a lot through this process. </div><div><br></div><div>Cheers, Mike. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You might want to do the warp with -wo SAMPLE_GRID=YES -wo SAMPLE_STEPS=100<br>
too<br>
<br>
But overall the reprojected image stays roughly at the same location. This<br>
helps only removing a few artifacts on the edges.<br>
<br>
Even<br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
</blockquote></div></div></div>