Package org.geotools.xml

Examples of org.geotools.xml.Node


        //  <xsd:element ref="wfs:Update"/>
        //  <xsd:element ref="wfs:Delete"/>
        //  <xsd:element ref="wfs:Native"/>
        //</xsd:choice>
        for (Iterator itr = node.getChildren().iterator(); itr.hasNext();) {
            Node child = (Node) itr.next();
            Object cv = child.getValue();

            if (cv instanceof InsertElementType) {
                transaction.getInsert().add(cv);
            } else if (cv instanceof UpdateElementType) {
                transaction.getUpdate().add(cv);
View Full Code Here


            transaction.setLockId((String) node.getChildValue("LockId"));
        }

        //transactions, need to maintain order
        for (Iterator itr = node.getChildren().iterator(); itr.hasNext();) {
            Node child = (Node) itr.next();
            Object cv = child.getValue();

            if (cv instanceof InsertElementType) {
                transaction.getInsert().add(cv);
            } else if (cv instanceof UpdateElementType) {
                transaction.getUpdate().add(cv);
View Full Code Here

                    AttributeDescriptor attributeType = (AttributeDescriptor) pd;
                    String name = attributeType.getLocalName();
                    Class type = attributeType.getType().getBinding();

                    if ("boundedBy".equals(name)) {
                        Node boundedByNode = node.getChild("boundedBy");

                        //hack 1: if boundedBy is in the parse tree has a bounding box and the attribute
                        // needs a polygon, convert
                        if (boundedByNode.getValue() instanceof Envelope) {
                            Envelope bounds = (Envelope) boundedByNode.getValue();

                            if (type.isAssignableFrom(Polygon.class)) {
                                Polygon polygon = polygon(bounds);
                                boundedByNode.setValue(polygon);
                            } else if (type.isAssignableFrom(MultiPolygon.class)) {
                                MultiPolygon multiPolygon = geometryFactory.createMultiPolygon(new Polygon[] {
                                        polygon(bounds)
                                });
                                boundedByNode.setValue(multiPolygon);
                            }
                        }
                    }

                }
View Full Code Here

        if ( node.hasAttribute( "encoding" ) ) {
            data.setEncoding( node.getAttributeValue( "encoding").toString() );
        }
       
        for ( Iterator i = node.getChildren().iterator(); i.hasNext(); ) {
            Node c = (Node) i.next();
            data.getData().add( c.getValue() );
        }
       
        return data;
    }
View Full Code Here

        return InputReferenceType.class;
    }

    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        Node attr = node.getAttribute("method");

        if (null != attr) {
            attr.setValue(MethodType.get((String)attr.getValue()));
        }

        return super.parse(instance, node, value);
    }
View Full Code Here

        for (AttributeInstance attType : atts) {
            if (attType.getName().equals("name"))
                axis.setName(attType.getText());
        }
       
        Node singleValue = node.getChild("singleValue");
        if (singleValue != null) {
            TypedLiteralType theValue = Wcs10Factory.eINSTANCE.createTypedLiteralType();
            theValue.setValue((String) singleValue.getValue());
            axis.getSingleValue().add(theValue);
        }

        Node interval = node.getChild("interval");
        if (interval != null) {
            IntervalType range = Wcs10Factory.eINSTANCE.createIntervalType();
            if (interval.getChild("min") != null) {
                TypedLiteralType theValue = Wcs10Factory.eINSTANCE.createTypedLiteralType();
                theValue.setValue((String) interval.getChildValue("min"));
                range.setMin(theValue);
            }

            if (interval.getChild("max") != null) {
                TypedLiteralType theValue = Wcs10Factory.eINSTANCE.createTypedLiteralType();
                theValue.setValue((String) interval.getChildValue("max"));
                range.setMax(theValue);
            }

            if (interval.getChild("res") != null) {
                TypedLiteralType theValue = Wcs10Factory.eINSTANCE.createTypedLiteralType();
                theValue.setValue((String) interval.getChildValue("res"));
                range.setRes(theValue);
            }

            if (interval.getAttribute("atomic") != null)
                range.setAtomic((Boolean) interval.getAttributeValue("atomic"));
            else
                range.setAtomic(false);
           
            axis.getInterval().add(range);
        }
View Full Code Here

                maxCP[i] = envelope.getUpperCorner().getOrdinate(i);
            }

            DefaultTemporalCRS TCRS = (DefaultTemporalCRS) ((CompoundCRS) crs).getCoordinateReferenceSystems().get(1);

            Node timePositionNodeBegin = timePositions.get(0);
            Node timePositionNodeEnd = timePositions.get(1);
            minCP[minCP.length - 1] = TCRS.toValue(((DefaultPosition)timePositionNodeBegin.getValue()).getDate());
            maxCP[maxCP.length - 1] = TCRS.toValue(((DefaultPosition)timePositionNodeEnd.getValue()).getDate());

            GeneralDirectPosition minDP = new GeneralDirectPosition(minCP);
            minDP.setCoordinateReferenceSystem(crs);
            GeneralDirectPosition maxDP = new GeneralDirectPosition(maxCP);
            maxDP.setCoordinateReferenceSystem(crs);
View Full Code Here

       
        ExtensionType et = Wcs20Factory.eINSTANCE.createExtensionType();
       
        EList<ExtensionItemType> contents = et.getContents();
        for(Object o : node.getChildren()) {
            Node child = (Node) o;
            String name = child.getComponent().getName();
            String namespace = child.getComponent().getNamespace();
            Object v = child.getValue();
           
            ExtensionItemType item = Wcs20Factory.eINSTANCE.createExtensionItemType();
            item.setName(name);
            item.setNamespace(namespace);
            if(v instanceof String) {
View Full Code Here

                maxCP[i] = envelope.getUpperCorner().getOrdinate(i);
            }

            DefaultTemporalCRS TCRS = (DefaultTemporalCRS) ((CompoundCRS) crs).getCoordinateReferenceSystems().get(1);

            Node timePositionNodeBegin = timePositions.get(0);
            Node timePositionNodeEnd = timePositions.get(1);
            minCP[minCP.length - 1] = TCRS.toValue(((DefaultPosition)timePositionNodeBegin.getValue()).getDate());
            maxCP[maxCP.length - 1] = TCRS.toValue(((DefaultPosition)timePositionNodeEnd.getValue()).getDate());

            GeneralDirectPosition minDP = new GeneralDirectPosition(minCP);
                                  minDP.setCoordinateReferenceSystem(crs);
            GeneralDirectPosition maxDP = new GeneralDirectPosition(maxCP);
                                  maxDP.setCoordinateReferenceSystem(crs);
View Full Code Here

    public Object parse(ElementInstance instance, Node node, Object value)
            throws Exception {
        List positions = node.getChildren("pos");

        if (!positions.isEmpty() && (positions.size() == 2)) {
            Node n1 = (Node) positions.get(0);
            Node n2 = (Node) positions.get(1);
            GeneralDirectPosition p1 = (GeneralDirectPosition) n1.getValue();
            GeneralDirectPosition p2 = (GeneralDirectPosition) n2.getValue();

            GeneralEnvelope envelope = new GeneralEnvelope(p1, p2);
           
            for (AttributeInstance att : instance.getAttributes()) {
                if (att.getName().equals("srsName"))
View Full Code Here

TOP

Related Classes of org.geotools.xml.Node

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.