gfwapiclient.resources.datasets.models.request
¶
Global Fishing Watch (GFW) API Python Client - Datasets API Request Models.
Module Contents¶
Classes¶
Request parameters for retrieving SAR fixed infrastructure. |
Data¶
API¶
- gfwapiclient.resources.datasets.models.request.SAR_FIXED_INFRASTRUCTURE_REQUEST_PARAMS_VALIDATION_ERROR_MESSAGE: Final[str] = 'Get SAR fixed infrastructure request parameters validation failed.'¶
- class gfwapiclient.resources.datasets.models.request.SARFixedInfrastructureParams(/, **data: typing.Any)¶
Bases:
gfwapiclient.base.models.BaseModel
Request parameters for retrieving SAR fixed infrastructure.
This model is used to structure the path parameters required for the /v3/datasets/sar-fixed-infrastructure/mvt/{z}/{x}/{y}.pbf endpoint.
- Attributes:
- z (int):
Zoom level for the tiles (from 0 to 9 for the SAR fixed infrastructure dataset). Example: 1.
- x (int):
X index (column) of the tile.
- y (int):
Y index (row) of the tile.
- geometry (Optional[Geometry]):
Optional GeoJSON geometry to filter SAR fixed infrastructure. If provided and z, x, y are not specified, the tile containing the geometry’s bounding box will be used to populate z, x, and y. Example: {“type”: “Polygon”, “coordinates”: […]}.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- classmethod from_tile_or_geometry(*, z: Optional[int] = None, x: Optional[int] = None, y: Optional[int] = None, geometry: Optional[geojson_pydantic.geometries.Geometry] = None) Self ¶
Create an instance SARFixedInfrastructureParams from either tile coordinates or a GeoJSON geometry.
If z, x, or y are missing and a geometry is provided, this calculates the bounding tile that encompasses the geometry and populates the missing z, x, and y values.
- Args:
- z (int):
Zoom level for the tiles (from 0 to 9 for the SAR fixed infrastructure dataset). Example: 1.
- x (int):
X index (column) of the tile.
- y (int):
Y index (row) of the tile.
- geometry (Optional[Geometry]):
Optional GeoJSON geometry to filter SAR fixed infrastructure. If provided and z, x, y are not specified, the tile containing the geometry’s bounding box will be used to populate z, x, and y. Example: {“type”: “Polygon”, “coordinates”: […]}.
- Returns:
- SARFixedInfrastructureParams:
A fully populated SARFixedInfrastructureParams instance.