[Geoserver-devel] Watermarking GeoServer

Hi all,

I’m working on adding watermarking capabilities to GeoServer, but I
have some doubts that you guys can help me to clarify.

I’m going to add two levels of watermarking:

  • general watermaking, which basically stamps a configurable logo
    onto the final rendered map
  • layer watermarking, which should print undistorted legends for
    each requested layer directly ont the layer tself

Now, the first case is quite simple and easy to achieve, I just need
to slightly modify GeoServer RasterProducers in order to let them draw
the logo into the final image before streaming the latter out.

For the second case several issues arise.
I cannot print all the layer’s legends at the same level, otherwise I
will obtain just an meaningless color fleck.
The only solution we can think about would to printing the legend
onto to the belonging layer, so that if another layer cover it, its
legend will be covered too. In order to get this, I need to modify the
StreamingRenderer behavior and add legend information to the geotools
MapLayer class also.

What do you think about that?
Have you some other ideas or suggestions on this matter?

Thanks all,
Alessio.

Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 349 8227000

http://www.geo-solutions.it


Alessio Fabiani ha scritto:

Hi all,

I'm working on adding watermarking capabilities to GeoServer, but I
have some doubts that you guys can help me to clarify.

I'm going to add two levels of watermarking:
- general watermaking, which basically stamps a configurable logo
onto the final rendered map

Nice. Configurable... how? :slight_smile:

- layer watermarking, which should print undistorted legends for
each requested layer directly ont the layer tself

Like putting the legend you'd get out of GetLegendGraphics right
in the map?

Now, the first case is quite simple and easy to achieve, I just need
to slightly modify GeoServer RasterProducers in order to let them draw
the logo into the final image before streaming the latter out.

For the second case several issues arise.
I cannot print all the layer's legends at the same level, otherwise I
will obtain just an meaningless color fleck.
The only solution we can think about would to printing the legend
onto to the belonging layer, so that if another layer cover it, its
legend will be covered too. In order to get this, I need to modify the
StreamingRenderer behavior and add legend information to the geotools
MapLayer class also.

Hmm... wouldn't it be the same to draw all the legends one after the
other like you do for watermarking?
Yet, I don't understand what you're trying to do... maybe a picture
will allow me to undrestand it better? :slight_smile:

Cheers
Andrea

Hi all,
I attached to the email few screenshots of an experiment I’m doing in GeoServer Branch …
scr-001 and scr-002 show the global Watermarking effect, which is handled directly by GeoServer, while scr-003 and scr-004 show both global and layer Watermarking.
The latter is handled by the StreamingRenderer and GeoTools instead, in order to keep it attached to its own layer, since that would be impossible to do at GeoServer level when getting more than one layer in the same request.

On Dec 13, 2007 7:05 PM, Andrea Aime <aaime@anonymised.com> wrote:

Alessio Fabiani ha scritto:

Hi all,

I’m working on adding watermarking capabilities to GeoServer, but I
have some doubts that you guys can help me to clarify.

I’m going to add two levels of watermarking:

  • general watermaking, which basically stamps a configurable logo
    onto the final rendered map

Nice. Configurable… how? :slight_smile:

  • layer watermarking, which should print undistorted legends for

each requested layer directly ont the layer tself

Like putting the legend you’d get out of GetLegendGraphics right
in the map?

Now, the first case is quite simple and easy to achieve, I just need
to slightly modify GeoServer RasterProducers in order to let them draw
the logo into the final image before streaming the latter out.

For the second case several issues arise.
I cannot print all the layer’s legends at the same level, otherwise I
will obtain just an meaningless color fleck.
The only solution we can think about would to printing the legend
onto to the belonging layer, so that if another layer cover it, its
legend will be covered too. In order to get this, I need to modify the
StreamingRenderer behavior and add legend information to the geotools
MapLayer class also.

Hmm… wouldn’t it be the same to draw all the legends one after the
other like you do for watermarking?
Yet, I don’t understand what you’re trying to do… maybe a picture
will allow me to undrestand it better? :slight_smile:

Cheers
Andrea

Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 349 8227000

http://www.geo-solutions.it


(attachments)

scr-001.jpg
scr-002.jpg
scr-003.jpg
scr-004.jpg

Alessio Fabiani ha scritto:

Hi all,
I attached to the email few screenshots of an experiment I'm doing in GeoServer Branch ...
scr-001 and scr-002 show the global Watermarking effect, which is handled directly by GeoServer, while scr-003 and scr-004 show both global and layer Watermarking.

