[gdal-dev] RE: Border slivers and JPEG2000 compression

Smith, Michael Michael.Smith at maine.gov
Tue Dec 30 14:49:01 EST 2008


I never found a good solution to this - one thing I am doing is taking
the TIFFs and mosaicking them with their neighbors to fill these slivers
with data from the adjacent tile, so there are no slivers.  That is a
brute-force and inelegant solution though.

Any suggestions on how to keep border pixels with value 0 in a TIFF to
stay 0 in a resulting JP2 (with Kakadu) in GDAL?

**********
Michael Smith
State GIS Manager
Maine Office of GIS 


> _____________________________________________ 
> From: 	Smith, Michael  
> Sent:	Monday, December 15, 2008 5:04 PM
> To:	'gdal-dev at lists.osgeo.org'
> Subject:	Border slivers and JPEG2000 compression
> 
> 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/20081230/084bbaee/attachment.html


More information about the gdal-dev mailing list