[gdal-dev] Border slivers and JPEG2000 compression

Smith, Michael Michael.Smith at maine.gov
Mon Dec 15 17:03:49 EST 2008

I have several orthophotos which are TIFFs, and they align with the USGS
quadrangle corners, which means they are rotated slightly, leaving small
uneven slivers along the edges where pixel value is 0 (the data for
these are available from adjacent tiles).  All the pixels inside the
'real' area of the photo are value > 0.

This is no problem with TIFFs, as the 0 can be turned off in
applications such as ArcGIS or serving them out via MapServer WMS.  But
when I convert to JPEG2000 (using Kakadu), the edge pixels are
interpolated to different values, typically something like 0, 1, 2, or
3.  Thus I can't just filter them out. Also inside the photo, sometimes
very dark pixels (which should really be value 2, 3, etc) are converted
to value 0.  Thus they show up as 'holes' in applications when pixel
value 0 is filtered out.

What I want to do is simply show a bunch of JP2 tiles, with the border
pixels staying as value 0, and no other pixels having value 0.

I have tried a couple approaches, including 

gdal_translate -a_nodata 0   (the border pixels still have values > 0)

gdal_rasterize -i -burn 0    (won't write JP2KAK)

Surely I'm not the first to try this, but I can't find the right steps
on the web.  Any suggestions would be appreciated.

Michael Smith
State GIS Manager
Maine Office of GIS 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20081215/496ba2a7/attachment.html

More information about the gdal-dev mailing list