Package org.opengis.feature

Examples of org.opengis.feature.Property


    }
    if (exp.getClass().isAssignableFrom(AttributeExpressionImpl.class)) {
      AttributeExpressionImpl v = (AttributeExpressionImpl) exp;
      String property = v.getPropertyName();
      Property p = feature.getProperty(property);
      if (p == null) {
        return "";
      }
      Object o = p.getValue();
      if (o != null) {
        return o.toString();
      }
    }
    return "";
View Full Code Here


    private final static HashMap<Name, Class> getSignature(SimpleFeature f) {
        HashMap ftype = new HashMap();
        Collection properties = f.getProperties();
        for (Object op : properties) {
            Property p = (Property) op;
            Class c = p.getType().getBinding();
            if ((c.isAssignableFrom(String.class)) || (c.isAssignableFrom(Boolean.class))
                    || (c.isAssignableFrom(Integer.class)) || (c.isAssignableFrom(Float.class))
                    || (c.isAssignableFrom(Double.class)) || (c.isAssignableFrom(Geometry.class))) {
                ftype.put(p.getName(), c);
            }
        }
        return ftype;
    }
View Full Code Here

        final Set<String> values = new HashSet<String>();
        getRecords(q, Transaction.AUTO_COMMIT, rd.getOutputSchema()).accepts(new FeatureVisitor() {
           
            @Override
            public void visit(Feature feature) {
                Property prop = (Property) property.evaluate(feature);
                if (prop != null)
                    try {
                        values.add( new String(((String) prop.getValue()).getBytes("ISO-8859-1"), "UTF-8" ) );
                    } catch (UnsupportedEncodingException e) {
                        throw new RuntimeException(e);
                    }
            }
        }, null);
View Full Code Here

        assertRecordElement(f, "subject", "imagery", "baseMaps", "earthCover");
        assertBBox(f, new ReferencedEnvelope(14.05, 17.24, 46.46, 28.42, DefaultGeographicCRS.WGS84));
    }

    private void assertBBox(Feature f, ReferencedEnvelope... envelopes) throws Exception {
        Property p = f.getProperty(CSWRecordDescriptor.RECORD_BBOX_NAME);
        MultiPolygon geometry = (MultiPolygon) p.getValue();
        List<ReferencedEnvelope> featureEnvelopes = (List<ReferencedEnvelope>) p.getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES);
        ReferencedEnvelope total = null;
        for (int i = 0; i < envelopes.length; i++) {
            assertEquals(envelopes[i], featureEnvelopes.get(i));
            ReferencedEnvelope re = envelopes[i].transform(CSWRecordDescriptor.DEFAULT_CRS, true);
            if(total == null) {
View Full Code Here

        assertBBox(f, new ReferencedEnvelope(14.05, 17.24, 46.46, 28.42, DefaultGeographicCRS.WGS84));
    }
   
    private void assertBBox(Feature f, ReferencedEnvelope... envelopes) throws Exception {
        PropertyName bbox = ff.property("gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox", MetaDataDescriptor.NAMESPACES);
        Property p = (Property) bbox.evaluate(f);
        MultiPolygon geometry = (MultiPolygon) p.getValue();
        List<ReferencedEnvelope> featureEnvelopes = (List<ReferencedEnvelope>) p.getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES);
        ReferencedEnvelope total = null;
        for (int i = 0; i < envelopes.length; i++) {
            assertEquals(envelopes[i], featureEnvelopes.get(i));
            ReferencedEnvelope re = envelopes[i].transform(CSWRecordDescriptor.DEFAULT_CRS, true);
            if(total == null) {
View Full Code Here

        if (value instanceof Collection) {       
            Collection<Property> propertyList = (Collection<Property>) value;
            Property[] properties = (Property[]) propertyList.toArray(new Property[propertyList.size()]);
            assertEquals(properties.length, values.length);
            for (int i = 0; i < properties.length; i++) {
                Property property = (Property) properties[i];
                assertEquals(values[i], property.getValue());
            }
        } else {
            Property property = (Property) value;
            assertEquals(1, values.length);
            assertEquals(values[0], property.getValue());
        }
    }
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.