[Geoserver-devel] ColorMapped Image and WAS(Re: [Geotools-devel] Geotiff with no Geokey directory problem)

Ciao Andrea (both actually!!!),
from the information you send us I can spot two problems:

1>A tiff file by itself is not enough for working with georeferenced
data unless it is a geotiff, because you have no CRS (for which you
need a prj file) and no georeferencing (for which you need a wold
file). The point now is, what is a geotiff? Well the specification
more or less states that a geotiff is a tiff with additional tags
describing the model space (coordinate reference system) and the
relationship between the latter and the raster space (usually an
affine transformation or some ground control points for doing
warping). In your case it seemed that you did not have a real geotiff
and at the same time you were missing the prj and the world file.

Then you provided a world file but no prj file, hence to proceed we
assume wgs84 which is the most common and we print a warning message
saying, hey no PRJ provided.

2>The second error you are seeing is a known error that has been
fixed. I guess your image is not rgb or grayscale but it has a palette
(or a color map as you like) which was not well supported in geotools
2.3.0 due to interpolation issues.
I guess you are using GeoServer 1.5 beta with geotools 2.3.0. Well
good news is this, the actual versions of geotools 2.3.1-snapshot and
geoserver 1.5.0-snapshot DO support colormapped tiffs and geotiffs
with no problems.

<<Conclusion>>
The best thing to do are as follows:

1>provide, if you can and wish to, a sample image since I am
collecting a lot of test-cases to test the fixes we introduced. This
would of GREAT help to us.

2>build geotools 2.3.x branch and geoserver 1.5.x breanch from code
(the procedure is pretty easy and we can guide you through it). If you
are not willing to take this path, you have to be patient a couple of
weeks and wait for the next beta of geoserver 1.5 which will have a
tons of improvements.

Regards,
Simone.

On 1/20/07, Andrea Aime <aaime@anonymised.com> wrote:

Andrea Antonello ha scritto:
> Thanks Andrea,
> this is great news!
>
> In fact now starts to read it, but not without problem.
> The geotiff in fact has a world file. It should be a "normal" file
> (whatever that could mean).
>
> Jan 20, 2007 12:01:46 PM org.geotools.renderer.lite.StreamingRenderer renderRaster
> WARNING: The number of image bands (3) differs from the number of supplied 'SampleDimension' objects (1).
> java.lang.IllegalArgumentException: The number of image bands (3) differs from the number of supplied 'SampleDimension' objects (1).
> at org.geotools.coverage.grid.Grid2DSampleDimension.create(Grid2DSampleDimension.java:118)
> at org.geotools.coverage.grid.GridCoverage2D.<init>(GridCoverage2D.java:269)
> at org.geotools.coverage.processing.operation.FilteredSubsampledGridCoverage2D.<init>(FilteredSubsampledGridCoverage2D.java:60)
> at org.geotools.coverage.processing.operation.FilteredSubsampledGridCoverage2D.create(FilteredSubsampledGridCoverage2D.java:115)
> at org.geotools.coverage.processing.operation.FilteredSubsample.doOperation(FilteredSubsample.java:133)
> at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.filteredSubsample(GridCoverageRenderer.java:793)
> at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:455)
> at org.geotools.renderer.lite.StreamingRenderer.renderRaster(StreamingRenderer.java:1732)
> at org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:1586)
> at org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:1530)
> at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1472)
> at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:543)
> at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:406)
>
> The geotiff is a "Carta Tecnica Provinciale", which you should probably
> know and have dealth with.

Unfortunately not. I never played with raster italian data, believe it
or not, my data experience is only with freely available USA data.
Can you provide us a sample by private mail? Also, which version of
Geotools are you using? I suggest to checkout and compile 2.3.x branch
if you haven't already done so. Raster support in 2.2.x is rather poor,
and quite a bit of improvements got in 2.3.x after the 2.3.0 release.

> PS: another question: the projection is taken by default in lat/long, if I do not
> supply a .prj file with the info in it. Is that the right approach? I've
> never seen geotiffs or jpegs with the projection file.

Well, since there is no way to tell whic CRS is it, it's a guess
that's as good as any other imho. Most data coming from NASA and similar
sources in in fact unprojected WGS84 data.

Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

--
-------------------------------------------------------
Eng. Simone Giannecchini
President /CEO GeoSolutions

http://www.geo-solutions.it

-------------------------------------------------------

Ciao Simone, Andrea,

Ciao Andrea (both actually!!!),
from the information you send us I can spot two problems:

