I originally sent this email on 24 Apr 2008 with no response.
GeoServer is rendering multiple labels for long linear features for a WMS request of a feature type with a multiLineStringProperty geometry. This problem occurs for requests of PNG and JPEG formats, but not for PDF formats.
At the end of the email is the SLD that I am using for rendering the linear feature type. Note: This is not a name grouping issu–the problem is with individual features. Also, this is not a tiling issue since I was viewing the images using GeoServer’s built-in OpenLayers demo feature without tiles.
The data source for the feature type was created from a polyline shapefile. Using ArcMap, I have checked that these long linear features are single features–I checked both the raw shapefile and the data returned by a WFS call.
Here is the software versions that I am using:
GeoServer 1.6.2
Tomcat 6.0.16
Java 1.5.0_12-b04
Java Advanced Imaging 1.1.3
Java Advanced Imaging Image I/O Tools 1.1
Red Hat Enterprise Linux ES release 3 (Taroon Update 9)
Linux 2.4.21-51.EL (uname -s -r)
Thank you,
Alan
<?xml version="1.0" encoding="UTF-8"?>
Contours
Default Styler for Contours
Feature
Contours - All
Simple Contourss
#AA0000
2
Value
Arial
Normal
10
bold
0
4
#FFFFFF
1.0
#AA0000
no
Smith, Alan G. ha scritto:
I originally sent this email on 24 Apr 2008 with no response.
GeoServer is rendering multiple labels for long linear features for a WMS request of a feature type with a multiLineStringProperty geometry. This problem occurs for requests of PNG and JPEG formats, but not for PDF formats.
At the end of the email is the SLD that I am using for rendering the linear feature type. Note: This is not a name grouping issu--the problem is with individual features. Also, this is not a tiling issue since I was viewing the images using GeoServer’s built-in OpenLayers demo feature without tiles.
I had a cursory look at the labelling algorithm and I don't see
anything that could trigger a multilinestring to be labelled
multiple times.
Can you send me a sample of that dataset (enough to reproduce
the issue) by private mail?
Cheers
Andrea
Andrea Aime ha scritto:
Smith, Alan G. ha scritto:
I originally sent this email on 24 Apr 2008 with no response.
GeoServer is rendering multiple labels for long linear features for a WMS request of a feature type with a multiLineStringProperty geometry. This problem occurs for requests of PNG and JPEG formats, but not for PDF formats.
At the end of the email is the SLD that I am using for rendering the linear feature type. Note: This is not a name grouping issu--the problem is with individual features. Also, this is not a tiling issue since I was viewing the images using GeoServer’s built-in OpenLayers demo feature without tiles.
Thanks for sending me some sample data. I'm attaching screenshots
because this one is kinda hilarious. First of all, let me tell you
the map has just one label per feature. But there are more than 1000
features in that dataset, and many of them are overlapping, generating
the illusion of multi labels on the bigger ones.
Attached I have some wms images. First, a full request:
http://localhost:8080/geoserver/wms?HEIGHT=353&WIDTH=800&LAYERS=topp%3Alinear&STYLES=&SRS=EPSG%3A4326&FORMAT=image%2Fpng8&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-309.375,-134.6252123220825,309.375,138.3982251779175
which results in fullLabels.png.
Then I added a filter to paint only linear.1:
http://localhost:8080/geoserver/wms?HEIGHT=353&WIDTH=800&LAYERS=topp%3Alinear&STYLES=&SRS=EPSG%3A4326&FORMAT=image%2Fpng8&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-309.375,-134.6252123220825,309.375,138.3982251779175&featureId=linear.1
which results in linear1.png: just the long one, as you can see, just one label.
By doing some clickling on the map preview I came out with two ids of
features that are overlapping with linear.918 and linear.923
http://localhost:8080/geoserver/wms?HEIGHT=353&WIDTH=800&LAYERS=topp%3Alinear&STYLES=&SRS=EPSG%3A4326&FORMAT=image%2Fpng8&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-309.375,-134.6252123220825,309.375,138.3982251779175&featureId=linear.1,linear.918,linear.923
which results in linear1-928-923.png. Only two labels because 928 and 923 are really close and really small. In fact, I was not able to see them because at whatever zoom level I use the label fully covers them.
It seems to me you may have to do some cleanup to your data? 
Cheers
Andrea


