Examples of encodeAsDOM()


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

        SimpleFeature feature = GML3MockData.feature();
        TestConfiguration configuration  = new TestConfiguration();
        //configuration.getProperties().add( org.geotools.gml2.GMLConfiguration.NO_FEATURE_BOUNDS );
   
        Encoder encoder = new Encoder( configuration );
        Document dom = encoder.encodeAsDOM(feature, TEST.TestFeature );
       
        assertEquals( 1, dom.getElementsByTagName("gml:boundedBy").getLength());
    }
   
    public void testEncodeFeatureWithNoBounds() throws Exception {
View Full Code Here

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

        SimpleFeature feature = GML3MockData.feature();
        TestConfiguration configuration  = new TestConfiguration();
        configuration.getProperties().add( org.geotools.gml2.GMLConfiguration.NO_FEATURE_BOUNDS );
   
        Encoder encoder = new Encoder( configuration );
        Document dom = encoder.encodeAsDOM(feature, TEST.TestFeature );
       
        assertEquals( 0, dom.getElementsByTagName("gml:boundedBy").getLength());
    }

    public void testEncodeWithNoSrsDimension() throws Exception {
View Full Code Here

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

        SimpleFeature feature = (SimpleFeature) builder.buildFeature("fid.1");
       
        TestConfiguration configuration  = new TestConfiguration();
        Encoder encoder = new Encoder( configuration );
        Document dom = encoder.encodeAsDOM(feature, TEST.TestFeature);
        NodeList countList = dom.getElementsByTagName("test:count");
        Node count = countList.item(0);
        assertEquals("true", count.getAttributes().getNamedItem("xs:nil").getTextContent());
        NodeList dateList = dom.getElementsByTagName("test:date");
        Node date = dateList.item(0);
View Full Code Here

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

        assertEquals("true", date.getAttributes().getNamedItem("xs:nil").getTextContent());

        // now force the XSD prefix
        encoder = new Encoder(configuration);
        encoder.getNamespaces().declarePrefix("xsd", "http://www.w3.org/2001/XMLSchema");
        dom = encoder.encodeAsDOM(feature, TEST.TestFeature);
        countList = dom.getElementsByTagName("test:count");
        count = countList.item(0);
        assertEquals("true", count.getAttributes().getNamedItem("xsd:nil").getTextContent());
        dateList = dom.getElementsByTagName("test:date");
        date = dateList.item(0);
View Full Code Here

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

        final Encoder encoder = prepareEncoder(request);
        final QName opName = getOperationName(request.getOperation());

        Document dom;
        try {
            dom = encoder.encodeAsDOM(requestObject, opName);
        } catch (SAXException e) {
            throw new IOException(e);
        } catch (TransformerException e) {
            throw new IOException(e);
        }
View Full Code Here

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

    public void testEncodeFeatureCollection10() throws Exception {
        Encoder e = new Encoder( new org.geotools.wfs.v1_0.WFSConfiguration() );
        e.getNamespaces().declarePrefix( "geotools", "http://geotools.org");
        e.setIndenting(true);

        Document d = e.encodeAsDOM( fc, WFS.FeatureCollection );
           
        assertEquals( 2, d.getElementsByTagName( "gml:Point" ).getLength() );
        assertTrue( d.getElementsByTagName( "gml:coord" ).getLength() > 2 );
        assertEquals( 0, d.getElementsByTagName( "gml:pos" ).getLength() );
       
View Full Code Here

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

    public void testEncodeFeatureCollection11() throws Exception {
        Encoder e = new Encoder( new org.geotools.wfs.v1_1.WFSConfiguration() );
        e.getNamespaces().declarePrefix( "geotools", "http://geotools.org");
        e.setIndenting(true);
       
        Document d = e.encodeAsDOM( fc, WFS.FeatureCollection );
        assertEquals( 2, d.getElementsByTagName( "gml:Point" ).getLength() );
        assertEquals( 2, d.getElementsByTagName( "gml:pos" ).getLength() );
        assertEquals( 0, d.getElementsByTagName( "gml:coord" ).getLength() );
       
        assertEquals( 2, d.getElementsByTagName( "geotools:feature" ).getLength() );
View Full Code Here

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

        Encoder e = new Encoder( new org.geotools.wfs.v1_1.WFSConfiguration() );
        e.getNamespaces().declarePrefix( "geotools", "http://geotools.org");
        e.getNamespaces().declarePrefix( "geotools2", "http://geotools.org/geotools2");
        e.setIndenting(true);
       
        Document d = e.encodeAsDOM( fc, WFS.FeatureCollection );
        assertEquals( 2, d.getElementsByTagName( "geotools:feature").getLength());
        assertEquals( 2, d.getElementsByTagName( "geotools2:feature2").getLength());
    }
}
View Full Code Here

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

        //try with string
        propertyType.setValue("myvalue");
       
        Encoder encoder = new Encoder(new WFSConfiguration());
        //System.out.println(encoder.encodeAsString(update, WFS.Update));
        Document doc = encoder.encodeAsDOM(update, WFS.Update);
        XMLAssert.assertXpathEvaluatesTo("mn:mytypename", "//wfs:Update/@typeName", doc);
        XMLAssert.assertXpathEvaluatesTo("mn:myproperty", "//wfs:Update/wfs:Property/wfs:Name", doc);
        XMLAssert.assertXpathEvaluatesTo("myvalue", "//wfs:Update/wfs:Property/wfs:Value", doc);
        XMLAssert.assertXpathEvaluatesTo("someid", "//wfs:Update/ogc:Filter/ogc:FeatureId/@fid", doc);
       
View Full Code Here

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

        //try with numeric value
        propertyType.setValue(100.25);
       
        encoder = new Encoder(new WFSConfiguration());
        //System.out.println(encoder.encodeAsString(update, WFS.Update));
        doc = encoder.encodeAsDOM(update, WFS.Update);
        XMLAssert.assertXpathEvaluatesTo("100.25", "//wfs:Update/wfs:Property/wfs:Value", doc);
               
        //try with geometry
        Coordinate insideCoord = new Coordinate(5.2, 7.5);
        Point myPoint = geomfac.createPoint(insideCoord);
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.