aws.osml.features.imaged_feature_property_accessor module
- class aws.osml.features.imaged_feature_property_accessor.ImagedFeaturePropertyAccessor(allow_deprecated: bool = True)[source]
Bases:
object
This class contains utility functions that ensure the property names / values for features derived from imagery are consistently implemented. These specifications are still evolving so the intent is to encapsulate all of the names in this one class so that changes do not ripple through the rest of the software baseline.
- IMAGE_GEOMETRY = 'imageGeometry'
- IMAGE_BBOX = 'imageBBox'
- BOUNDS_IMCORDS = 'bounds_imcoords'
- GEOM_IMCOORDS = 'geom_imcoords'
- DETECTION = 'detection'
- TYPE = 'type'
- COORDINATES = 'coordinates'
- PIXEL_COORDINATES = 'pixelCoordinates'
- find_image_geometry(feature: Feature) Geometry | None [source]
This function searches through the properties of a GeoJSON feature that are known to contain the geometry of the feature in image coordinates. If found an appropriate 2D shape is constructed and returned. Note that this search is conducted in priority order giving preference to the current preferred “imageGeometry” and “bboxGeometry” properties. If neither of those is available and the accessor has been configured to search deprecated properties then the “geom_imcoords”, “detection”, and “bounds_imcoords” properties are searched in that order.
- Parameters:
feature – a GeoJSON feature that might contain an image geometry property
- Returns:
a 2D shape representing the image geometry or None
- update_existing_image_geometries(feature: Feature, geometry: Geometry) None [source]
This function searches through the properties of a GeoJSON feature that are known to contain the geometry of the feature in image coordinates. If found each property is overwritten with information from the geometry provided. Note that for bounding box properties the bounds of the input geometry are used.
- Parameters:
feature – a GeoJSON feature that might contain an image geometry property
geometry – the geometry to set property values for.
- classmethod set_image_geometry(feature: Feature, geometry: Geometry) None [source]
Add or set the “imageGeometry” property for a feature. This is a 2D geometry that supports a variety of types (points, lines, polygons, etc.)
- Parameters:
feature – a GeoJSON feature that will contain the property
geometry – the geometry value