Very nice, and it's something people have wanted for
a long time. I guess one could use a translucent PNG to get
the same watermarking effect Google uses on its tiles? (a solid watermark is no good for tiled layer)

The latter is handled by the StreamingRenderer and GeoTools instead, in order to keep it attached to its own layer, since that would be impossible to do at GeoServer level when getting more than one layer in the same request.

The picture looks very nice, yet... :slight_smile: am I the only one finding layer level watermarking strange?
It does not seem something that might work with tiling, and I'm not
sure about what would happen if more layers with watermarking are used at the same time.
I'm wondering if using a custom layer legend would not be a client issue instead of a server side concern. Maybe the same kind of legend could
be generated by calling a GetLegendGraphics modified to understand and
process the new raster symbolizer?
What do other people think?

Cheers
Andrea

Layer watermarking is crucial for many WMS clients which does not
support getlegendblahblah calls. It was asked us to implement this
especially for GE.
One thing that we are looking at is to support a few vendor params to
enable/disabel watermarkingo on the fly, which is goo for tiled
clients.
Having more layers watermarking at the same time is acceptable and
depend on the user, really. What will happen is no magic, some legends
may be hidden below some others.

The adive of modifying the GetLegend call, I am not 100% since alessio
is taking care of the implementation, but we should already do that.
If not it will take us 2 seconds to do it :-).

Ciao,
SImone.

On Dec 17, 2007 5:21 PM, Andrea Aime <aaime@anonymised.com> wrote:

Alessio Fabiani ha scritto:
> Hi all,
> I attached to the email few screenshots of an experiment I'm doing in
> GeoServer Branch ...
> scr-001 and scr-002 show the global Watermarking effect, which is
> handled directly by GeoServer, while scr-003 and scr-004 show both
> global and layer Watermarking.

Very nice, and it's something people have wanted for
a long time. I guess one could use a translucent PNG to get
the same watermarking effect Google uses on its tiles? (a solid
watermark is no good for tiled layer)

> The latter is handled by the StreamingRenderer and GeoTools instead, in
> order to keep it attached to its own layer, since that would be
> impossible to do at GeoServer level when getting more than one layer in
> the same request.

The picture looks very nice, yet... :slight_smile: am I the only one finding layer
level watermarking strange?
It does not seem something that might work with tiling, and I'm not
sure about what would happen if more layers with watermarking are used
at the same time.
I'm wondering if using a custom layer legend would not be a client issue
instead of a server side concern. Maybe the same kind of legend could
be generated by calling a GetLegendGraphics modified to understand and
process the new raster symbolizer?
What do other people think?

Cheers
Andrea

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
-------------------------------------------------------
Eng. Simone Giannecchini
President /CEO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 333 8128928

http://www.geo-solutions.it

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

Simone Giannecchini ha scritto:

Layer watermarking is crucial for many WMS clients which does not
support getlegendblahblah calls. It was asked us to implement this
especially for GE.

I see the general issue of dummy clients. For the specific case of GE we are already using GetLegendGraphics to add a legend, try a kml reflector
call and add &legend=true. :slight_smile:

You mentioned that you're adding layer legends at the streaming renderer
level. Does this mean you did modify StreamingRenderer? Is the patch
visible anywhere for people to look at?

Cheers
Andrea

Hi Andrea,

I alredy use the “legend=true” option for the kml reflector, but in my specific case
I need also to show a custom nice legend on dummy clients other than a logo
of the originating center.

If you would like to have a look at the code, look here:

http://svn.geotools.org/geotools/branches/2.4.x_rs

https://svn.codehaus.org/geoserver/branches/1.6.x-Cov-nD

On Dec 17, 2007 5:48 PM, Andrea Aime <aaime@anonymised.com> wrote:

Simone Giannecchini ha scritto:

Layer watermarking is crucial for many WMS clients which does not
support getlegendblahblah calls. It was asked us to implement this
especially for GE.

I see the general issue of dummy clients. For the specific case of GE we
are already using GetLegendGraphics to add a legend, try a kml reflector
call and add &legend=true. :slight_smile:

You mentioned that you’re adding layer legends at the streaming renderer
level. Does this mean you did modify StreamingRenderer? Is the patch
visible anywhere for people to look at?

Cheers
Andrea

Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 349 8227000

http://www.geo-solutions.it