Package org.geotools.xml

Examples of org.geotools.xml.Encoder.encode()


                    Object value = ((PropertyType) object).getValue();
                   
                    output.startElement(WFS.NAMESPACE, VALUE, "wfs:" + VALUE, null);
                    if (value instanceof Geometry) {
                        Encoder encoder = new Encoder(new org.geotools.gml2.GMLConfiguration());
                        encoder.encode(value, org.geotools.gml2.GML._Geometry, output);
                    }
                    else {
                        String s = value.toString();
                        output.characters(s.toCharArray(), 0, s.length());
                    }
View Full Code Here


        //cd.getData().add(new GeometryFactory().createPoint(new Coordinate(1, 2)));

        Encoder e = new Encoder(new WPSConfiguration());
        e.setIndenting(true);
        e.encode(ex, WPS.Execute, System.out);
    }

    public void testExecuteResponse() throws Exception {
        Wps10Factory f = Wps10Factory.eINSTANCE;
        ExecuteResponseType response = f.createExecuteResponseType();
View Full Code Here

        data.setComplexData(cdata);
        //cdata.getData().add(new GeometryFactory().createPoint(new Coordinate(1, 1)));

        Encoder e = new Encoder(new WPSConfiguration());
        e.setIndenting(true);
        e.encode(response, WPS.ExecuteResponse, System.out);
    }
   
    public void testExecuteResponseProgress() throws Exception {
        Wps10Factory f = Wps10Factory.eINSTANCE;
        ExecuteResponseType response = f.createExecuteResponseType();
View Full Code Here

            ServiceException {
        PostDiffResponseType response = (PostDiffResponseType) value;
        Encoder encoder = new Encoder(configuration, gss.getSchema());
        encoder.setIndenting(true);

        encoder.encode(response, GSS.PostDiffResponse, output);
    }

}
View Full Code Here

            ServiceException {
        GetDiffResponseType response = (GetDiffResponseType) value;
        Encoder encoder = new Encoder(configuration, gss.getSchema());
        encoder.setIndenting(true);

        encoder.encode(response, GSS.GetDiffResponse, output);
    }

}
View Full Code Here

        for (LayerRevision l : cr.getLayerRevisions()) {
            encoder.getNamespaces().declarePrefix(l.getTypeName().getPrefix(),
                    l.getTypeName().getNamespaceURI());
        }

        encoder.encode(cr, GSS.CentralRevisions, output);
    }

}
View Full Code Here

        if (nsi != null) {
            encoder.getNamespaces().declarePrefix(nsi.getPrefix(), nsi.getURI());
        }
        encoder.setEncoding(Charset.forName("UTF-8"));
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        encoder.encode(feature, GML._Feature, bos);
        return bos.toString("UTF-8");
    }

    /**
     * Parses the representation of a GML3 feature back into a {@link SimpleFeature}
View Full Code Here

        }

        Encoder encoder = new Encoder(ogc);
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        try {
            encoder.encode(filter, OGC.Filter, output);
            st.setString(index, new String(output.toByteArray()));
        } catch (Exception e) {
            String msg = "Could not encode filter: " + filter;
            throw new HibernateException(msg, e);
        }
View Full Code Here

        FeatureTypeInfo meta = catalog.getFeatureTypeByName(featureType.getName());
       
        //create teh encoder
        Encoder encoder = new Encoder( configuration );
        encoder.setEncoding(Charset.forName( getInfo().getGeoServer().getGlobal().getCharset() ) );
        encoder.encode( feature,
            new QName( meta.getNamespace().getURI(), meta.getName()), output );
    }

}
View Full Code Here

   
        Encoder encoder = new Encoder( new GMLConfiguration() );
        encoder.setEncoding(Charset.forName( getInfo().getGeoServer().getGlobal().getCharset() ));
       
        if ( value instanceof Point ) {
            encoder.encode( value, GML.Point, output );
        }
        else if ( value instanceof MultiPoint ) {
            encoder.encode( value, GML.MultiPoint, output );
        }
        else if ( value instanceof LineString ) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.