[Geoserver-users] cascading WMS rendering problem

Hello,

I have added a cascading WMS data store to my GeoServer, and all of the remote WMS layers are appearing/loading, but I am having rendering problems.

The rendered map tiles should look like this:
http://loscabosproperties.mx/geoserver/1.png

But instead they look like this:
http://loscabosproperties.mx/geoserver/2.png

A live example can be seen here(need to zoom way-in to see the improper image tile rendering as is shown in the above 2.png image):
http://173.203.195.77:8080/geoserver_2.1b1/wms?service=WMS&version=1.1.0&request=GetMap&layers=loscabos:catastro&styles=&bbox=-110.122,22.825,-109.409,23.688&width=423&height=512&srs=EPSG:4326&format=application/openlayers

The original WMS server I am connecting to is a MapServer and is here:
http://www.catastroloscabos.gob.mx/cgi-bin/mapserv.fcgi?map=/home/juribe/webcatastro/catastro.map&

In uDig, when I connect to the original WMS source, I have to change the uDig ‘Basic WMS Renderer’ settings so that ‘image/jpeg’ is first on the list, otherwise the aforementioned source renders improperly the same way it is rendering via the GeoServer Cascading WMS. So how does one correct this in GeoServer so the image tiles render properly?

Thanks,

On Sat, Jan 22, 2011 at 1:00 AM, Eric Jarvies <7@anonymised.com> wrote:

Hello,

I have added a cascading WMS data store to my GeoServer, and all of the remote WMS layers are appearing/loading, but I am having rendering problems.

The rendered map tiles should look like this:
http://loscabosproperties.mx/geoserver/1.png

But instead they look like this:
http://loscabosproperties.mx/geoserver/2.png

A live example can be seen here(need to zoom way-in to see the improper image tile rendering as is shown in the above 2.png image):
http://173.203.195.77:8080/geoserver_2.1b1/wms?service=WMS&version=1.1.0&request=GetMap&layers=loscabos:catastro&styles=&bbox=-110.122,22.825,-109.409,23.688&width=423&height=512&srs=EPSG:4326&format=application/openlayers

The original WMS server I am connecting to is a MapServer and is here:
http://www.catastroloscabos.gob.mx/cgi-bin/mapserv.fcgi?map=/home/juribe/webcatastro/catastro.map&

In uDig, when I connect to the original WMS source, I have to change the uDig ‘Basic WMS Renderer’ settings so that ‘image/jpeg’ is first on the list, otherwise the aforementioned source renders improperly the same way it is rendering via the GeoServer Cascading WMS. So how does one correct this in GeoServer so the image tiles render properly?

GeoServer tries to cascade using “image/png” as the format but that format is not supported,
a “image/png; image/png; mode=24bit” is reported to be available instead which GeoServer
does not understand.
Since it does not find that it just picks the first one in the capabilities, which happens to
be “image/gif”, the images you’re getting are actually the ones from mapserver as it
draws them in gif format.

Have a look at the cascaded output:
http://173.203.195.77:8080/geoserver_2.1b1/wms?LAYERS=loscabos:catastro&STYLES=&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=-109.6805230885,23.065605232237,-109.67913053708,23.067290779113&WIDTH=423&HEIGHT=512

and the same request against MapServer in GIF format:
http://www.catastroloscabos.gob.mx/cgi-bin/mapserv.fcgi?map=/home/juribe/webcatastro/catastro.map&LAYERS=catastro&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=-109.6805230885,23.065605232237,-109.67913053708,23.067290779113&WIDTH=423&HEIGHT=512&FORMAT=image/gif

It would be nice if GS allowed the user to choose which format to support for cascading, unfortunately
for the moment we don’t have that setting.

