[Geoserver-devel] [jira] Created: (GEOS-537) Placemark's name included in generated KML

Placemark's name included in generated KML
------------------------------------------

         Key: GEOS-537
         URL: http://jira.codehaus.org/browse/GEOS-537
     Project: GeoServer
        Type: Improvement

  Components: WMS
    Versions: 1.3.0 PR1
Environment: Linux
    Reporter: Jørn Vegard Røsnes
Assigned to: Gabriel Roldán
     Fix For: 1.3.0

The <name> tag of a Placemark is not correct set.

This is the patch from Eclipse:

Index: /home/jorn/eclipse/workspace/GEOS/src/org/vfny/geoserver/wms/responses/map/kml/KMLWriter.java

--- /home/jorn/eclipse/workspace/GEOS/src/org/vfny/geoserver/wms/responses/map/kml/KMLWriter.java (revision 4146)
+++ /home/jorn/eclipse/workspace/GEOS/src/org/vfny/geoserver/wms/responses/map/kml/KMLWriter.java (working copy)
@@ -22,13 +22,13 @@
import java.util.List;
import java.util.Locale;
import java.util.NoSuchElementException;
-import java.util.logging.Level;
+//import java.util.logging.Level;
import java.util.logging.Logger;
import javax.media.jai.util.Range;
-import javax.xml.transform.TransformerFactory;
+//import javax.xml.transform.TransformerFactory;

import org.geotools.data.DataSourceException;
-import org.geotools.data.FeatureReader;
+//import org.geotools.data.FeatureReader;
import org.geotools.feature.Feature;
import org.geotools.feature.FeatureCollection;
import org.geotools.feature.FeatureIterator;
@@ -46,7 +46,7 @@
import org.geotools.styling.Symbolizer;
import org.geotools.util.NumberRange;
import org.vfny.geoserver.wms.WMSMapContext;
-import com.vividsolutions.jts.geom.Envelope;
+//import com.vividsolutions.jts.geom.Envelope;
import java.util.Iterator;
import javax.xml.transform.TransformerException;
import org.geotools.filter.Filter;
@@ -55,7 +55,7 @@
import org.geotools.renderer.style.Style2D;
import org.geotools.styling.RasterSymbolizer;
import org.geotools.styling.TextSymbolizer;
-import org.opengis.referencing.operation.MathTransform2D;
+//import org.opengis.referencing.operation.MathTransform2D;

/**
@@ -428,20 +428,21 @@
                 // CoordinateReferenceSystem crs = findGeometryCS(feature, symbolizers[m]);
                 if( symbolizers[m] instanceof TextSymbolizer ){
                     title = (String)((TextSymbolizer) symbolizers[m]).getLabel().getValue(feature);
- } else{
- Style2D style = styleFactory.createStyle(feature, symbolizers[m], scaleRange);
- write("<Placemark>");
- if(title != null){
- write("<Name>"+title+"</Name>");
- }
- writeStyle(style);
-
- write("<GeometryCollection>");
- writeGeometry(g,transformer);
- write("</GeometryCollection>");
- write("</Placemark>");
- newline();
+ }
+
+ Style2D style = styleFactory.createStyle(feature, symbolizers[m], scaleRange);
+ write("<Placemark>");
+ if(title != null){
+ write("<name>"+title+"</name>");
                 }
+ writeStyle(style);
+
+ write("<GeometryCollection>");
+ writeGeometry(g,transformer);
+ write("</GeometryCollection>");
+ write("</Placemark>");
+ newline();
+
             }
         }
     }

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira