Dear Geotoolers, Dear Andrea This morning i felt the strong desire to create an Image Pyramid and display it with geotools. It failed on four runs.. I want to report my experiences and as usual i hope for some friendly advice.. thanks in advance!!!
This is the documentation that i found regarding the creation of Image Pyramids: http://docs.codehaus.org/display/GEOSDOC/Image+Pyramid http://docs.codehaus.org/display/GEOSDOC/High+performance+coverage+serving http://docs.codehaus.org/display/GEOSDOC/Load+NASA+Blue+Marble+Data The BlueMarble Tutorial is using a lot of gdal and MosaicIndexBuilder, and then finally passes "-s index.shp" to the it.geosolutions.utils.imagepyramid.PyramidBuilder. The JavaDoc sais it takes a file (e.g. big.tiff) or a folder as source.. First question: Is PyramidBuilder really so "polymorphic" that it can handle a tiff, a folder or a shp? I have tried the most appealing and simple path which is just passing "-s big.tiff " to the PyramidBuilder which should then create all the image pyramid on the fly! Wouldn't that be great!? Well.. I started with a big GeoTiff in UTM31 with 8 Bands > Driver: GTiff/GeoTIFF > Files: orig.tif > orig.aux > orig.rrd > Size is 6985, 8019 > Coordinate System is: > PROJCS["WGS 84 / UTM zone 31N", > GEOGCS["WGS 84", > DATUM["WGS_1984", > SPHEROID["WGS 84",6378137,298.2572235629972, > AUTHORITY["EPSG","7030"]], > AUTHORI... these are the full cmd line parameters: -s /home/.../orig.tif -f 2 -n 4 -t "200,200" -w The result was not successfull: > 14.08.2007 14:22:21 Resample doOperation > WARNUNG: Grid geometry has been adjusted for coverage "orig". > Exception in thread "PyramidBuilder" java.lang.NullPointerException > at > org.geotools.gce.geotiff.GeoTiffWriter.createGeoTiffIIOMetadata(GeoTiffWrit >er.java:415) at > org.geotools.gce.geotiff.GeoTiffWriter.writeImage(GeoTiffWriter.java:365) > at org.geotools.gce.geotiff.GeoTiffWriter.write(GeoTiffWriter.java:202) at > it.geosolutions.utils.coveragetiler.CoverageTiler.run(CoverageTiler.java:44 >7) at > it.geosolutions.utils.imagepyramid.PyramidBuilder.tileInput(PyramidBuilder. >java:619) at > it.geosolutions.utils.imagepyramid.PyramidBuilder.run(PyramidBuilder.java:5 >34) at java.lang.Thread.run(Thread.java:619) Only one zero-size file was touched at pyramid/0/mosaic_0.tiff Ok, next try... I transformed the CRS to EPSG:4326, which was used in the examples.. > gdalwarp -t_srs "EPSG:4326" orig.tif 4326.tiff and i tried again -s /home/.../4326.tiff -f 2 -n 4 -t "200,200" -w The warning "Grid geometry has been adjusted for coverage" went away, but still the same NullPointerException... Again, only one zero-size file was touched at pyramid/0/mosaic_0.tiff OK.. next - out of pure trial and error - i extracted three of the 8 bands > gdal_translate -of GTiff -b 4 -b 3 -b 2 orig.tif threebands.tiff and tried it again.. this is aain the original UTM31 projection This was the call,.. > -s ....../threebands.tiff -f 2 -n 4 -t "200,200" -w and the result was surprising to me.. First i still get the warning 'Grid geometry has been adjusted for coverage "threebands".'. but the NullPointerException is gone... Secondly: It seems to go on for ever!! :-( > WARNUNG: Grid geometry has been adjusted for coverage "threebands". > 14.08.2007 14:41:48 Resample doOperation > WARNUNG: Grid geometry has been adjusted for coverage "threebands". > 14.08.2007 14:41:56 Resample doOperation > WARNUNG: Grid geometry has been adjusted for coverage "threebands". > 14.08.2007 14:42:05 Resample doOperation > WARNUNG: Grid geometry has been adjusted for coverage "threebands". > 14.08.2007 14:42:13 Resample doOperation > WARNUNG: Grid geometry has been adjusted for coverage "threebands". > 14.08.2007 14:42:22 Resample doOperation > WARNUNG: Grid geometry has been adjusted for coverage "threebands". > 14.08.2007 14:42:31 Resample doOperation > WARNUNG: Grid geometry has been adjusted for coverage "threebands". I cancel it after a while, because all the mosaic_NN.tiff files it creates in pyramid/0 look the same in openev !!! In openEv i see the full extends of the original image and they all have the original image size: 6970x8000 .. BUT gdalinfo is reporting different Corner Coordinates for each mosaic_XX.tiff !! This for example if mosaic_11.tiff: > gdalinfo mosaic_11.tiff > Driver: GTiff/GeoTIFF > Files: mosaic_11.tiff > Size is 6970, 8000 > Coordinate System is: > PROJCS["WGS 84 / UTM zone 31N", > GEOGCS["WGS 84", > DATUM["WGS_1984", > SPHEROID["WGS 84",6378137,298.2572235629972, > AUTHORITY["EPSG","7030"]], > AUTHORITY["EPSG","6326"]], > PRIMEM["Greenwich",0], > UNIT["degree",0.0174532925199433], > AUTHORITY["EPSG","4326"]], > PROJECTION["Transverse_Mercator"], > PARAMETER["latitude_of_origin",0], > PARAMETER["central_meridian",3], > PARAMETER["scale_factor",0.9996], > PARAMETER["false_easting",500000], > PARAMETER["false_northing",0], > UNIT["metre",1, > AUTHORITY["EPSG","9001"]], > AUTHORITY["EPSG","32631"]] > Origin = (382799.335957741190214,943220.920265757478774) > Pixel Size = (28.561334289813402,-28.567687499999884) > Metadata: > AREA_OR_POINT=Point > TIFFTAG_XRESOLUTION=1 > TIFFTAG_YRESOLUTION=1 > TIFFTAG_RESOLUTIONUNIT=1 (unitless) > Image Structure Metadata: > COMPRESSION=JPEG > Corner Coordinates: > Upper Left ( 382799.336, 943220.920) ( 1d56'6.36"E, 8d31'53.48"N) > Lower Left ( 382799.336, 714679.420) ( 1d56'24.40"E, 6d27'52.38"N) > Upper Right ( 581871.836, 943220.920) ( 3d44'38.11"E, 8d31'56.18"N) > Lower Right ( 581871.836, 714679.420) ( 3d44'25.51"E, 6d27'54.41"N) > Center ( 482335.586, 828950.170) ( 2d50'23.62"E, 7d29'57.53"N) > Band 1 Block=256x256 Type=Byte, ColorInterp=Red > Band 2 Block=256x256 Type=Byte, ColorInterp=Green > Band 3 Block=256x256 Type=Byte, ColorInterp=Blue > Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha I suppose something is going wrong here... As a last try i gdal_warped the threebands.tiff to EPSG:4326, and tried it again... This time i don't get any output for a long time, and 1400 images are created in the 0-directory.. they have different file sizes and look like correct tiles in openev. Once this first directory seems to be processed, i get some messages and a new sad exception... this message is counting up all 1399 tiffs... > 14.08.2007 14:58:59 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 29.97860199714693 > attached message is: Now indexing file iff/pyramid/0/mo > 14.08.2007 14:58:59 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 29.885877318116975 > attached message is: Done with file > /home/stefan/Desktop/NoSync/bigGeoTiff/pyramid/0/mosaic_1399.tiff and then it caches with this... > 14.08.2007 14:58:59 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 29.98573466476462 > attached message is: Now indexing file iff/pyramid/0 > 14.08.2007 14:58:59 it.geosolutions.utils.imagemosaic.MosaicIndexBuilder > run > INFO: Skipped file > /home/stefan/Desktop/NoSync/bigGeoTiff/pyramid/0/error.txt.lck:No ImageIO > readeres avalaible. 14.08.2007 14:58:59 > it.geosolutions.utils.imagepyramid.PyramidBuilder getNotification > INFO: > Progress is at 29.885877318116975 > attached message is: Skipped file > /home/stefan/Desktop/NoSync/bigGeoTiff/pyramid/0/error.txt.lck:No ImageIO > readeres avalaible. 14.08.2007 14:58:59 > it.geosolutions.utils.imagepyramid.PyramidBuilder getNotification > INFO: > Progress is at 29.99286733238231 > attached message is: Now indexing file iff/pyram > 14.08.2007 14:58:59 it.geosolutions.utils.imagemosaic.MosaicIndexBuilder > run > INFO: Skipped file > /home/stefan/Desktop/NoSync/bigGeoTiff/pyramid/0/error.txt:No ImageIO > readeres avalaible. 14.08.2007 14:58:59 > it.geosolutions.utils.imagepyramid.PyramidBuilder getNotification > INFO: > Progress is at 29.892938659058487 > attached message is: Skipped file > /home/stefan/Desktop/NoSync/bigGeoTiff/pyramid/0/error.txt:No ImageIO > readeres avalaible. 14.08.2007 14:59:00 > it.geosolutions.utils.imagepyramid.PyramidBuilder getNotification > INFO: > Progress is at 29.990000000000002 > attached message is: Creating final properties file > 14.08.2007 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 30.0 > attached message is: Done!!! > 14.08.2007 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 30.0 > attached message is: Requested scale factor is 2 > 14.08.2007 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 30.0 > attached message is: Acquiring a mosaic reader to mosaic > /home/stefan/Desktop/NoSync/bigGeoTiff/pyramid/0/pyramid.shp 14.08.2007 > 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder getNotification > INFO: Progress is at 30.0 > attached message is: Original envelope is [01°20,4'E 08°28,7'N , 03°09,6'E > 10°32,9'N] 14.08.2007 14:59:00 > it.geosolutions.utils.imagepyramid.PyramidBuilder getNotification > INFO: > Progress is at 30.0 > attached message is: Original range is GeneralGridRange[0..7035, 0..8000] > 14.08.2007 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 30.0 > attached message is: New dimension is (W,H)==(3517.5,4000.0) > 14.08.2007 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 30.0 > attached message is: New matrix dimension is (cols,rows)==(17,20) > 14.08.2007 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder > getNotification > INFO: Progress is at 30.0 > attached message is: Preparing tile (col,row)==(0,0) to file > /home/stefan/Desktop/NoSync/bigGeoTiff/pyramid/2/mosaic_0.tiff 14.08.2007 > 14:59:00 it.geosolutions.utils.imagepyramid.PyramidBuilder getNotification > INFO: Progress is at 30.0 > attached message is: Reading with grid envelope [01°20,4'E 08°28,7'N , > 01°26,5'E 08°34,9'N] Exception in thread "PyramidBuilder" > java.lang.IllegalArgumentException: operation "ImageRead" requires > parameter at index 0 to be non-null. at > javax.media.jai.JAI.createNS(JAI.java:1091) > at javax.media.jai.JAI.create(JAI.java:977) > at javax.media.jai.JAI.create(JAI.java:1399) > at > org.geotools.gce.imagemosaic.ImageMosaicReader.loadRequestedTiles(ImageMosa >icReader.java:845) at > org.geotools.gce.imagemosaic.ImageMosaicReader.loadTiles(ImageMosaicReader. >java:644) at > org.geotools.gce.imagemosaic.ImageMosaicReader.read(ImageMosaicReader.java: >473) at > it.geosolutions.utils.imagepyramid.PyramidLayerBuilder.run(PyramidLayerBuil >der.java:686) at > it.geosolutions.utils.imagepyramid.PyramidBuilder.buildNewLayer(PyramidBuil >der.java:633) at > it.geosolutions.utils.imagepyramid.PyramidBuilder.run(PyramidBuilder.java:5 >64) at java.lang.Thread.run(Thread.java:619) The files created are 1400 tiffs, and -rw-r--r-- 1 stefan stefan 349K 2007-08-14 14:59 pyramid.dbf -rw-r--r-- 1 stefan stefan 316 2007-08-14 14:58 pyramid.prj -rw-r--r-- 1 stefan stefan 224 2007-08-14 14:59 pyramid.properties -rw-r--r-- 1 stefan stefan 187K 2007-08-14 14:59 pyramid.shp -rw-r--r-- 1 stefan stefan 12K 2007-08-14 14:59 pyramid.shx in the 0-directory. The directory "2" is created but empty. This seems to be the furthest that i get: With three bands, and EPSG:4326. Dear Andrea.. i am using 2.3.2, but i can swicth to 2.3.x svn if you wan't me to.. Using just three bands is not problem for me, but Image Pyramids should not be limited to EPSG 4326, or? I am hoping for some tipps about what i might be doing wrong, and i will cheerly carry out any further testing that you recommend me.. Thanks in advance.. Stefan Krüger -- Stefan Krüger Straßburger Weg 26 53113 Bonn email [EMAIL PROTECTED] phone 0228 9437868 web www.wikisquare.de jabber [EMAIL PROTECTED] skype alfonx PGPKey 51B576FD WER MASSENMAILS OHNE BCC SCHREIBT VERSTOESST GEGEN DEN DATENSCHUTZ! ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users