1>A tiff file by itself is not enough for working with georeferenced
data unless it is a geotiff, because you have no CRS (for which you
need a prj file) and no georeferencing (for which you need a wold
file). The point now is, what is a geotiff? Well the specification
more or less states that a geotiff is a tiff with additional tags
describing the model space (coordinate reference system) and the
relationship between the latter and the raster space (usually an
affine transformation or some ground control points for doing
warping). In your case it seemed that you did not have a real geotiff
and at the same time you were missing the prj and the world file.

Then you provided a world file but no prj file, hence to proceed we
assume wgs84 which is the most common and we print a warning message
saying, hey no PRJ provided.

2>The second error you are seeing is a known error that has been
fixed. I guess your image is not rgb or grayscale but it has a palette
(or a color map as you like) which was not well supported in geotools
2.3.0 due to interpolation issues.

In fact I'm just playing around with the geotools libraries 'cause I
found finally time to go throught the news and enhancements all you guys
brought into it. Here I can add that I'm amazed, you guys made an
incredible work! The coverage is the part that most interests me, since
in JGrass we are having big changes in near future, so I want to see how
to deal with compatibility. We have almost only raster elaborations...

However: I assume that my map is a "real" geotiff, at least
so the pubblic administration of were I live says so :slight_smile: It is an ugly
black and white map, in fact it is paletted.

I guess you are using GeoServer 1.5 beta with geotools 2.3.0. Well
good news is this, the actual versions of geotools 2.3.1-snapshot and
geoserver 1.5.0-snapshot DO support colormapped tiffs and geotiffs
with no problems.

That is great to hear :slight_smile:

<<Conclusion>>
The best thing to do are as follows:

1>provide, if you can and wish to, a sample image since I am
collecting a lot of test-cases to test the fixes we introduced. This
would of GREAT help to us.

I'll do that.

2>build geotools 2.3.x branch and geoserver 1.5.x breanch from code
(the procedure is pretty easy and we can guide you through it). If you
are not willing to take this path, you have to be patient a couple of
weeks and wait for the next beta of geoserver 1.5 which will have a
tons of improvements.

Alright, since I would love to see things now, I will try that.
I'll come back to your help offer if I fall into a swamp.

Best regards,
Andrea

Regards,
Simone.

On 1/20/07, Andrea Aime <aaime@anonymised.com> wrote:
>Andrea Antonello ha scritto:
>> Thanks Andrea,
>> this is great news!
>>
>> In fact now starts to read it, but not without problem.
>> The geotiff in fact has a world file. It should be a "normal" file
>> (whatever that could mean).
>>
>> Jan 20, 2007 12:01:46 PM org.geotools.renderer.lite.StreamingRenderer
>renderRaster
>> WARNING: The number of image bands (3) differs from the number of
>supplied 'SampleDimension' objects (1).
>> java.lang.IllegalArgumentException: The number of image bands (3)
>differs from the number of supplied 'SampleDimension' objects (1).
>> at
>org.geotools.coverage.grid.Grid2DSampleDimension.create(Grid2DSampleDimension.java:118)
>> at
>org.geotools.coverage.grid.GridCoverage2D.<init>(GridCoverage2D.java:269)
>> at
>org.geotools.coverage.processing.operation.FilteredSubsampledGridCoverage2D.<init>(FilteredSubsampledGridCoverage2D.java:60)
>> at
>org.geotools.coverage.processing.operation.FilteredSubsampledGridCoverage2D.create(FilteredSubsampledGridCoverage2D.java:115)
>> at
>org.geotools.coverage.processing.operation.FilteredSubsample.doOperation(FilteredSubsample.java:133)
>> at
>org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.filteredSubsample(GridCoverageRenderer.java:793)
>> at
>org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:455)
>> at
>org.geotools.renderer.lite.StreamingRenderer.renderRaster(StreamingRenderer.java:1732)
>> at
>org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:1586)
>> at
>org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:1530)
>> at
>org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1472)
>> at
>org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:543)
>> at
>org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:406)
>>
>>
>> The geotiff is a "Carta Tecnica Provinciale", which you should probably
>> know and have dealth with.
>
>Unfortunately not. I never played with raster italian data, believe it
>or not, my data experience is only with freely available USA data.
>Can you provide us a sample by private mail? Also, which version of
>Geotools are you using? I suggest to checkout and compile 2.3.x branch
>if you haven't already done so. Raster support in 2.2.x is rather poor,
>and quite a bit of improvements got in 2.3.x after the 2.3.0 release.
>
>> PS: another question: the projection is taken by default in lat/long, if
>I do not
>> supply a .prj file with the info in it. Is that the right approach? I've
>> never seen geotiffs or jpegs with the projection file.
>
>Well, since there is no way to tell whic CRS is it, it's a guess
>that's as good as any other imho. Most data coming from NASA and similar
>sources in in fact unprojected WGS84 data.
>
>Cheers
>Andrea
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share
>your
>opinions on IT & business topics through brief surveys - and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Geotools-devel mailing list
>Geotools-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/geotools-devel
>

