[Geoserver-users] Newbie: Problem building pyramid

Hi all,

I am trying to load in the Nasa blue marble layer using the tutorial http://docs.codehaus.org/display/GEOSDOC/Load+NASA+Blue+Marble+Data?focusedCommentId=74672#comment-74672

I have successfully created the TIFF

 - (gdal_translate -of GTiff -projwin -180 0 -90 -90 world-topo-bathy-200408-3x86400x43200.ecw bluemarble_00.tiff)

But fail whenever I try and execute the:

Main Class: it.geosolutions.utils.imagepyramid.PyramidBuilder
Arguments:
    Program Arguments: -s path/to/tiffFile.tiff -f 2 -n 4 -t "1024,1024" -w
    VM Arguments: -Xmx512m

With a 

Mar 16, 2007 9:21:25 AM it.geosolutions.utils.imagepyramid.PyramidBuilder exceptionOccurred

SEVERE: An error occurred during processing

java.io.IOException: Unable to instantiate a reader for this coverage (C:\Program Files\FWTools1.1.3\bin\test.jpg)

at it.geosolutions.utils.imagepyramid.PyramidBuilder.run(PyramidBuilder.java:491)

at java.lang.Thread.run(Thread.java:595)



The code executing is:
        AbstractGridCoverage2DReader inReader = (AbstractGridCoverage2DReader) format
                       .getReader(inputLocation);
        if (inReader == null) {
               String message = "Unable to instantiate a reader for this coverage (" + inputLocation + ")";
               fireException(message, 0, new IOException(message));
               return;
        }

Note that I have added some extra debug information and the Format the pyramid builder is using is 
  org.geotools.data.coverage.grid.UnknownFormat

When I do a gdal_translate to PNG and to JPEG I can successfully open and view the files using GIMP, and again Pyramid builder returns unknown format, and fails with the same error.  I am not sure if the format type is ever known though…

