[Gdal-dev] improved gdal_vrtmerge.py

Vincent Schut schut at sarvision.nl
Fri Nov 9 05:11:14 EST 2007


Folks,

as a result of the discussion in the thread about modis sinusoidal tile
processing with gdal_vrtmerge.py, I hereby submit a (imho) slightly
improved version of gdal_vrtmerge.py.

Changes (compared to the version in gdal's pymod/samples directory):

o  uses ngpython bindings (from osgeo import gdal)
o  fixed colortable bug
o  added customizable precision for coordinates and pixel sizes, by
   default set to 10 digits. Can be adjusted by changing the variable
   'precision' at the beginning of the python script.
   This is used 1) to round the calculation result of corner coordinates
   and pixel size, and 2) in the comparison between pixel size/scale of
   multiple datasets (including a conversion to string before
   comparison) to prevent bailing out on nanometer/degree scale
   differences due to rounding/floating point issues.

Any of you who speaks python, feel free to double check my changes and
eventually propose better ones :-) I hereby donate this version to the
gdal community.

Regards,
Vincent Schut.

Hmm will try to attach the script, hope it won't be too large for the ml...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdal_vrtmerge.py
Type: text/x-python
Size: 9432 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20071109/ea977767/gdal_vrtmerge.py


More information about the gdal-dev mailing list