From: <ji...@co...> - 2006-02-07 18:08:52
|
Placemark's name included in generated KML ------------------------------------------ Key: GEOS-537 URL: http://jira.codehaus.org/browse/GEOS-537 Project: GeoServer Type: Improvement Components: WMS =20 Versions: 1.3.0 PR1 =20 Environment: Linux Reporter: J=F8rn Vegard R=F8snes Assigned to: Gabriel Rold=E1n=20 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/respons= es/map/kml/KMLWriter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /home/jorn/eclipse/workspace/GEOS/src/org/vfny/geoserver/wms/responses/= map/kml/KMLWriter.java=09(revision 4146) +++ /home/jorn/eclipse/workspace/GEOS/src/org/vfny/geoserver/wms/responses/= map/kml/KMLWriter.java=09(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; =20 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; =20 =20 /** @@ -428,20 +428,21 @@ // CoordinateReferenceSystem crs =3D findGeometryCS(featu= re, symbolizers[m]); =20 if( symbolizers[m] instanceof TextSymbolizer ){ title =3D (String)((TextSymbolizer) symbolizers[m]).ge= tLabel().getValue(feature); - } else{ - Style2D style =3D styleFactory.createStyle(feature, sy= mbolizers[m], scaleRange); - write("<Placemark>"); - if(title !=3D null){ - write("<Name>"+title+"</Name>"); - } - writeStyle(style); - =20 - write("<GeometryCollection>"); - writeGeometry(g,transformer); - write("</GeometryCollection>"); - write("</Placemark>"); - newline(); + }=20 + =20 + Style2D style =3D styleFactory.createStyle(feature, symbol= izers[m], scaleRange); =20 + write("<Placemark>"); =20 + if(title !=3D null){ =20 + =09write("<name>"+title+"</name>"); } + writeStyle(style); + =20 + write("<GeometryCollection>"); + writeGeometry(g,transformer); + write("</GeometryCollection>"); + write("</Placemark>"); + newline(); + =20 } } } --=20 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 |