My environment is Windows XP, Java 1.5 and I’m using [http://svn.geotools.org/geotools/branches/2.3.x](http://svn.geotools.org/geotools/branches/2.3.x) retrieved yesterday.

I have tried FWTools 1.2.3, 1.2.2 and 1.1.3 to see if maybe it is doing something funny to the file, but always with the same error.

I’d appreciate any help with building pyramids and am happy to try anything anyone can suggest at this point!

Many thanks,

Tim

Tim Robertson ha scritto:

Hi all,

I am trying to load in the Nasa blue marble layer using the tutorial http://docs.codehaus.org/display/GEOSDOC/Load+NASA+Blue+Marble+Data?focusedCommentId=74672#comment-74672

I have successfully created the TIFF

- (gdal_translate -of GTiff -projwin -180 0 -90 -90 world-topo-bathy-200408-3x86400x43200.ecw bluemarble_00.tiff)

But fail whenever I try and execute the:

Main Class: it.geosolutions.utils.imagepyramid.PyramidBuilder

Arguments:

Program Arguments: -s path/to/tiffFile.tiff -f 2 -n 4 -t "1024,1024" -w

VM Arguments: -Xmx512m

With a

Mar 16, 2007 9:21:25 AM it.geosolutions.utils.imagepyramid.PyramidBuilder exceptionOccurred

SEVERE: An error occurred during processing

_java.io.IOException_: Unable to instantiate a reader for this coverage (C:\Program Files\FWTools1.1.3\bin\test.jpg)

Pyramid builder can open only the formats that geotools can open, and only if the
appropriate jars are in the classpath.
If you want to create a pyramid, I suggest to use the tiff file generated
from gdal conversion.
Now, in your case, it seems you're passing a path to your tiff file, and pb complains
it cannot open the jpeg one... how is that? Bug in pyramid builder, or in the command
line that invoked it?? :slight_smile:
Cheers
Andrea

Hi Andrea

Many thanks for the reply. I'm seeing it fail with jpg, png, and tiff
files, but it is the jpg one I show on the log below - The tiff bit was
just copied from the tutorial. It is using the correct Tiff file when I
call it that way.

Can you please tell me how to get the jars on the classpath for TIFF pyramid
builing? Is this not done with Maven? I am running in eclipse...

Incidentally:
  GridFormatFinder.getAvailableFormats();

Gives:
[org.geotools.gce.imagepyramid.ImagePyramidFormatFactory@anonymised.com,
org.geotools.gce.image.WorldImageFormatFactory@anonymised.com,
org.geotools.gce.geotiff.GeoTiffFormatFactorySpi@anonymised.com,
org.geotools.gce.imagemosaic.ImageMosaicFormatFactory@anonymised.com,
org.geotools.gce.arcgrid.ArcGridFormatFactory@anonymised.com]

Many thanks,

Tim

-----Original Message-----
From: aaime [mailto:aaime@anonymised.com]
Sent: Friday, March 16, 2007 1:23 PM
To: Tim Robertson
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Newbie: Problem building pyramid

Tim Robertson ha scritto:

Hi all,

I am trying to load in the Nasa blue marble layer using the tutorial

http://docs.codehaus.org/display/GEOSDOC/Load+NASA+Blue+Marble+Data?focusedC
ommentId=74672#comment-74672

I have successfully created the TIFF

- (gdal_translate -of GTiff -projwin -180 0 -90 -90

world-topo-bathy-200408-3x86400x43200.ecw bluemarble_00.tiff)

But fail whenever I try and execute the:

Main Class: it.geosolutions.utils.imagepyramid.PyramidBuilder

Arguments:

Program Arguments: -s path/to/tiffFile.tiff -f 2 -n 4 -t "1024,1024" -w

VM Arguments: -Xmx512m

With a

Mar 16, 2007 9:21:25 AM it.geosolutions.utils.imagepyramid.PyramidBuilder

exceptionOccurred

SEVERE: An error occurred during processing

_java.io.IOException_: Unable to instantiate a reader for this coverage

(C:\Program Files\FWTools1.1.3\bin\test.jpg)

Pyramid builder can open only the formats that geotools can open, and only
if the
appropriate jars are in the classpath.
If you want to create a pyramid, I suggest to use the tiff file generated
from gdal conversion.
Now, in your case, it seems you're passing a path to your tiff file, and pb
complains
it cannot open the jpeg one... how is that? Bug in pyramid builder, or in
the command
line that invoked it?? :slight_smile:
Cheers
Andrea

Tim Robertson ha scritto:

Hi Andrea

Many thanks for the reply. I'm seeing it fail with jpg, png, and tiff
files, but it is the jpg one I show on the log below - The tiff bit was
just copied from the tutorial. It is using the correct Tiff file when I
call it that way.

Can you please tell me how to get the jars on the classpath for TIFF pyramid
builing? Is this not done with Maven? I am running in eclipse...

Incidentally:
  GridFormatFinder.getAvailableFormats();

Gives:
[org.geotools.gce.imagepyramid.ImagePyramidFormatFactory@anonymised.com,
org.geotools.gce.image.WorldImageFormatFactory@anonymised.com,
org.geotools.gce.geotiff.GeoTiffFormatFactorySpi@anonymised.com,
org.geotools.gce.imagemosaic.ImageMosaicFormatFactory@anonymised.com,
org.geotools.gce.arcgrid.ArcGridFormatFactory@anonymised.com]

Oh, ok. Then you just have to make sure the tiff file is a proper geotiff file, and not a non georeferenced image. Otherwise, you have
to georeference the file adding a .tfw and a .prj file.

The tutorial starts from an ecw image, which is georeferenced, and
then makes you convert it to a geotiff using gdal.
Or are you speaking about the trail starting with png files? There
you have to add a .pgw and a .prj to provide georeferencing to the
starting dumb image.

Cheers
Andrea

Hi Andrea,

Thanks again, I am starting with the ecw and have been following the
tutorial extactly as it is shown... thus they showuld be geo tiffs.
The weird thing is the tiffs generated cant be opened with GIMP either.
To be honest, I know nothing about tiffs - shown gimp be able to open them
anyway?

Thanks Tim

Tim Robertson ha scritto:

Hi Andrea

Many thanks for the reply. I'm seeing it fail with jpg, png, and tiff
files, but it is the jpg one I show on the log below - The tiff bit was
just copied from the tutorial. It is using the correct Tiff file when I
call it that way.

Can you please tell me how to get the jars on the classpath for TIFF
pyramid
builing? Is this not done with Maven? I am running in eclipse...

Incidentally:
  GridFormatFinder.getAvailableFormats();

Gives:
[org.geotools.gce.imagepyramid.ImagePyramidFormatFactory@anonymised.com,
org.geotools.gce.image.WorldImageFormatFactory@anonymised.com,
org.geotools.gce.geotiff.GeoTiffFormatFactorySpi@anonymised.com,
org.geotools.gce.imagemosaic.ImageMosaicFormatFactory@anonymised.com,
org.geotools.gce.arcgrid.ArcGridFormatFactory@anonymised.com]

Oh, ok. Then you just have to make sure the tiff file is a proper
geotiff file, and not a non georeferenced image. Otherwise, you have
to georeference the file adding a .tfw and a .prj file.

The tutorial starts from an ecw image, which is georeferenced, and
then makes you convert it to a geotiff using gdal.
Or are you speaking about the trail starting with png files? There
you have to add a .pgw and a .prj to provide georeferencing to the
starting dumb image.

Cheers
Andrea

trobertson@anonymised.com ha scritto:

Hi Andrea,

Thanks again, I am starting with the ecw and have been following the
tutorial extactly as it is shown... thus they showuld be geo tiffs.
The weird thing is the tiffs generated cant be opened with GIMP either. To be honest, I know nothing about tiffs - shown gimp be able to open them
anyway?

It should, but probably it's not able to handle such big files.
Anyways, I created the bluemarble_00.tiff file following the
guide, and it shows just fine in Goeserver (it's slow as hell, but
that's normal given that image is striped and does not have overviews).

Have you tried opening the file with Geoserver? In the meantime, I'll
follow the tutorial fully to check what's going on.

Cheers
Andrea