Package org.geotools.gml.producer

Examples of org.geotools.gml.producer.GeometryTransformer


    /**
     * @see Transfer#javaToNative
     */
    public void javaToNative(Object object, TransferData transferData) {
      Geometry geometry = (Geometry) object;
      GeometryTransformer transformer = new GeometryTransformer();

      transformer.setIndentation(2);

      try {
                TextTransfer.getInstance().javaToNative(transformer.transform(geometry), transferData);
            } catch (TransformerException e) {
                throw (RuntimeException) new RuntimeException().initCause(e);
            }
    }
View Full Code Here


     */
    public KMLWriter(OutputStream out, WMSMapContext mapContext) {
        super(out, Charset.forName("UTF-8"));
        this.mapContext = mapContext;

        transformer = new GeometryTransformer();
        // transformer.setUseDummyZ(true);
        transformer.setOmitXMLDeclaration(true);
        transformer.setNamespaceDeclarationEnabled(true);

        WMS config = mapContext.getRequest().getWMS();
View Full Code Here

         *
         * @see org.geotools.validation.xml.ArgHelper.Mapping#encode(java.lang.Object)
         */
        public String encode(Object obj) throws ValidationException {
            StringWriter sw = new StringWriter();
            GeometryTransformer transformer = new GeometryTransformer();

            try {
                transformer.transform(obj, sw);
            } catch (TransformerException e) {
                throw new ValidationException(e);
            }

            return "<geometry>\n" + sw.toString() + "</geometry>\n";
View Full Code Here

            return "<geometry>\n" + sw.toString() + "</geometry>\n";
        }

        public String toString(Object obj) {
            StringWriter sw = new StringWriter();
            GeometryTransformer transformer = new GeometryTransformer();

            try {
                transformer.transform(obj, sw);
            } catch (TransformerException e) {
                return null;
            }

            return "<geometry>\n" + sw.toString() + "</geometry>\n";
View Full Code Here

     */
    public KMLWriter(OutputStream out, WMSMapContext mapContext) {
        super(out);
        this.mapContext = mapContext;
       
        transformer = new GeometryTransformer();
        transformer.setUseDummyZ(true);
        transformer.setOmitXMLDeclaration(true);
        transformer.setNamespaceDeclarationEnabled(true);
    }
View Full Code Here

     */
    public KMLWriter(OutputStream out, WMSMapContext mapContext, WMS wms) {
        super(out, Charset.forName("UTF-8"));
        this.mapContext = mapContext;

        transformer = new GeometryTransformer();
        // transformer.setUseDummyZ(true);
        transformer.setOmitXMLDeclaration(true);
        transformer.setNamespaceDeclarationEnabled(true);

        transformer.setNumDecimals(wms.getNumDecimals());
View Full Code Here

TOP

Related Classes of org.geotools.gml.producer.GeometryTransformer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.