rslearn.utils.feature¶
feature ¶
GeoJSON-like feature class.
Feature ¶
A GeoJSON-like feature that contains one vector geometry.
Source code in rslearn/utils/feature.py
to_geojson ¶
Returns a GeoJSON dict corresponding to this feature.
to_projection ¶
to_projection(projection: Projection) -> Feature
Converts this Feature to the target projection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
projection
|
Projection
|
the target projection |
required |
Returns:
| Type | Description |
|---|---|
Feature
|
a new Feature in the target projection |
Source code in rslearn/utils/feature.py
from_geojson
staticmethod
¶
from_geojson(projection: Projection, d: dict[str, Any]) -> Feature
Construct a Feature from a GeoJSON encoding.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
projection
|
Projection
|
the projection of the GeoJSON feature |
required |
d
|
dict[str, Any]
|
the GeoJSON feature dict |
required |
Returns:
| Type | Description |
|---|---|
Feature
|
a Feature representing the specified geometry |