--
-------------------------------------------------------
Eng. Simone Giannecchini
President /CEO GeoSolutions

http://www.geo-solutions.it

-------------------------------------------------------

--
____________________________________________________________________________
HydroloGIS - Environmental Safety Modelling
Siemens Str. 19 via Siemens
I-39100 Bozen - Bolzano
www.hydrologis.com

Andrea Antonello
Environmental Engineer
PhD Student at www.uniurb.it
JGrass, Free Open Source GIS www.jgrass.org
tel. +39 0471 068065
mobile: +39 328 8497722
fax: +39 36 328 8497722
email: andrea.antonello@anonymised.com

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

Andrea Antonello ha scritto:

Ciao Simone, Andrea,

In fact I'm just playing around with the geotools libraries 'cause I
found finally time to go throught the news and enhancements all you guys
brought into it. Here I can add that I'm amazed, you guys made an
incredible work! The coverage is the part that most interests me, since
in JGrass we are having big changes in near future, so I want to see how
to deal with compatibility. We have almost only raster elaborations...

Aaah, JGrass... as a former GRASS developer (not even a user today, sigh) my pipe dream would be to have a GRASS datastore and a GRASS
raster reader. Point them to the GRASS location and boom, serve all your
data live on the web. Unfortunately I think I'll never manage
to turn them into reality, but it would so cool...

Cheers
Andrea

> In fact I'm just playing around with the geotools libraries 'cause I
> found finally time to go throught the news and enhancements all you guys
> brought into it. Here I can add that I'm amazed, you guys made an
> incredible work! The coverage is the part that most interests me, since
> in JGrass we are having big changes in near future, so I want to see how
> to deal with compatibility. We have almost only raster elaborations...

Aaah, JGrass... as a former GRASS developer (not even a user today,
sigh) my pipe dream would be to have a GRASS datastore and a GRASS
raster reader.

I did that in the past for JGrass and already started to supply to this list the reader.
I have to find the time to have a good look through the coverage
package, to understand how to create the reader and writer, I would be willing to
maintain a binary GRASS raster files reader and writer at some point, honestly. :slight_smile:

Point them to the GRASS location and boom, serve all your
data live on the web. Unfortunately I think I'll never manage
to turn them into reality, but it would so cool...

Why never reality?
What about the vector format? Anyone in mind to do the
reader? We could do an Italian Parigi Dakar of collaborative development
and do some of this :slight_smile:

Ciao
Andrea

Andrea Antonello ha scritto:

In fact I'm just playing around with the geotools libraries 'cause I
found finally time to go throught the news and enhancements all you guys
brought into it. Here I can add that I'm amazed, you guys made an
incredible work! The coverage is the part that most interests me, since
in JGrass we are having big changes in near future, so I want to see how
to deal with compatibility. We have almost only raster elaborations...

Aaah, JGrass... as a former GRASS developer (not even a user today, sigh) my pipe dream would be to have a GRASS datastore and a GRASS
raster reader.

I did that in the past for JGrass and already started to supply to this list the reader.
I have to find the time to have a good look through the coverage
package, to understand how to create the reader and writer, I would be willing to maintain a binary GRASS raster files reader and writer at some point, honestly. :slight_smile:

Now that's great news :slight_smile:
Is it pure java or does it use the GRASSlib? (if GRASSlib is still around, was just being created when I left GRASS).

Point them to the GRASS location and boom, serve all your
data live on the web. Unfortunately I think I'll never manage
to turn them into reality, but it would so cool...

Why never reality?
What about the vector format? Anyone in mind to do the
reader?

It may not be impossible. It's just that when you ate geotools
and geoserver all the week you may not be eager to implement
something that big on the weekend :slight_smile:
It's about keeping a balance between work and private life, especially
when, like me, you are working at home anyways. Well, calling it work
seems strange since I enjoy it so much, but that's the very reason
one has to be cautious and not let it eat all the non sleeping hours
right away.

Cheers
Andrea