[gdal-dev] Telling lies with geotiif metadata
Even Rouault
even.rouault at mines-paris.org
Tue Aug 26 13:10:48 EDT 2008
Disclaimer : I just read the 2 first paragraphs.
Indeed, if you want to be able to using bilinear resampling, cubic, etc...,
you can't do that on a paletted dataset. You must convert it before to 24
bit. So the solution is to pct2rgb.py your input files (or use the
new -expand rgb|rgba option in gdal_translate in GDAL development version)
and then warp them into epsg 3395. Then you should get correct quality.
Le Tuesday 26 August 2008 15:41:04 Wendell Turner, vous avez écrit :
> Hello!
>
> I am trying to do something I probably shouldn't ...
>
> I have about 30 geotiffs that tile the continental US (aviation sectional
> charts). Each of them uses a slightly different projection -- LCC with
> different standard parallels and origins for each chart.
>
> Using gdalwarp, I converted everything to a single projection -- epsg 3395
> -- but the quality suffered (I was never able to get any resampling method
> other than "near" to work properly; the colormaps kept getting screwed up.
> There doesn't seem to be any way to tell gdalwarp "stop trying to make a
> new colormap, just use the old one!")
>
> The result is OK for display on a screen (I have a nifty OpenLayers
> interface to it), but I also need to print good-quality versions. Sometimes
> the prints will need to cross the boundaries between the geotiffs. These
> prints also need to be at a (nearly) constant scale, which is inconsistent
> with using 3395 anyway, since it is a Mercator projection.
>
> I could warp everything to some other projection (LCC with a single set of
> standard parallels, say) but I am willing to accept a small amount of
> mis-registration at the boundaries between charts if it would save me the
> loss of quality in the warp. (In fact, people do this with the paper
> charts all the time -- at many airports you'll see multiple charts glued to
> the wall, abutting. The misregistration is typically less than a few
> millimeters across a four-foot chart.)
>
> [Of course, the misregistration is probably cumulative in some sense; with
> the paper charts one can simply "eyeball" the error and slide the chart so
> as to minimize it. I'm not sure how to express this mathematically ... ]
>
> So, what I am thinking of doing is to rewrite the geotiff metadata so as to
> simply lie about the projection. gdal_translate has options called -a_srs
> and -a_ullr that appear to do at least part of what I want.
>
> Is there a "null projection" that I could give to gdal_translate so as to
> not to munge any of the actual pixels?
>
> Is there some better way of re-writing the geotiff metadata than by passing
> it through gdal_translate?
>
> Is this a silly idea that I should receive the cartographic equivalent of
> being disbarred for even suggesting?
More information about the gdal-dev
mailing list