Exemplo n.º 1
0
 @Override
 public BoundingBox getBounds() {
   // Calculate bounds?
   //
   if (bounds == null) {
     //
     // Initialize bounds
     //
     bounds = new ReferencedEnvelope(getFeatureType().getCoordinateReferenceSystem());
     //
     // Loop over all geometries
     //
     for (EFeatureGeometry<Geometry> it : eInternal.getGeometryList(Geometry.class)) {
       if (!it.isEmpty()) {
         Geometry g = it.getValue();
         if (bounds.isNull()) {
           bounds.init(g.getEnvelopeInternal());
         } else {
           bounds.expandToInclude(g.getEnvelopeInternal());
         }
       }
     }
   }
   return bounds;
 }
Exemplo n.º 2
0
 @Override
 public List<Object> write(Transaction transaction) throws IllegalStateException {
   //
   // Decide if feature values is allowed to be updated from backing store
   //
   if (!isDetached()) {
     throw new IllegalStateException(
         "ESimpleFeature " + getType().getTypeName() + " is not detached");
   }
   //
   // Get properties
   //
   List<EFeaturePropertyDelegate<?, ? extends Property, ? extends EStructuralFeature>> eList =
       eInternal.getProperties();
   //
   // Prepare to read values from properties
   //
   List<Object> eValues = new ArrayList<Object>(eList.size());
   //
   // Loop over all properties
   //
   for (EFeatureProperty<?, ? extends Property> it : eList) {
     eValues.add(it.write(eInternal().eTx));
   }
   //
   // Finished
   //
   return eValues;
 }
Exemplo n.º 3
0
 @Override
 public Property getProperty(String eName) {
   // Get instance, returns null if not found
   //
   EFeatureProperty<?, ? extends Property> eProperty = eInternal.getPropertyMap().get(eName);
   //
   // Get property instance, return null if not found
   //
   return (eProperty != null ? eProperty.getData() : null);
 }
Exemplo n.º 4
0
 @Override
 public List<Property> getProperties() {
   // Initialize
   //
   List<Property> eList = new ArrayList<Property>();
   //
   // Loop over all EFeatureProperty instances,
   // collecting current Property instances.
   //
   for (EFeatureProperty<?, ? extends Property> it : eInternal.getProperties()) {
     eList.add(it.getData());
   }
   // Finished
   //
   return Collections.unmodifiableList(eList);
 }
Exemplo n.º 5
0
 @Override
 public List<Object> read(Transaction transaction) throws IllegalStateException {
   //
   // Get properties
   //
   List<EFeaturePropertyDelegate<?, ? extends Property, ? extends EStructuralFeature>> eList =
       eInternal.getProperties();
   //
   // Prepare to read values from properties
   //
   List<Object> eValues = new ArrayList<Object>(eList.size());
   //
   // Loop over all properties
   //
   for (EFeatureProperty<?, ? extends Property> it : eList) {
     eValues.add(it.read(eInternal().eTx));
   }
   //
   // Finished
   //
   return eValues;
 }
Exemplo n.º 6
0
 @Override
 public GeometryAttribute getDefaultGeometryProperty() {
   //
   // Get default Geometry name
   //
   String eName = eStructure().eGetDefaultGeometryName();
   //
   // Get EFeatureGeometry structure
   //
   EFeatureGeometry<?> eGeometry = (EFeatureGeometry<?>) eInternal.getPropertyMap().get(eName);
   //
   // Found geometry?
   //
   if (eGeometry != null) {
     // Get attribute
     //
     return eGeometry.getData();
   }
   //
   // Not found, return null;
   //
   return null;
 }
Exemplo n.º 7
0
 @Override
 public int getAttributeCount() {
   return eInternal.getProperties().size();
 }
Exemplo n.º 8
0
 @Override
 public EFeature eFeature() {
   return (EFeature) eInternal.eFeature();
 }
Exemplo n.º 9
0
 @Override
 public EObject eObject() {
   return eInternal.eImpl();
 }