public SimpleFeature createSimpleFeature(Object[] array, SimpleFeatureType type, String id) { if (type.isAbstract()) { throw new IllegalArgumentException( "Cannot create an feature of an abstract FeatureType " + type.getTypeName()); } return new SimpleFeatureImpl(array, type, ff.featureId(id), validating); }
public Object getAttribute(String name) { Integer idx = index.get(name); if (idx != null) return getAttribute(idx); else return null; }
public void setDefaultGeometry(Object geometry) { Integer geometryIndex = index.get(null); if (geometryIndex != null) { setAttribute(geometryIndex, geometry); } }
if (feat.getIdentifier() != null) { return false; if (!id.equals(feat.getIdentifier())) { return false; if (!feat.getFeatureType().equals(featureType)) { return false; Object otherAtt = feat.getAttribute(i);
public void setAttributes(Object[] values) { setAttributes(Arrays.asList(values)); }
public GeometryAttribute getDefaultGeometryProperty() { GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor(); GeometryAttribute geometryAttribute = null; if (geometryDescriptor != null) { Object defaultGeometry = getDefaultGeometry(); geometryAttribute = new GeometryAttributeImpl(defaultGeometry, geometryDescriptor, null); } return geometryAttribute; }
public void setDefaultGeometryProperty(GeometryAttribute geometryAttribute) { if (geometryAttribute != null) setDefaultGeometry(geometryAttribute.getValue()); else setDefaultGeometry(null); }
if (feat.getIdentifier() != null) { return false; if (!id.equals(feat.getIdentifier())) { return false; if (!feat.getFeatureType().equals(featureType)) { return false; Object otherAtt = feat.getAttribute(i);
public void setAttributes(Object[] values) { setAttributes( Arrays.asList( values ) ); }
/** * Gets the geometry for this feature. * * @return Geometry for this feature. * @deprecated use {@link #getDefaultGeometry()}. */ public Geometry getDefaultGeometry() { return (Geometry) super.getDefaultGeometry(); // int idx = schema.defaultGeomIdx; // // if (idx == -1) { // return null; // } // // return (Geometry) attributes[idx]; }
public void setDefaultGeometryProperty(GeometryAttribute geometryAttribute) { if(geometryAttribute != null) setDefaultGeometry(geometryAttribute.getValue()); else setDefaultGeometry(null); }
@Override public SimpleFeature createSimpleFeature(Object[] array, SimpleFeatureType type, String id) { if (type.isAbstract()) { throw new IllegalArgumentException( "Cannot create an feature of an abstract FeatureType " + type.getTypeName()); } return new SimpleFeatureImpl(array, type, MUTABLE_FIDS_FILTER_FACTORY.featureId(id), false); } }
public Object getAttribute(Name name) { return getAttribute(name.getLocalPart()); }
public void setAttribute(String name, Object value) { final Integer idx = index.get(name); if (idx == null) throw new IllegalAttributeException("Unknown attribute " + name); setAttribute(idx.intValue(), value); }
/** * Sets all attributes for this feature, passed in as a list. * @param attributes All feature attributes. * @throws IllegalAttributeException Passed attributes do not match feature * type. */ public void setAttributes(List<Object> attributes) { if( constructing ){ super.setAttributes( fixed( attributes )); } else { super.setAttributes( attributes ); } }
public GeometryAttribute getDefaultGeometryProperty() { GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor(); GeometryAttribute geometryAttribute = null; if(geometryDescriptor != null){ Object defaultGeometry = getDefaultGeometry(); geometryAttribute = new GeometryAttributeImpl(defaultGeometry, geometryDescriptor, null); } return geometryAttribute; }
/** * Modifies the geometry. * * @param geometry All feature attributes. * * @throws IllegalAttributeException if the feature does not have a * geometry. * @deprecated use {@link #setDefaultGeometry(Geometry)}. */ public void setDefaultGeometry(Geometry geometry) throws IllegalAttributeException { try { super.setDefaultGeometry(geometry); } catch( Exception e ) { throw (IllegalAttributeException) new IllegalAttributeException(e.getLocalizedMessage()).initCause(e); } // int idx = schema.defaultGeomIdx; // // if (idx < 0) { // throw new IllegalAttributeException( // "Feature does not have geometry"); // } // // attributes[idx] = geometry; // bounds = null; }
FeatureId id = new FeatureIdImpl(fid); current = new SimpleFeatureImpl( current.getAttributes(), current.getFeatureType(), id);
public Object getDefaultGeometry() { // should be specified in the index as the default key (null) Integer idx = index.get(null); Object defaultGeometry = idx != null ? getAttribute(idx) : null; // not found? do we have a default geometry at all? if (defaultGeometry == null) { GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor(); if (geometryDescriptor != null) { Integer defaultGeomIndex = index.get(geometryDescriptor.getName().getLocalPart()); defaultGeometry = getAttribute(defaultGeomIndex.intValue()); } } return defaultGeometry; }
public void setAttribute(Name name, Object value) { setAttribute(name.getLocalPart(), value); }