The definition of a "simple feature" can be summed up as the following:
| GEOMETRY | INT | STRING | | POINT(0 0) | 0 | "zero" |Accessing attributes via index would look like:
SimpleFeature feature = ...; Geometry g = (Geometry) feature.getAttribute( 0 ); Integer i = (Integer) feature.getAttribute( 1 ); String s = (String) feature.getAttribute( 2 );One could also access by name:
SimpleFeature feature = ...; Geometry g = (Geometry) feature.getAttribute( "GEOMETRY" ); Integer i = (Integer) feature.getAttribute( "INT" ); String s = (String) feature.getAttribute( "STRING" );
Note: Attribute access via getAttribute() methods returns attribute values, and not the attributes themselves. For access to the actual attributes {@link ComplexAttribute#getProperty(String)} can be used.
@see SimpleFeatureType @author Jody Garnett (LISAsoft) @author Justin Deoliveira (The Open Planning Project) @since 2.5 @version 8.0 @source $URL$
|
|