We have some guessing code that already tries “image/png”, “image/png24”, “png”, “png24”, I’ve
just added the MapServer “image/png; mode=24bit” one to the mix and now GS can cascade that
server without odd visual effects.
(http://jira.codehaus.org/browse/GEOT-3393)

As for adding the ability to choose the cascading format, that’s requires more time than I have now,
hopefully someone else will chime in and add that too.
In a perfect world it would be nice to have the admin setup two cascading formats, a transparent
one to be used when the wms layer is used as an overlay, and one that does not support
transparency/translucency to be used when the layer is used as a base layer: that would allow
to use JPEG or PNG 8 bits for cascading the base layers, which normally produces more compact files
(and would thus speed up cascading).

Cheers
Andrea


Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf


On Jan 22, 2011, at 8:22 AM, Andrea Aime wrote:

On Sat, Jan 22, 2011 at 1:00 AM, Eric Jarvies <7@anonymised.com> wrote:

Hello,

I have added a cascading WMS data store to my GeoServer, and all of the remote WMS layers are appearing/loading, but I am having rendering problems.

The rendered map tiles should look like this:
http://loscabosproperties.mx/geoserver/1.png

But instead they look like this:
http://loscabosproperties.mx/geoserver/2.png

A live example can be seen here(need to zoom way-in to see the improper image tile rendering as is shown in the above 2.png image):
http://173.203.195.77:8080/geoserver_2.1b1/wms?service=WMS&version=1.1.0&request=GetMap&layers=loscabos:catastro&styles=&bbox=-110.122,22.825,-109.409,23.688&width=423&height=512&srs=EPSG:4326&format=application/openlayers

The original WMS server I am connecting to is a MapServer and is here:
http://www.catastroloscabos.gob.mx/cgi-bin/mapserv.fcgi?map=/home/juribe/webcatastro/catastro.map&

In uDig, when I connect to the original WMS source, I have to change the uDig ‘Basic WMS Renderer’ settings so that ‘image/jpeg’ is first on the list, otherwise the aforementioned source renders improperly the same way it is rendering via the GeoServer Cascading WMS. So how does one correct this in GeoServer so the image tiles render properly?

GeoServer tries to cascade using “image/png” as the format but that format is not supported,
a “image/png; image/png; mode=24bit” is reported to be available instead which GeoServer
does not understand.
Since it does not find that it just picks the first one in the capabilities, which happens to
be “image/gif”, the images you’re getting are actually the ones from mapserver as it
draws them in gif format.

Have a look at the cascaded output:
http://173.203.195.77:8080/geoserver_2.1b1/wms?LAYERS=loscabos:catastro&STYLES=&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=-109.6805230885,23.065605232237,-109.67913053708,23.067290779113&WIDTH=423&HEIGHT=512

and the same request against MapServer in GIF format:
http://www.catastroloscabos.gob.mx/cgi-bin/mapserv.fcgi?map=/home/juribe/webcatastro/catastro.map&LAYERS=catastro&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=-109.6805230885,23.065605232237,-109.67913053708,23.067290779113&WIDTH=423&HEIGHT=512&FORMAT=image/gif

It would be nice if GS allowed the user to choose which format to support for cascading, unfortunately
for the moment we don’t have that setting.

We have some guessing code that already tries “image/png”, “image/png24”, “png”, “png24”, I’ve
just added the MapServer “image/png; mode=24bit” one to the mix and now GS can cascade that
server without odd visual effects.
(http://jira.codehaus.org/browse/GEOT-3393)

Thanks Andrea!

One thing I am unclear on… you indicated ‘png’ instead of 'jpg… I was under the impression that particular layer needs to render as jpeg.

How would I go about updating my GeoServer installation to include this change? Do I need to do a complete install of 2.7-RC1 or can I simply grab the revised doc and drop it into my existing GeoServer installation?

As for adding the ability to choose the cascading format, that’s requires more time than I have now,
hopefully someone else will chime in and add that too.
In a perfect world it would be nice to have the admin setup two cascading formats, a transparent
one to be used when the wms layer is used as an overlay, and one that does not support
transparency/translucency to be used when the layer is used as a base layer: that would allow
to use JPEG or PNG 8 bits for cascading the base layers, which normally produces more compact files
(and would thus speed up cascading).

Yes, these would be good Menu options/features to have.

Cheers
Andrea


Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf


On Sat, Jan 22, 2011 at 8:59 PM, Eric Jarvies <7@anonymised.com> wrote:

Thanks Andrea!

One thing I am unclear on… you indicated ‘png’ instead of 'jpg… I was under the impression that particular layer needs to render as jpeg.

One thing is what format GeoServer encodes the output into, and another is the format used for cascading.
In general the two are different as the cascaded layer might have to be merged with other layers,
either as the base layer of the stack, or in the middle.
Right now we have only one code path, so it has to care for the most complex case, which is merging
the layer in the middle, thus we use a cascading format that supports transparency and translucency,
parse the response, and encode it back in the output format.

For the case in which GS is just playing the middleman, with no local reprojection, it would indeed be
nice to have GS play the pure proxy and just forward the response it got from the other server as is.
We don’t have it now, but hopefully someone in the future will work or sponsor that as well.

How would I go about updating my GeoServer installation to include this change? Do I need to do a complete install of 2.7-RC1 or can I simply grab the revised doc and drop it into my existing GeoServer installation?

Hum… I think you can get along by just grabbing the gt-wms-*.jar file from a recent nightly build
(today’s or tomorrow’s), stop geoserver, replace it in the old install, and restart

Cheers
Andrea


Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf