[Geoserver-users] Geoserver ImageMap extension

We want to develop a solution that uses the ImageMap extension provided by Geoserver. We’ve made some tests and we’ve found that this extension does not takes in account labels collision detection. We would like also to have the option to define the type of polygon to use with points, circle or rectangle. Is there anyone with experience using these module that can help us to achieve what we want or anything on the roadmap to do it?

Best regards,

Bruno da Fonseca

Hi Bruno,

···

2014-04-30 18:16 GMT+02:00 Bruno M. Fonseca <bruno.fonseca@anonymised.com>:

We want to develop a solution that uses the ImageMap extension provided by Geoserver. We’ve made some tests and we’ve found that this extension does not takes in account labels collision detection.

You are right, that’s not supported, but in general TextSymbolizer is only used to extract the label to be bound to the imagemap areas.
Would you mean using labels collision to drive areas rendering, or something different? Can you try to explain your use case?

We would like also to have the option to define the type of polygon to use with points, circle or rectangle. Is there anyone with experience using these module that can help us to achieve what we want or anything on the roadmap to do it?

I am the original author, so definitely I can help you. Currently the module has no roadmap because there is no funding to work on it, so I think you have two options:

  • I can help you to understand how to do this change by yourself (it should not be particularly difficult)
  • You can ask to one of the companies giving commercial support to GeoServer to do that for you

For the circle/rectangle rendering of points, you should look at the PointWriter class inside the HTMLImageMapWriter (here: https://github.com/geoserver/geoserver/blob/79c756c2ccf4a2c2ec051cefba393854df95a3c5/src/extension/imagemap/src/main/java/org/vfny/geoserver/wms/responses/map/htmlimagemap/HTMLImageMapWriter.java). I think you need to change the getShape method to return a different shape based on the current mark and also the writeGeometry method.

If you need commercial support you can look here: http://geoserver.org/display/GEOS/Commercial+Support

Regards,
Mauro

On Tue, May 6, 2014 at 9:36 AM, Mauro Bartolomeoli
<mauro.bartolomeoli@anonymised.com> wrote:

I think you need to change the getShape method to return a different shape
based on the current mark and also the writeGeometry method.

I' ve made some changes that maybe can help you (I'm not sure are
integrated to geoserver official repository): http://goo.gl/eP789L

Diego Guidi

Hi Diego,
yes your changes are integrated but currently they are rendering each kind of mark as a circle. They are indeed a good starting point to implement rendering of other kinds of marks (square should be very simple, but we some effort all standard marks could be implemented).
The original version didn’t because when using an imagemap the original shape is not visible and from the user point of view there is not a big difference (in my opinion) in using different shapes, but probably there are use cases in which the shape is important.

Mauro

···

2014-05-06 10:28 GMT+02:00 Diego Guidi <diegoguidi@anonymised.com>:

On Tue, May 6, 2014 at 9:36 AM, Mauro Bartolomeoli
<mauro.bartolomeoli@anonymised.com1107…> wrote:

I think you need to change the getShape method to return a different shape
based on the current mark and also the writeGeometry method.

I’ ve made some changes that maybe can help you (I’m not sure are
integrated to geoserver official repository): http://goo.gl/eP789L

Diego Guidi

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Hi,

Thank you very much for the answers.

The biggest issue is that there is no label collision detection and there’s no way to integrate an HTML image map on OpenLayers.

It’s likely that we will adopt other solution but, if not, we will contact you.

Best regards,

Bruno da Fonseca

From: maurobartolomeoli@…84… [mailto:maurobartolomeoli@…84…] On Behalf Of Mauro Bartolomeoli
Sent: terça-feira, 6 de Maio de 2014 09:38
To: Diego Guidi
Cc: Mauro Bartolomeoli; Bruno M. Fonseca; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Geoserver ImageMap extension

Hi Diego,

yes your changes are integrated but currently they are rendering each kind of mark as a circle. They are indeed a good starting point to implement rendering of other kinds of marks (square should be very simple, but we some effort all standard marks could be implemented).

The original version didn’t because when using an imagemap the original shape is not visible and from the user point of view there is not a big difference (in my opinion) in using different shapes, but probably there are use cases in which the shape is important.

Mauro

2014-05-06 10:28 GMT+02:00 Diego Guidi <diegoguidi@…84…>:

On Tue, May 6, 2014 at 9:36 AM, Mauro Bartolomeoli
<mauro.bartolomeoli@…1107…> wrote:

I think you need to change the getShape method to return a different shape
based on the current mark and also the writeGeometry method.

