01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.wms.responses.map.kml;
06:
07: import org.geotools.gml.producer.GeometryTransformer;
08: import org.geotools.xml.transform.Translator;
09: import org.xml.sax.ContentHandler;
10:
11: /**
12: * Geometry transformer for KML geometries.
13: * <p>
14: * This class does nothing beyond the normal gml2 geometry transformer
15: * besides ensure no gml prefix is used.
16: * </p>
17: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
18: *
19: */
20: public class KMLGeometryTransformer extends GeometryTransformer {
21: public Translator createTranslator(ContentHandler handler) {
22: return new KMLGeometryTranslator(handler, numDecimals,
23: useDummyZ);
24: }
25:
26: /**
27: * Subclass which sets prefix and nsuri to null.
28: */
29: static class KMLGeometryTranslator extends GeometryTranslator {
30: public KMLGeometryTranslator(ContentHandler handler,
31: int numDecimals, boolean useDummyZ) {
32: //super(handler, "kml", "http://earth.google.com/kml/2.0" );
33: super (handler, null, null, numDecimals, useDummyZ);
34: coordWriter.setNamespaceAware(false);
35: }
36: }
37: }
|