Package org.opengis.feature

Examples of org.opengis.feature.Property


        return value;
    }

    public Object getProperty(Object object, QName name) throws Exception {
        Property association = (Property) object;
   
        //non resolved, return the xlink:href
        if (XLINK.HREF.equals(name)) {
            String id = (String) association.getUserData().get("gml:id");
            if (id != null) {   
                return "#" + id;
            }
        }
   
View Full Code Here


     *
     * @param complex
     * @return
     */
    public static Object getSimpleContent(ComplexAttribute complex) {
        Property simpleContent = complex.getProperty(new NameImpl("simpleContent"));
        if (simpleContent == null) {
            return null;
        } else {
            return simpleContent.getValue();
        }
    }
View Full Code Here

    public Object getImmediateNode() {
       
        //first try regular way
        if (feature instanceof ComplexAttribute) {
            ComplexAttribute ca = (ComplexAttribute) feature;
            Property p = ca.getProperty("@" + name.getLocalPart());
            if (p != null) {
                return p;
            }
        }
       
View Full Code Here

     */
    @Override
    public Object getProperty(Object object, QName name) throws Exception {
        if (object instanceof ComplexAttribute) {
            ComplexAttribute complex = (ComplexAttribute) object;
            Property property = complex.getProperty(toTypeName(name));
            if (property != null && !(property instanceof ComplexAttribute)) {
                return property.getValue();
            }
            if ("id".equals(name.getLocalPart())) {
                return complex.getIdentifier();
            }
        }
View Full Code Here

    @Override
    public Element encode(Object object, Document document, Element value) throws Exception {
        if (object instanceof ComplexAttribute) {
            ComplexAttribute complex = (ComplexAttribute) object;
            if (complex.getProperties().size() == 1) {
                Property prop = complex.getProperties().iterator().next();
                checkXlinkHref(prop, complex);
            }
            GML3EncodingUtils.encodeClientProperties(complex, value);
            GML3EncodingUtils.encodeSimpleContent(complex, document, value);
        }
View Full Code Here

        SimpleFeatureCollection features = road.getFeatures();
        assertEquals(4, features.size());

        SimpleFeature feature;
        Geometry geom;
        Property prop;
        GeometryType geomType;
        SimpleFeatureIterator iterator = features.features();
        while (iterator.hasNext()) {
            feature = iterator.next();
            prop = feature.getProperty("geom");
            assertTrue(prop.getType() instanceof GeometryType);
            geomType = (GeometryType) prop.getType();

            Object val = prop.getValue();
            assertTrue(val != null && val instanceof Geometry);
            geom = (Geometry) val;

            Object userData = geom.getUserData();
            assertTrue(userData != null && userData instanceof CoordinateReferenceSystem);
View Full Code Here

        public Set entrySet() {
            if (entrySet == null) {
                entrySet = new LinkedHashSet<MapEntry>();
                final ComplexType featureType = feature.getType();
                PropertyDescriptor attributeDescr = featureType.getDescriptor(attributeName);
                Property property = feature.getProperty(attributeName);
               
                if (property == null) {
                    //maybe polymorphism? let's try
                    @SuppressWarnings("unchecked")
                    List<AttributeDescriptor> substitutionGroup = (List<AttributeDescriptor>) attributeDescr.getUserData().get("substitutionGroup");
                    if (substitutionGroup != null){
                        Iterator<AttributeDescriptor> it = substitutionGroup.iterator();
                        while (property==null && it.hasNext()) {
                             property = feature.getProperty(it.next().getName());
                        }
                        if (property!=null) {
                            attributeDescr = property.getDescriptor();
                        }
                    }   
                }
               
                entrySet.add(new MapEntry<Object, Object>("isComplex", property instanceof ComplexAttribute));

                Object value = null;
                if (property instanceof ComplexAttribute) {
                    value = buildComplex((ComplexAttribute)property);
                }
                else if (property!=null) {
                    value = property.getValue();
                }
               
                entrySet.add(new DeferredValueEntry("value", value));
                entrySet.add(new MapEntry<Object, Object>("name", attributeName.getLocalPart()));
                entrySet.add(new MapEntry<Object, Object>("namespace", getNamespace(attributeName)));
View Full Code Here

       
        public FilterBuilder() {
        }
       
        public void addFeature(Feature f, Link l) {
            Property property = f.getProperty(new NameImpl(l.getKey()));
            if (property == null || property.getValue() == null)
                return;
            branches.add(FF.equals(new AttributeExpressionImpl(new NameImpl(l.getForeign())), FF.literal(property.getValue())));
        }
View Full Code Here

  private void dumpFids() {
    int i = 1;
    for (Identifier fid : m_features.keySet()) {
      FeatureAccessor accessor = m_features.get(fid);
      Feature feature = accessor.getFeature();
      Property p = feature.getProperty(m_printProperty);
      Object value = p != null ? p.getValue() : "<no such property>";
      System.out.printf("%d: fid: %s %s=%s%n",
          i, feature.getIdentifier().getID(), m_printProperty, value);
      i++;
    }
  }
View Full Code Here

                }
            }
           
            // encode the bbox if present
            if(elements == null || elements.contains(CSWRecordDescriptor.RECORD_BBOX_NAME)) {
                Property bboxes = f.getProperty(CSWRecordDescriptor.RECORD_BBOX_NAME);
                if(bboxes != null) {
                    // grab the original bounding boxes from the user data (the geometry is an aggregate)
                    List<ReferencedEnvelope> originalBoxes = (List<ReferencedEnvelope>) bboxes
                            .getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES);
                    for (ReferencedEnvelope re : originalBoxes) {
                        try {
                            ReferencedEnvelope wgs84re = re.transform(
                                    CRS.decode(CSWRecordDescriptor.DEFAULT_CRS_NAME), true);
View Full Code Here

TOP

Related Classes of org.opengis.feature.Property

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.