I’ ve made some changes that maybe can help you (I’m not sure are
integrated to geoserver official repository): http://goo.gl/eP789L

Diego Guidi

==

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK

for more information.

==

Dott. Mauro Bartolomeoli

@mauro_bart

Senior Software Engineer

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

http://www.geo-solutions.it

http://twitter.com/geosolutions_it


On Tue, May 6, 2014 at 10:37 AM, Mauro Bartolomeoli
<mauro.bartolomeoli@anonymised.com> wrote:

yes your changes are integrated

ah ok

from the user point of view there is not a big difference (in my opinion) in using different shapes

same experienced by me

On Tue, May 6, 2014 at 10:49 AM, Bruno M. Fonseca
<bruno.fonseca@anonymised.com> wrote:

there is no label collision detection

actually I don't know what kind of problem are you experiencing... can
you describe what type of error do you see?

Diego Guidi

Hi Bruno,

imagemap-1.7.0-sample.zip (12.3 KB)

···

2014-05-06 10:49 GMT+02:00 Bruno M. Fonseca <bruno.fonseca@anonymised.com>:

Hi,

Thank you very much for the answers.

The biggest issue is that there is no label collision detection and there’s no way to integrate an HTML image map on OpenLayers.

For the OpenLayers support I did something when the extension was developed. It refers to GeoServer 1.7 and probably and old OpenLayers version, but maybe you can have a look if it’s useful for you.
You find the zip included.

Mauro

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Hi Diego,

It's not a bug. We have created a layer on Geoserver to draw icons and labels. Those icons and labels are drawn on Geotools render library that uses an algorithm of label collision detection to avoid overlapping. The HTML image map extension generates areas for all the features that are inside the clipping box of the map area and does not takes in account the label collision detection used on the aforementioned Geotools library.

Best regards,
Bruno da Fonseca

-----Original Message-----
From: Diego Guidi [mailto:diegoguidi@…84…]
Sent: terça-feira, 6 de Maio de 2014 09:55
To: Bruno M. Fonseca
Cc: Mauro Bartolomeoli; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Geoserver ImageMap extension

On Tue, May 6, 2014 at 10:49 AM, Bruno M. Fonseca <bruno.fonseca@...6499...> wrote:

there is no label collision detection

actually I don't know what kind of problem are you experiencing... can you describe what type of error do you see?

Diego Guidi

Hi Mauro,

Thank you very much for the answer. Can you change the extension of the attachment file. My email server blocks every zip attachment. I would like to take a look on the extension.

Best regards,

Bruno da Fonseca

From: maurobartolomeoli@…84… [mailto:maurobartolomeoli@…84…] On Behalf Of Mauro Bartolomeoli
Sent: terça-feira, 6 de Maio de 2014 10:23
To: Bruno M. Fonseca
Cc: Diego Guidi; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Geoserver ImageMap extension

Hi Bruno,

2014-05-06 10:49 GMT+02:00 Bruno M. Fonseca <bruno.fonseca@…6499…>:

Hi,

Thank you very much for the answers.

The biggest issue is that there is no label collision detection and there’s no way to integrate an HTML image map on OpenLayers.

For the OpenLayers support I did something when the extension was developed. It refers to GeoServer 1.7 and probably and old OpenLayers version, but maybe you can have a look if it’s useful for you.

You find the zip included.

Mauro

==

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK

for more information.

==

Dott. Mauro Bartolomeoli

@mauro_bart

Senior Software Engineer

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

http://www.geo-solutions.it

http://twitter.com/geosolutions_it


Mauro,

If the code is shared on a public source control repository, can you give me path to the repository?

Best regards,

Bruno da Fonseca

From: maurobartolomeoli@…84… [mailto:maurobartolomeoli@…84…] On Behalf Of Mauro Bartolomeoli
Sent: terça-feira, 6 de Maio de 2014 10:23
To: Bruno M. Fonseca
Cc: Diego Guidi; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Geoserver ImageMap extension

Hi Bruno,

2014-05-06 10:49 GMT+02:00 Bruno M. Fonseca <bruno.fonseca@…6499…>:

Hi,

Thank you very much for the answers.

The biggest issue is that there is no label collision detection and there’s no way to integrate an HTML image map on OpenLayers.

For the OpenLayers support I did something when the extension was developed. It refers to GeoServer 1.7 and probably and old OpenLayers version, but maybe you can have a look if it’s useful for you.

You find the zip included.

Mauro

==

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK

for more information.

==

Dott. Mauro Bartolomeoli

@mauro_bart

Senior Software Engineer

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

http://www.geo-solutions.it

http://twitter.com/geosolutions_it