Hi Rich,
Thanks a lot for the big analysis you made.
So with that usgs geotiff (o41078a5.tif) you don't see in geoserver the tiff broken in pieces as I do? That's
really strange. Can I ask you what geoserver version are you using (and maybe the datastore/layer configuration)? Do you have any of the geoserver extensions or maybe tweak any of the gdal/crs data?
You say the code seems from an older version, how an updated ingest code should look? I don't think it's related but who knows.
I'm also working with a 0.9.1-SNAPSHOT although i download it on february (the
geowave-adapter-raster jar version I see is 0.9.1-20160201.220751-4, so maybe not the last one).
Meanwhile I while update geowave code to the latest and check with the PR, but want to be sure I test again with the same configuration you have. I was also thinking about issues in the JAI installation but I suppose if that was the case the geotiff would
directly not work.
About the multiband yes, I understand how it works now in geowave, but I think having both cases working out of the box will be great. But i have no rush, If i need the bands separately I can split them before ingesting with something like this i think.
GridCoverage2D []bands = new GridCoverage2D[coverage.getNumSampleDimensions()];
for(int i=0; i<bands.length; i++)
bands[i] = (GridCoverage2D) Operations.DEFAULT.selectSampleDimension(coverage, new int[]{i});
Kind regards,
De: geowave-dev-bounces@xxxxxxxxxxxxxxxx <geowave-dev-bounces@xxxxxxxxxxxxxxxx> en nombre de Rich Fecher <rfecher@xxxxxxxxx>
Enviado: lunes, 09 de mayo de 2016 01:39 p.m.
Para: geowave-dev@xxxxxxxxxxxxxxxx
Asunto: Re: [geowave-dev] Multiband geotiff problem
Jose,
In digging into this a little, I was disappointed that I could not recreate the issue you are seeing. Your ingest code snippet looks great, although it does appear to be based on an older version of geowave than I had tested with. That being said I don't think
the underlying raster implementation likely changed so again I am disappointed that I can't recreate it. We have been working 0.9.1 on a '0.9.1' branch and are closing in on our release (we merged the '0.9.1' dev branch in with master around the middle of
last week, look out for the 0.9.1 release in the next couple days, we'll send an announcement to the list).
So the behavior that I see which seems a bit different than the png's that you provided, is that it just works when there is a matching resolution tile set with the zoom level in open layers preview. Then when I zoom in too tight, beyond the original resolution
image, or when I zoom out to the point that it will be scaling the lowest resolution pyramid, there is an issue with scaling where the underlying color model of the scaled images do not match the original color model. I suspected the issue could be traced
to significant changes that have been undergone in geotools 14.x integrating JAI-EXT into geotools for raster operations:
https://osgeo-org.atlassian.net/browse/GEOT-5061
GeoWave stores the original image as tiles (optionally building an image pyramid on ingest). The appropriate tiles are quickly retrieved from GeoWave and the resultant WMS request is composed using a mosaic'ing approach that is very closely related to the 'imagemosaic'
geotools extension. So having discovered this change:
https://github.com/geotools/geotools/blame/42c4cc0c3d850b1dea50c07108f171aace35a798/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc/AbstractThread.java#L101
And applying it to GeoWave, the scaling now works. We strive to maintain support for the latest release and the previous one for all of our dependencies which is constantly a challenge. We test those variations by applying a very large build matrix on our
own jenkins CI but also a smaller subset in travis CI (
https://github.com/ngageoint/geowave/blob/master/.travis.yml). This made it very difficult to support raster operations for geotools
13.x and 14.x simultaneously given the scale of the JAI-EXT changes. For 0.9.1 we'd like to update that support to 15.x and 14.x so we can move forward with the implications of these changes.
Here's the PR that will fix the scaling issue (as well as add a method RasterUtils.forceRenderingHints() that will give a user an opportunity to override the rendering hints that we apply by default in the case as you were running into that you may want to
apply a lenient datum shift or some other less common hint).
https://github.com/ngageoint/geowave/compare/GEOWAVE-760?expand=1
Regarding multi-band, keep in mind the current capability is to handle the multi-band exactly as it is ingested. So if you have many bands, it will retain the bands exactly and not subset bands. The question that you had as I understood it is that you
wanted to ingest a mutli-band image and have it automatically separate the bands out into completely different coverages. I see that as a reasonable use case - and I also see as a reasonable use case the inverse operation of combining bands into the same
coverage when the ingested data is separated by band. I think there will be new hooks within geowave in the near future to allow many of these operations. We will be picking this issue back up again in our next release cycle and will be continuing to flesh
out any common use cases:
https://github.com/ngageoint/geowave/issues/346 (there is a branch that has most of the code completed for this issue, but needs to be brought up to speed with the latest GeoWave). Anyways, I did just want to clarify what is meant by multi-band support.
I think the most basic use case is that exactly the bands ingested are how GeoWave presents the data, and an extension to that which we will work is splitting and merging bands between coverages.
Please try the latest with this pull request and let us know if you have any issue.
Rich