Implements the Projection Extension.
A concrete implementation of ProjectionExtension
on an Asset
that extends the Asset fields to include properties defined in the Projection Extension.
This class should generally not be instantiated directly. Instead, call ProjectionExtension.ext()
on an Asset
to extend it.
If present, this will be a list containing 1 dictionary representing the properties of the owning Item
.
The href
value of the Asset
being extended.
The Asset
fields, including extension properties.
The properties that this extension wraps.
The extension which implements PropertiesExtension can use _get_property
and _set_property
to get and set values on this instance. Note that _set_properties mutates the properties directly.
A concrete implementation of ProjectionExtension
on an Item
that extends the properties of the Item to include properties defined in the Projection Extension.
This class should generally not be instantiated directly. Instead, call ProjectionExtension.ext()
on an Item
to extend it.
The Item
being extended.
The Item
properties, including extension properties.
An abstract class that can be used to extend the properties of an Item
with properties from the Projection Extension. This class is generic over the type of STAC Object to be extended (e.g. Item
, Collection
).
To create a concrete instance of ProjectionExtension
, use the ProjectionExtension.ext()
method. For example:
>>> item: pystac.Item = ... >>> proj_ext = ProjectionExtension.ext(item)
Applies Projection extension properties to the extended Item.
epsg – Code of the datasource. Example: 4326. One of code
and epsg
must be provided.
code – Code of the datasource. Example: “EPSG:4326”. One of code
and epsg
must be provided.
wkt2 – WKT2 string representing the Coordinate Reference System (CRS) that the geometry
and bbox
fields represent
projjson – PROJJSON dict representing the Coordinate Reference System (CRS) that the geometry
and bbox
fields represent
geometry – GeoJSON Polygon dict that defines the footprint of this Item.
bbox – Bounding box of the Item in the asset CRS in 2 or 3 dimensions.
centroid – A dict with members ‘lat’ and ‘lon’ that defines coordinates representing the centroid of the item in the asset data CRS. Coordinates are defined in latitude and longitude, even if the data coordinate system may not use lat/long.
shape – Number of pixels in Y and X directions for the default grid.
transform – The affine transformation coefficients for the default grid
Get or sets the bounding box of the assets represented by this item in the asset data CRS.
Specified as 4 or 6 coordinates based on the CRS defined in the code
, projjson
or wkt2
properties. First two numbers are coordinates of the lower left corner, followed by coordinates of upper right corner, e.g., [west, south, east, north]
, [xmin, ymin, xmax, ymax]
, [left, down, right, up]
, or [west, south, lowest, east, north, highest]
. The length of the array must be 2*n where n is the number of dimensions.
Get or sets coordinates representing the centroid of the item in the asset data CRS.
Coordinates are defined in latitude and longitude, even if the data coordinate system does not use lat/long.
Example:
item.ext.proj.centroid = { 'lat': 0.0, 'lon': 0.0 }
Get or set the code of the datasource.
Added in version 2.0.0 of this extension replacing “proj:epsg”.
Projection codes are identified by a string. The proj library defines projections using “authority:code”, e.g., “EPSG:4326” or “IAU_2015:30100”. Different projection authorities may define different string formats.
Returns the coordinate reference system (CRS) string for the extension.
This string can be used to feed, e.g., rasterio.crs.CRS.from_string
. The string is determined by the following heuristic:
If a code is set, return the code string, else
If wkt2 is set, return the WKT string, else,
If projjson is set, return the projjson as a string, else,
Return None
Get or sets the EPSG code of the datasource.
A Coordinate Reference System (CRS) is the data reference system (sometimes called a ‘projection’) used by the asset data, and can usually be referenced using an EPSG code. If the asset data does not have a CRS, such as in the case of non-rectified imagery with Ground Control Points, epsg
should be set to None
. It should also be set to None
if a CRS exists, but for which there is no valid EPSG code.
Extends the given STAC Object with properties from the Projection Extension.
This extension can be applied to instances of Item
or Asset
.
pystac.ExtensionTypeError – If an invalid object type is passed.
Get or sets a Polygon GeoJSON dict representing the footprint of this item.
This dict should be formatted according the Polygon object format specified in RFC 7946, sections 3.1.6, except not necessarily in EPSG:4326 as required by RFC7946. Specified based on the code
, projjson
or wkt2
fields (not necessarily EPSG:4326). Ideally, this will be represented by a Polygon with five coordinates, as the item in the asset data CRS should be a square aligned to the original CRS grid.
Gets the schema URI associated with this extension.
Gets a list of schema URIs associated with this extension.
Get or sets the PROJJSON string representing the Coordinate Reference System (CRS) that the proj:geometry
and proj:bbox
fields represent
This value is a PROJJSON object. If the data does not have a CRS, such as in the case of non-rectified imagery with Ground Control Points, projjson
should be set to None
. It should also be set to None
if a CRS exists, but for which a PROJJSON string does not exist.
The schema for this object can be found here.
Get or sets the number of pixels in Y and X directions for the default grid.
The shape is an array of integers that represents the number of pixels in the most common pixel grid used by the item’s assets. The number of pixels should be specified in Y, X order. If the shape is defined in an item’s properties it is used as the default shape for all assets that don’t have an overriding shape.
Returns the extended summaries object for the given collection.
Get or sets the the affine transformation coefficients for the default grid.
The transform is a linear mapping from pixel coordinate space (Pixel, Line) to projection coordinate space (Xp, Yp). It is a 3x3 matrix stored as a flat array of 9 elements in row major order. Since the last row is always 0,0,1 it can be omitted, in which case only 6 elements are recorded. This mapping can be obtained from GDAL GetGeoTransform or the Rasterio Transform.
Get or sets the WKT2 string representing the Coordinate Reference System (CRS) that the proj:geometry
and proj:bbox
fields represent
This value is a WKT2 string. If the data does not have a CRS, such as in the case of non-rectified imagery with Ground Control Points, wkt2
should be set to None
. It should also be set to None
if a CRS exists, but for which a WKT2 string does not exist.
Migrate a STAC Object in dict format from a previous version. The base implementation will update the stac_extensions to the latest schema ID. This method will only be called for STAC objects that have been identified as a previous version of STAC. Implementations should directly manipulate the obj dict. Remember to call super() in order to change out the old ‘stac_extension’ entry with the latest schema URI.
A concrete implementation of SummariesExtension
that extends the summaries
field of a Collection
to include properties defined in the Projection Extension.
Get or sets the summary of ProjectionExtension.code
values for this Collection.
Get the summary of ProjectionExtension.epsg
values for this Collection.
Generalized version of Item
, Asset
, or ItemAssetDefinition
alias of TypeVar(‘T’, ~pystac.item.Item, ~pystac.asset.Asset, ~pystac.item_assets.ItemAssetDefinition)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4