Hi Christian, In terms of rescaling, the following seems to work at least for 32 bit integer rasters:
Now my problem is with startImage - it is created with underlying values of '0', so when I pan or zoom out in Layer Preview, I get a black border around my image (please see screenshots below) Layer Preview for my test raster: <http://osgeo-org.1560.x6.nabble.com/file/n5087386/test-raster.jpg> Moved test raster a bit to the right top corner: <http://osgeo-org.1560.x6.nabble.com/file/n5087386/test-raster-panned.jpg> It looks as this happens because startImage is created with all '0' values in the underlying raster. So when we put tile image from PostGIS over the top of it, there is a band of '0' values left over (which shows up in black) as the tile image doesn't cover the entire start image. I am experimenting with creating startImage using nodata values from PostGIS and it seems to fix the black border problem. (hacked it for now to suit my raster, but I imagine that it may be a bit more complicated to implement for multi-band rasters) Does that sound as an acceptable approach? thanks Nataliya nroberts wrote > both 32 bit integer and float don't work for me. > > 32 bit integer produces solid black image due to alll values being turned > into '0' and 32 bit float throws ArrayOutOfBounds exception when > attempting to rescaleImage. > > cheers > Nataliya > Christian Mueller-3 wrote >> Yep, the rescale op is the problem. >> >> Do you have a 32 bit float or integer raster. As far as I can remember, >> integer rasters should work fine, float is causing the problem. I also >> tried some different implemenations for the rescale operation, but none >> was >> working for float values. >> >> Cheers >> Christian >> >> >> On Mon, Nov 4, 2013 at 8:32 AM, nroberts < >> nataliya_roberts@.com >> >wrote: >> >>> Hi Christian, >>> >>> thank you for the suggestion! >>> >>> I have upgraded to 10.1 and the situation is a bit better, but I am >>> still >>> having a problem with my 32bit raster, albeit a slightly different one - >>> all >>> I can see now is a solid black image filling an entire image area in the >>> Layer Preview. >>> >>> It looks to me as rescaleImage still doesn't rescale single band 32 bit >>> raster image correctly: if I check image properties after rescale >>> operation, >>> the underlying raster contains all '0' values. >>> >>> Here is what I tried so far in an attempt to diagnose the problem: >>> * exported raster into a .tiff file and reimported it into GeoServer >>> using >>> GeoTiff plugin - it appears to work fine (i.e I can see expected >>> visualisation in the Layer Preview and featureinfo displays correct >>> information). >>> * commented out ImageComposerThread.rescaleImage - Layer Preview >>> displays >>> raster correctly (as long as I don't zoom out) >>> * tried to create GridCoverage2D using GridCoverageFactory.create() >>> method >>> that accepts MathTransform and using this transform to scale instead of >>> rescaling the image beforehand (this approach doesn't work with zoom out >>> either) >>> >>> Since I am no expert in image processing or coverages, I am not sure how >>> best to fix this. >>> >>> I may be doing something unconventional when creating my raster, so, >>> just >>> in >>> case, here is a list of sql commands I use to create test data: >>> >>> >>> >>> Thanks >>> Nat >>> >>> ( I am using geoserver 2.4.1 and geotools 10.1 version) >>> >>> >>> >>> Christian Mueller-3 wrote >>> > Some weeks ago, I did some major changes. Please switch to the lastest >>> > version or check out trunk from github. >>> > >>> > Christian >>> > >>> > >>> > On Thu, Oct 31, 2013 at 12:45 PM, Andrea Aime >>> > < >>> >>> > andrea.aime@ >>> >>> > >wrote: >>> > >>> >> On Thu, Oct 31, 2013 at 12:34 PM, nroberts < >>> >>> > nataliya_roberts@.com >>> >>> > >wrote: >>> >> >>> >>> Hi Christian, >>> >>> >>> >>> I am using 9.5. >>> >>> >>> >>> I checked trunk svn a few weeks back (assuming this is a correct >>> >>> location >>> >>> for it: >>> >>> >>> >>> >>> http://svn.osgeo.org/geotools/trunk/modules/plugin/imagemosaic-jdbc/src/main/java/org/geotools/gce/imagemosaic/jdbc >>> >>> ) >>> >>> and didn't spot any changes in the code in comparison to my my 9.5 >>> >>> version. >>> >>> Should I try version 10+? >>> >>> >>> >> >>> >> Way off the mark I'm afraid, GeoTools has not been using svn for a >>> long >>> >> time now. >>> >> The sources are on github: >>> >> https://github.com/geotools/geotools >>> >> >>> >> Cheers >>> >> Andrea >>> >> >>> >> -- >>> >> == >>> >> Our support, Your Success! Visit http://opensdi.geo-solutions.it for >>> more >>> >> information. >>> >> == >>> >> >>> >> Ing. Andrea Aime >>> >> @geowolf >>> >> Technical Lead >>> >> >>> >> GeoSolutions S.A.S. >>> >> Via Poggio alle Viti 1187 >>> >> 55054 Massarosa (LU) >>> >> Italy >>> >> phone: +39 0584 962313 >>> >> fax: +39 0584 1660272 >>> >> mob: +39 339 8844549 >>> >> >>> >> http://www.geo-solutions.it >>> >> http://twitter.com/geosolutions_it >>> >> >>> >> ------------------------------------------------------- >>> >> >>> >> >>> >> >>> ------------------------------------------------------------------------------ >>> >> Android is increasing in popularity, but the open development >>> platform >>> >> that >>> >> developers love is also attractive to malware creators. Download this >>> >> white >>> >> paper to learn more about secure code signing practices that can help >>> >> keep >>> >> Android apps secure. >>> >> >>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk >>> >> _______________________________________________ >>> >> Geoserver-users mailing list >>> >> >>> >>> > Geoserver-users@.sourceforge >>> >>> >> https://lists.sourceforge.net/lists/listinfo/geoserver-users >>> >> >>> >> >>> > >>> > >>> > -- >>> > DI Christian Mueller MSc (GIS), MSc (IT-Security) >>> > OSS Open Source Solutions GmbH >>> > >>> > >>> ------------------------------------------------------------------------------ >>> > Android is increasing in popularity, but the open development platform >>> > that >>> > developers love is also attractive to malware creators. Download this >>> > white >>> > paper to learn more about secure code signing practices that can help >>> keep >>> > Android apps secure. >>> > >>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk >>> > _______________________________________________ >>> > Geoserver-users mailing list >>> >>> > Geoserver-users@.sourceforge >>> >>> > https://lists.sourceforge.net/lists/listinfo/geoserver-users >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://osgeo-org.1560.x6.nabble.com/Image-Mosaic-JDBC-single-band-raster-losing-data-values-tp5058549p5087186.html >>> Sent from the GeoServer - User mailing list archive at Nabble.com. >>> >>> >>> ------------------------------------------------------------------------------ >>> Android is increasing in popularity, but the open development platform >>> that >>> developers love is also attractive to malware creators. Download this >>> white >>> paper to learn more about secure code signing practices that can help >>> keep >>> Android apps secure. >>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Geoserver-users mailing list >>> >> Geoserver-users@.sourceforge >>> https://lists.sourceforge.net/lists/listinfo/geoserver-users >>> >> >> >> >> -- >> DI Christian Mueller MSc (GIS), MSc (IT-Security) >> OSS Open Source Solutions GmbH >> >> ------------------------------------------------------------------------------ >> Android is increasing in popularity, but the open development platform >> that >> developers love is also attractive to malware creators. Download this >> white >> paper to learn more about secure code signing practices that can help >> keep >> Android apps secure. >> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk >> _______________________________________________ >> Geoserver-users mailing list >> Geoserver-users@.sourceforge >> https://lists.sourceforge.net/lists/listinfo/geoserver-users -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Image-Mosaic-JDBC-single-band-raster-losing-data-values-tp5058549p5087386.html Sent from the GeoServer - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users