AlignerFeatureCollection
feature_data.AlignerFeatureCollection(
features,
source=None,
id_fieldname=None,
crs=None,
is_reference=False,
)A collection of AlignerFeature objects with spatial indexing and utility properties.
This class manages a group of features, providing high-level access to spatial operations like unary unions and R-tree indexing for fast spatial queries.
Attributes
| Name | Type | Description |
|---|---|---|
| features | dict[InputId, AlignerFeature] |
A dictionary mapping feature IDs to their corresponding AlignerFeature objects. |
| source | dict[str, str] |
Metadata regarding the source of the data. |
| is_reference | bool |
Flag indicating if this collection serves as the reference dataset (enables spatial indexing). |
| crs | (CRS, optional) |
The Coordinate Reference System associated with the collection. |
Notes
When is_reference is set to True, the collection lazily initializes a spatial index ([shapely.strtree.STRtree][]) upon the first access to the tree property.
Examples
>>> collection = AlignerFeatureCollection(features=my_feature_dict, is_reference=True)
>>> # Access the spatial index
>>> index = collection.tree
>>> # Get a union of all geometries
>>> total_area = collection.union.areaMethods
| Name | Description |
|---|---|
| export | Unified export entry point for feature collections. |
| from_geodataframe | Build an AlignerFeatureCollection from a GeoDataFrame. |
| to_gdf | Export the collection as a GeoDataFrame. |
| to_geodataframe | Convert this collection to a GeoDataFrame. |
| to_geojson | Converts the collection into a GeoJSON FeatureCollection format. |
| to_geojson_dict | Export the collection as a GeoJSON-like dictionary. |
| to_geojson_file | Write the collection to a GeoJSON file. |
| to_gpkg | Write the collection to a GeoPackage file. |
| to_parquet | Write the collection to a Parquet file. |
export
feature_data.AlignerFeatureCollection.export(
format,
path=None,
*,
layer=None,
profile='full',
fields=None,
include_geometry=True,
include_metadata=True,
)Unified export entry point for feature collections.
Supported formats: gdf, geojson, json, parquet, gpkg.
from_geodataframe
feature_data.AlignerFeatureCollection.from_geodataframe(
gdf,
*,
id_fieldname,
is_reference=False,
source=None,
)Build an AlignerFeatureCollection from a GeoDataFrame.
to_gdf
feature_data.AlignerFeatureCollection.to_gdf(
profile='full',
fields=None,
include_geometry=True,
)Export the collection as a GeoDataFrame.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| profile | str |
Output profile: minimal, full or analysis. |
'full' |
| fields | list[str] |
Optional whitelist of columns to keep. | None |
| include_geometry | bool |
Whether to keep the geometry column. | True |
to_geodataframe
feature_data.AlignerFeatureCollection.to_geodataframe()Convert this collection to a GeoDataFrame.
Returns
| Name | Type | Description |
|---|---|---|
gpd.GeoDataFrame |
GeoDataFrame with identifier column and geometry. |
to_geojson
feature_data.AlignerFeatureCollection.to_geojson(geom_attributes=False)Converts the collection into a GeoJSON FeatureCollection format.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| geom_attributes | bool |
If True, includes calculated geometric attributes (like area or length) in the feature properties. Defaults to False. | False |
Returns
| Name | Type | Description |
|---|---|---|
FeatureCollection |
A GeoJSON representation of the data. |
to_geojson_dict
feature_data.AlignerFeatureCollection.to_geojson_dict(
profile='full',
fields=None,
include_geometry=True,
geom_attributes=False,
)Export the collection as a GeoJSON-like dictionary.
to_geojson_file
feature_data.AlignerFeatureCollection.to_geojson_file(
path,
*,
profile='full',
fields=None,
include_geometry=True,
)Write the collection to a GeoJSON file.
to_gpkg
feature_data.AlignerFeatureCollection.to_gpkg(
path,
*,
layer='results',
profile='full',
fields=None,
include_geometry=True,
)Write the collection to a GeoPackage file.
to_parquet
feature_data.AlignerFeatureCollection.to_parquet(
path,
*,
profile='full',
fields=None,
include_geometry=True,
)Write the collection to a Parquet file.