[Gdal-dev] warp and translate problems
Frank Warmerdam
warmerdam at pobox.com
Wed Oct 6 16:44:35 EDT 2004
Chris Hodgson wrote:
>
>> You can actually use gdal_translate to subset to something like jpeg2000,
>> but what happens inside gdal_translate is that it makes up a "virtual
>> dataset"
>> with the desired characteristics that fetches image data from the real
>> source file as needed.
>
>
> So I should be able to use the "-a_srs" option on gdal_translate to do a
> "one-pass" conversion from TIF/UTM to JP2/BCALB - even though I can't
> use the "-of" option in gdalwarp to do the same thing - just due to the
> different architectures of the programs? I'll have to try it. Though, it
> may not help considering the answer to question #3 :-(
>
> I don't really mind the intermediate step, I just thought that if I can
> read the data from disk fewer times, it should speed things up.
Chris,
You can use -a_srs with gdal_translate, but it doesn't warp the imagery.
It just assigns an srs.
> I think the real problem was that gdaltindex wasn't recognizing the
> GeoJP2 georeferencing - it complained that my jp2 files weren't
> georeferenced. However, they loaded just fine in ArcMap - wow, GeoJP2
> must be a real standard if even ESRI recognizes it :-)
Perhaps you have an old/incompatible gdaltindex? Does your gdalinfo
properly report georeferencing?
>
> An annoyance is that some of our orthos are at different resolutions,
> some are in colour (most B&W), and some are already reprojected to
> albers... this can all be overcome, but causes additional trouble...
> this was supposed to be a simple task, it has become a nightmare (and
> that never happens...)
lol
Well, given an assortment of input data your task isn't simple.
>> Another possibility would be to work with me to add alpha band support
>> to gdalwarp. Then you could warp each file to an RGBA file with a=0
>> for pixels that are not set, and a=255 for pixels that are set.
>> MapServer knows how to utilize per-pixel alpha information when
>> available.
>
>
> This actually seems like the best solution, since we want to be able to
> add new orthos easily (without having to rebuild the tiles for that
> area...), and we're not really worried about edge artifacts, or which
> ortho gets used on slightly-overlapping edge cases...
>
> Let me know if I'm missing something, but this doesn't seem too
> difficult... Let me know off-list how long this would take you to do,
> and how soon you could do it...
OK. I have been intending to make this work for a while, so I think now is
the time. I will try to hack it into gdalwarp this week. The low level
hooks already exist.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list