Package org.geotools.xml

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


            // set the schema location
            encodeTypeSchemaLocation(encoder, gft.getBaseUrl(), namespaceURI, typeNames);
        }

        try {
            encoder.encode(transaction, element, output);
        } finally {
          for (int i = 0; i < diffReaders.length; i++) {
        diffReaders[i].close();
      }
        }
View Full Code Here


                        + ". Using a built schema location by default: " + schemaLocation);
                encoder.setSchemaLocation(namespaceURI, schemaLocation);
            }
        }

        encoder.encode(results, org.geoserver.wfs.xml.v1_1_0.WFS.FEATURECOLLECTION, output);
    }
}
View Full Code Here

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

}
View Full Code Here

        final Encoder encoder = new Encoder(GeomFormat.gml2Config);
        encoder.setIndenting(false);
        encoder.setOmitXMLDeclaration(true);
        encoder.setNamespaceAware(true);

        encoder.encode(geometry, org.geotools.gml2.GML.geometryMember, outputStream);
        String gmlString = outputStream.toString();

        assertNotNull(GeomFormat.GML2.parse(gmlString));
        assertNotNull(GeomFormat.GML2.parse(URLEncoder.encode(gmlString, "UTF-8")));
    }
View Full Code Here

        final Encoder encoder = new Encoder(GeomFormat.gml3Config);
        encoder.setIndenting(false);
        encoder.setOmitXMLDeclaration(true);
        encoder.setNamespaceAware(true);

        encoder.encode(geometry, org.geotools.gml3.GML.geometryMember, outputStream);
        String gmlString = outputStream.toString();

        assertNotNull(GeomFormat.GML3.parse(gmlString));
        assertNotNull(GeomFormat.GML3.parse(URLEncoder.encode(gmlString, "UTF-8")));
    }
View Full Code Here

        final Encoder encoder = new Encoder(GeomFormat.gml32Config);
        encoder.setIndenting(false);
        encoder.setOmitXMLDeclaration(true);
        encoder.setNamespaceAware(true);

        encoder.encode(geometry, org.geotools.gml3.v3_2.GML.geometryMember, outputStream);
        String gmlString = outputStream.toString();

        assertNotNull(GeomFormat.GML32.parse(gmlString));
        assertNotNull(GeomFormat.GML32.parse(URLEncoder.encode(gmlString, "UTF-8")));
    }
View Full Code Here

    encoder.setEncoding(charset);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
   
    String xml;
    try {
      encoder.encode(filter, OGC.Filter, out);
      xml = new String(out.toByteArray(), charset.toString());
    } catch (IOException e) {
      Log.error(Geonet.CSW, e.getMessage());
      throw new NoApplicableCodeEx("Error transforming Filter to XML" + e);
    }
View Full Code Here

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Encoder encoder = new Encoder(_configuration);
        encoder.setOmitXMLDeclaration(true);
        encoder.setNamespaceAware(true);

        encoder.encode(SpatialIndexWriter.toMultiPolygon(fullGeom), org.geotools.gml3.GML.MultiPolygon, out);
        Element geomElem = org.fao.geonet.csw.common.util.Xml.loadString(out.toString(Constants.ENCODING), false);
        parentElement.setContent(index, geomElem);
    }

    private ArrayList<Element> lookupGeoms(Element filterExpr)
View Full Code Here

                    "request", "DescribeFeatureType",
                    "typeName", typeNames.toString());
            encoder.setSchemaLocation(namespaceURI, buildURL(gft.getBaseUrl(), "wfs", params, URLType.SERVICE));
        }

        encoder.encode(results,
                    org.geoserver.wfs.xml.v1_1_0.WFS.FEATURECOLLECTION, output);
      
    }

    public boolean canHandle(Operation operation) {
View Full Code Here

        file.deleteOnExit();

        OutputStream output = new BufferedOutputStream(new FileOutputStream(file));
        Encoder encoder = new Encoder(new OGCConfiguration());

        encoder.encode(filter, OGC.PropertyIsEqualTo, output);
        output.flush();
        output.close();

        DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
        docFactory.setNamespaceAware(true);
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.