[Geoserver-devel] [jira] (GEOS-5187) FEATURETYPE param dos not works with GetLegendGraphic

felipe frechiani de oliveira created BugGEOS-5187
FEATURETYPE param dos not works with GetLegendGraphic

Issue Type:

BugBug

Affects Versions:

2.1.4

Assignee:

Andrea Aime

Components:

WMS

Created:

21/Jun/12 8:11 AM

Description:

When trying to use FEATURETYPE param in a GetLegendGraphic request it ignore the param passed in the user &FEATURETYPE=myfeature.

In some cases it is useful like when working with thematic maps like this one in the link (http://en.wikipedia.org/wiki/File:Choropleth.gif). In that kind of map we need two styles one for rendering the map itself that have states names and theirs colors and another for rendering the legend graphic that is a summary of the all states in the map, otherwise it would end up with one item in the legend for each state and that will not fit in my map.

I have done an alteration in order to it support this PARAM in bellow the code for that.

line 196 in BufferedImageLegendGraphicBuilder class
//*INICIO DA ALTERACAO FEITA NO GEOSERVER PARA SUPORTA A UTILIZACAO DO Param FeatureType
List<FeatureTypeStyle> ftStylesDefault = gt2Style.featureTypeStyles();
FeatureTypeStyle ftDefault = null;
if (request.getFeatureType() != null) {
for (FeatureTypeStyle ft : ftStylesDefault) {
if (ft.getName().equalsIgnoreCase(request.getFeatureType())) { ftDefault = ft; break; }
}
if(ftDefault == null){ return null; }
}
FeatureTypeStyle ftStyles = null;
if (ftDefault == null ) { ftStyles = gt2Style.featureTypeStyles().toArray(new FeatureTypeStyle[0]); } else { ftStyles = new FeatureTypeStyle[1]; ftStyles[0] = ftDefault; }
//*FIM DA ALTERACAO FEITA NO GEOSERVER PARA SUPORTA A UTILIZACAO DO Param FeatureType

Environment:

GeoServer 2.1.4

Fix Versions:

2.1.4

Project:

GeoServer

Priority:

MinorMinor

Reporter:

felipe frechiani de oliveira

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your [JIRA administrators](https://jira.codehaus.org/secure/ContactAdministrators!default.jspa). For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)