0.5.7A STAC Catalog.
You can access all properties of the given STAC Catalog object directly, e.g. catalog.title.
Extends CatalogLike
(Object)
The STAC Catalog object
((string | null)
= null)
Absolute URL of the STAC Catalog
A STAC Asset or Item Asset Definition.
You can access all properties of the given STAC Asset object directly, e.g., asset.href.
Extends STACReference
(string
= null)
The asset key
((Collection | Item | null)
= null)
The object that contains the asset
Converts an object of STAC Assets into an object of stac-js Assets.
((Collection | Item | null)
= null)
The object that contains the assets
Object<string, Asset>:
Improved Assets
Gets the URL of the asset as absolute URL.
(URI | string | null):
Returns the metadata for the given field name.
Returns the metadata from the asset, if present.
Otherwise, returns the metadata from calling getMetadata() on the STAC entity that contains the asset.
(string)
Field name
any:
The value of the field
Find the RGB bands.
(VisualBands | null):
Object with the RGB bands or null
Returns the band for the given criteria.
Searches the given property (default: name) for the given value(s).
(any)
A single value to find or a list of values to find one of.
(string
= 'name')
The property in the bands to match against.
(Band | null):
Gets the reported statistics for an asset.
Searches through different extension fields in raster, classification, and file.
Statistics:
Gets the reported minimum and maximum values for an asset.
getStatistics()
instead.
Statistics:
Checks whether this asset has a specific role assigned.
boolean:
true
if this asset is one of the given roles (or key),
false
otherwise.
Returns the alternate assets of this asset.
Returns an empty array if no alternate assets are present, e.g. for alternate assets themselves.
(boolean
= false)
If
true
, the parent asset's metadata is merged
into the alternate assets (see
fillAlternate
).
Array<Asset>:
The alternate assets
Returns the full merged metadata for an alternate asset.
The result contains all properties from the parent asset merged with
the alternate asset's own properties (which take precedence).
The alternate key is excluded from the result.
For non-alternate assets, returns a clone without the alternate key.
Asset:
Merged Asset object
Check whether this given object is a STAC Asset.
boolean:
true
if the object is a STAC Asset,
false
otherwise.
Returns whether this asset is an alternate asset.
An alternate asset has another Asset as its context.
boolean:
true
if the asset is an alternate,
false
otherwise.
Returns whether this asset is an Item Asset definition (i.e., doesn't have an href) or not.
boolean:
true
if this asset is an Item Asset definition,
false
otherwise.
Checks whether the asset is accessible via HTTP or HTTPS.
Returns null for item asset definitions, otherwise a boolean value.
(boolean | null):
true
if this asset is available via HTTP or HTTPS,
false
or
null
otherwise.
Returns whether the asset is a preview image (thumbnail / overview).
An asset is a preview if one of the roles is 'thumbnail' or 'overview'. It is also a preview if the key is 'thumbnail' or 'overview'. For alternate assets, delegates to the parent asset.
boolean:
true
if the asset is a preview,
false
otherwise.
A STAC Band.
You can access all properties of the given STAC Band object directly, e.g., band.name.
Extends STACObject
((Collection | Item | Asset | null)
= null)
The object that contains the band
(string)
Returns the STAC entity that contains the band.
(Collection | Item | Asset | null):
Returns the metadata for the given field name.
Returns the metadata from the asset, if present.
Otherwise, returns the metadata from calling getMetadata() on the STAC entity that contains the asset.
(string)
Field name
any:
The value of the field
Gets the reported statistics for a band.
Searches through different extension fields in raster, classification, and file.
Statistics:
Gets the reported minimum and maximum values for a band.
getStatistics()
instead.
Statistics:
Represents a list of children (Catalogs and Collections) as returned by the
/children endpoint of the STAC API - Children extension.
Extends APICollection
(Object)
The STAC API Children object
((string | null)
= null)
Absolute URL of the children endpoint
(Array<(Catalog | Collection)>)
Returns all children.
Array<(Catalog | Collection)>:
All child Catalogs and Collections
Returns a GeoJSON Feature Collection for this STAC object.
Children without a geometry (e.g. Catalogs) are omitted.
((boolean | FixOptions)
= false)
Deprecated, has no effect. Bounding boxes are always split at the antimeridian if needed.
(Object | null):
GeoJSON object or
null
Returns a single 2D bounding box for all the children.
(BoundingBox | null):
Returns the 2D bounding boxes of the children, excluding children without a bounding box (e.g. Catalogs).
Array<BoundingBox>:
Represents an Collections containing Collections.
Extends APICollection
(Object)
The STAC API Collections object
((string | null)
= null)
Absolute URL of the STAC Item Collection
(Array<Collection>)
Returns all collections.
Array<Collection>:
All STAC Collections
Returns a GeoJSON Feature Collection for this STAC object.
((boolean | FixOptions)
= false)
Deprecated, has no effect. Bounding boxes are always split at the antimeridian if needed.
(Object | null):
GeoJSON object or
null
Returns a single 2D bounding box for all the STAC collections.
(BoundingBox | null):
Returns a list of 2D bounding boxes for all the STAC collections.
Array<BoundingBox>:
A STAC Collection.
You can access all properties of the given STAC Collection object directly, e.g. collection.title.
Extends CatalogLike
(Object)
The STAC Collection object
((string | null)
= null)
Absolute URL of the STAC Collection
(string)
(string)
(string)
(string?)
(string)
(string)
(Extent)
Represents an ItemCollection containing Items.
Extends APICollection
(Object)
The STAC Item Collection object
((string | null)
= null)
Absolute URL of the STAC Item Collection
Returns a GeoJSON FeatureCollection for this STAC object.
((boolean | FixOptions)
= false)
If set to
true
or an options object, geometries that cross the antimeridian are fixed (split into multi-geometries).
(Object | null):
GeoJSON object or
null
Returns a single 2D bounding box for all the STAC items.
(BoundingBox | null):
Returns a list of 2D bounding boxes for all the STAC items.
Array<BoundingBox>:
A STAC Item.
You can access all properties of the given STAC Item object directly, e.g. item.id or item.properties.datetime.
Extends STAC
(Object)
The STAC Item object
((string | null)
= null)
Absolute URL of the STAC Item
(string)
(string)
(string)
((Object | null))
(ItemProperties)
(string?)
Returns a GeoJSON Feature for this STAC object.
((boolean | FixOptions)
= false)
If set to
true
or an options object, geometries that cross the antimeridian are fixed (split into multi-geometries).
(Object | null):
GeoJSON object or
null
Returns a single 2D bounding box for the item.
(BoundingBox | null):
Returns 2D bounding boxes for the item.
Array<BoundingBox>:
A STAC Link object.
You can access all properties of the given STAC Link object directly, e.g. link.href.
Extends STACReference
((STAC | null)
= null)
The object that contains the link
(string)
(string)
(string?)
(string?)
(string?)
(Object?)
(boolean?)
Check whether this given object is a STAC LInk.
boolean:
true
if the object is a STAC Link,
false
otherwise.
The GeoJSON media type.
Type: string
All STAC media types (JSON + GeoJSON).
The media type for JSON Schemas (e.g. queryables).
Type: string
All image media types that Web Browsers can show (GIF, JPEG, PNG, WebP).
All Cloud Optimized GeoTiff media types.
All web-optimized GeoZARR media types.
All ZARR media types.
All GeoTiff media types (including COG media types).
All image media types combined (Web Browser + GeoTiff).
Hierarchical relation types used by STAC.
All relation types used by STAC for pagination.
All relation types used by Queryables in STAC and OGC APIs.
All relation types used by Sortables in STAC and OGC APIs.
Protocols supported by browsers (http and https).
Fixes a GeoJSON object (Feature, FeatureCollection or Geometry) so that geometries crossing the antimeridian are split into valid multi-geometries.
Polygons may become MultiPolygons and LineStrings may become MultiLineStrings. Geometries that don't cross the antimeridian are returned (mostly) unchanged, but the winding order may be fixed (unless disabled via the options).
The function does not work in-place, it returns a new object. Nevertheless, some (nested) properties may still be shared with the input object, so the input object should not be altered afterwards.
(Object)
The GeoJSON object to fix.
(FixOptions
= {})
Options for fixing the GeoJSON object.
Object:
The fixed GeoJSON object.
Fix coordinates in a GeoJSON object to be within the CRS range.
Function works in-place.
(Object)
The GeoJSON object to be checked.
Object:
The fixed GeoJSON object.
Returns the segments of a GeoJSON object that are created when splitting its geometries at the antimeridian.
(Object)
The GeoJSON object (Feature, FeatureCollection or Geometry) to segment.
(boolean
= true)
Compute the crossing latitude on the great circle between the two points (see FixOptions).
Object:
A GeoJSON MultiLineString with the segments.
Calculates the bounding box for a (fixed) GeoJSON Polygon or MultiPolygon.
Supports antimeridian-spanning bounding boxes (where the western longitude is larger than the eastern longitude) as per RFC 7946, section 5.2.
(Object)
The GeoJSON Feature, Polygon or MultiPolygon.
(boolean
= false)
Force the bounding box to span the antimeridian.
BoundingBox:
The bounding box ([west, south, east, north]).
Calculates the centroid for a (fixed) GeoJSON Polygon or MultiPolygon.
Handles the antimeridian by calculating the centroid from an identical MultiPolygon with longitudes in [0, 360).
The centroid is area-weighted (as in shapely, which the Python implementation uses), not the mean of the vertices.
(Object)
The GeoJSON Feature or Geometry.
Point:
The centroid ([longitude, latitude]).
Checks whether a given media type is in the list of media types.
boolean:
true
if the media type is allowed,
false
otherwise.
Checks whether the given media type is a STAC media type (JSON or GeoJSON).
boolean:
true
if the media type is a STAC media type,
false
otherwise.
Checks whether a variable is a string and contains at least one character.
(any)
A variable to check.
boolean:
true
is the given variable is a string with length > 0,
false
otherwise.
Computes the size of an array (number of array elements) or object (number of key-value-pairs).
Returns 0 for all other data types.
(any)
number:
The size of the array or object as integer, 0 for other data types.
Ensures a number is between a minimum and maximum value, but with a delta.
(number)
The number to check.
(number)
The minimum value.
(number)
The maximum value.
(number
= 0.00000001)
The delta that the number is allowed to be larger or smaller.
(number | null):
Checks whether a variable is a real object or not.
This is a more strict version of typeof x === 'object' as this example would also succeed for arrays and null.
This function only returns true for real objects and not for arrays, null or any other data types.
(any)
A variable to check.
boolean:
true
is the given variable is an object,
false
otherwise.
Merges any number of arrays of objects.
Array<Object>:
Gets the reported minimum and maximum values for an asset.
getStatistics()
instead.
(StacObject)
Statistics:
Gets the reported statistics for a STAC object.
Searches through different extension fields in raster, classification, and file.
(StacObject)
Statistics:
Computes mean and standard deviation from a raster histogram object.
The histogram must have min, max, count, and buckets fields.
Bucket width is computed as (max - min) / count and each bucket center
is used as a representative value for the weighted calculations.
HistogramStats:
The computed mean and standard deviation, or null if not computable.
Gets the reported no-data values for a STAC Object.
Searches through different extension fields in nodata, classification, and file.
(StacObject)
Array<any>:
A STAC API Collection (i.e. an ItemCollection, a CollectionCollection or a ChildrenCollection)
You can access all properties of the given STAC Catalog object directly, e.g. collection.links.
Don't instantiate this class!
Extends STACHypermedia
(Object)
The STAC API Collection object
((string | null)
= null)
Absolute URL of the STAC Item Collection
Returns the pagination links for this response.
PaginationLinks:
Pagination links
Class for common parts of Catalogs and Collections.
Note that we implement getBoundingBox and getTemporalExtent here, although not defined for STAC catalogs.
This allows us to read those entities from the root catalog, if provided.
In case they are not provided, the methods will just return null as usual.
Don't instantiate this class!
Extends STAC
(Object)
The STAC Catalog or Collection object
((string | null)
= null)
Absolute URL of the STAC Catalog or Collection
Returns a GeoJSON Feature for this STAC Collection.
The Feature contains a Polygon or MultiPolygon based on the given number of valid bounding boxes.
((boolean | FixOptions)
= false)
Deprecated, has no effect. Bounding boxes are always split at the antimeridian if needed.
(Object | null):
GeoJSON object or
null
Returns a single union 2D bounding box for the whole collection.
(BoundingBox | null):
Returns the individual 2D bounding boxes for the collection, without the union bounding box if multiple bounding boxes are given.
Array<BoundingBox>:
Returns all bounding boxes from the collection, including the union bounding box.
Array<BoundingBox>:
Parses a UTC-based ISO8601 date and time string to a Date object.
Does not support timezones as all STAC datetime must be given in UTC.
(any)
(Date | null):
Computes the center datetime between two datetimes.
Date:
center datetime
Computes a single interval from multiple temporal intervals.
(Array<Date> | null):
The merged temporal interval
Returns the center of the STAC entity.
((BoundingBox | null))
(Point | null):
Converts one or more bounding boxes to a GeoJSON Feature.
The Feature contains a Polygon or MultiPolygon based on the given number of valid bounding boxes.
Bounding boxes that cross the antimeridian (i.e. west > east, see RFC 7946, section 5.2) are always split into two polygons at the antimeridian. The antimeridian fix for geometries is NOT applied as whether a bounding box crosses the antimeridian is explicitly encoded (west > east) and must not be inferred from the longitude span as done for geometries. Otherwise, valid bounding boxes that span more than 180 degrees of longitude would be broken up.
((BoundingBox | Array<BoundingBox>))
((boolean | FixOptions)
= false)
Deprecated, has no effect. Bounding boxes are always split at the antimeridian if needed.
(Object | null):
Ensure this is a valid bounding box.
This function will ensure that the given bounding box is valid and otherwise return null.
Longitudes outside of [-180, 180] are wrapped around the antimeridian, e.g. a bounding box of [175, -41, 190, -37] becomes [175, -41, -170, -37]. This may result in a bounding box that crosses the antimeridian (i.e. west > east) as defined by GeoJSON (RFC 7946, section 5.2).
If the bounding box is 3D, the function will return a 2D bounding box unless allow3D is set to true. Doesn't ensure that the bounding box is 3D in case allow3D is set to true.
((BoundingBox | Array<number>))
The bounding box to check.
(boolean
= false)
Whether to return 3D bounding boxes or not. By default all bounding boxes are returned as 2D.
(BoundingBox | null):
Checks whether the given bounding box crosses the antimeridian.
(BoundingBox)
boolean:
Compute the union of a list of bounding boxes.
The function is aware of the antimeridian: input boxes may cross it (west > east) and the returned box may cross it, too, if that yields the smaller extent. Following GeoJSON (RFC 7946, section 5.2), a box crossing the antimeridian is expressed with a western longitude that is larger than the eastern longitude.
The function ignores any invalid bounding boxes or values for the third dimension.
(Array<(BoundingBox | null)>)
(BoundingBox | null):
STAC Hypermedia class for STAC objects.
Don't instantiate this class!
Extends STACObject
Gets the absolute URL of the STAC entity (if provided explicitly or available from the self link).
(string | null):
Absolute URL
Converts a relative URL to an absolute URL based on the given base URL.
(string | URI):
The absolute URL.
Normalizes a URI by resolving it against an optional base URL and removing trailing slashes. Optionally strips query parameters and fragments.
(string | URI):
The normalized URL.
Creates the corresponding object for a object that conforms to the STAC specification.
This creates either a Catalog, a Collection or an Item instance. By default it migrates the data to the latest STAC version, but doesn't update the version number.
(Object)
The STAC object
(boolean
= false)
true
to update the version number (to the latest version),
false
otherwise. Only applies if
migrate
is set to
true
.
(Catalog | Collection | CollectionCollection | ChildrenCollection | Item | ItemCollection):
The created object instance.
Base class for STAC objects.
Don't instantiate this class!
(Object)
The STAC object
Gets the absolute URL of the STAC entity (if provided explicitly or available from the self link).
(string | null):
Absolute URL
Returns a GeoJSON Feature or FeatureCollection for this STAC object.
((boolean | FixOptions)
= false)
If set to
true
or an options object, geometries that cross the antimeridian are fixed (split into multi-geometries).
(Object | null):
GeoJSON object or
null
Returns a single bounding box for the STAC entity.
(BoundingBox | null):
Returns the center of the STAC entity.
(BoundingBox | null):
Returns a list of bounding boxes for the STAC entity.
Array<BoundingBox>:
Check whether this given object is a STAC Item.
boolean:
true
if the object is a STAC Item,
false
otherwise.
Check whether this given object is a STAC Catalog.
boolean:
true
if the object is a STAC Catalog,
false
otherwise.
Check whether this given object is "catalog-like", i.e. a Catalog or Collection.
boolean:
true
if the object is a "catalog-like",
false
otherwise.
Check whether this given object is a STAC Collection.
boolean:
true
if the object is a STAC Collection,
false
otherwise.
Check whether this given object is a STAC ItemCollection.
boolean:
true
if the object is a STAC ItemCollection,
false
otherwise.
Check whether this given object is a STAC Collection of Collections (i.e. API Collections).
boolean:
true
if the object is a STAC CollectionCollection,
false
otherwise.
Check whether this given object is a list of children (i.e. API Children).
boolean:
true
if the object is a STAC ChildrenCollection,
false
otherwise.
Check whether this given object is a STAC reference (i.e. an Asset or a Link).
This is based on the class hierarchy, not on the presence of certain properties such as href.
This means an Item Asset Definition that is an Asset, is also a reference and returns true.
boolean:
true
if the object is a STAC reference,
false
otherwise.
Check whether this given object is a STAC API Collection (i.e. an ItemCollection, a CollectionCollection or a ChildrenCollection).
boolean:
true
if the object is a STAC API Collection,
false
otherwise.
Check whether this given object is a STAC entity (i.e. an Item, a Catalog or a Collection).
boolean:
true
if the object is a STAC entity,
false
otherwise.
Check whether this given object is a STAC Asset.
boolean:
true
if the object is a STAC Asset,
false
otherwise.
Check whether this given object is a STAC Link.
boolean:
true
if the object is a STAC Link,
false
otherwise.
A STAC reference as base for Assets and Links.
Don't instantiate this class!
Extends STACObject
(Object)
The STAC API Collection object
((STAC | null)
= null)
The object that contains the reference
Gets the URL of the reference as absolute URL.
(URI | string | null):
Checks whether a given reference can be displayed by a browser.
A browser can usually display an image if it is a specific file format (e.g. JPEG, PNG, ...) and is served over HTTP(S).
(any
= false)
boolean:
true
if a browser can display the given reference,
false
otherwise.
Check whether this given object is a STAC reference (i.e. an Asset or a Link).
This is based on the class hierarchy, not on the presence of certain properties such as href.
This means an Item Asset Definition that is an Asset, is also a reference and returns true.
boolean:
true
if the object is a STAC reference,
false
otherwise.
Checks whether this entity is a GeoTiff (including COGs).
isType(geotiffMediaTypes)
instead.
boolean:
true
is this entity is a GeoTiff,
false
otherwise.
Checks whether this entity is a COG (excluding pure GeoTiffs).
isType(cogMediaTypes)
instead.
boolean:
true
is this entity is a COG,
false
otherwise.
Checks whether the entity is accessible via HTTP or HTTPS.
Returns null if no URI is available, otherwise a boolean value.
(boolean | null):
true
is this entity is available via HTTP or HTTPS,
false
or
null
otherwise.
Class for STAC spec entities (Item, Catalog and Collection).
Don't instantiate this class!
Extends STACHypermedia
Get the thumbnails from the assets and links in a STAC entity.
If browserOnly is enabled and an asset can't be shown in a browser
(e.g. it is not served over HTTP/S), its alternate assets are checked and
the first alternate asset that a browser can show is returned instead.
Such an asset is merged with the metadata of its parent asset (see
Asset.fillAlternate) and getContext() returns the parent asset.
(boolean
= true)
Return only images that can be shown in a browser natively (PNG/JPG/GIF/WEBP + HTTP/S).
((string | null)
= null)
If not
null
(default), prefers a role over the other. Either
thumbnail
or
overview
.
Array<STACReference>:
Asset or Link
Determines the default GeoTIFF/GeoZARR asset for visualization.
(boolean
= true)
Return only GeoTiffs that can be accessed via HTTP(S)
(boolean
= false)
Return only optimized files (COG/WOZ)
Asset:
Default asset to visualize or
null
if no suitable asset is found.
Ranks the GeoTiff/GeoZarr assets for visualization purposes.
The score factors can be found below:
If httpOnly is enabled and an asset can't be accessed via HTTP(S),
its alternate assets are checked and the first suitable alternate asset
is ranked instead. Such an asset is merged with the metadata of its
parent asset (see Asset.fillAlternate) and getContext() returns the
parent asset.
(boolean
= true)
Return only GeoTiffs that can be accessed via HTTP(S)
(boolean
= false)
Return only optimized files (COG/WOZ)
(STAC~rankGeoFiles
= null)
A function to customize the score by adding/subtracting.
Array<AssetScore>:
GeoTiff/GeoZarr assets sorted by score in descending order.
Find the single-band assets for RGB.
(VisualAssets | null):
Object with the RGB bands or null
Fix GeoJSON geometries that cross the antimeridian (180th meridian / dateline) by splitting them into valid multi-geometries.
This is a JavaScript port of antimeridian-ts by Kris Powell (https://github.com/krisaoe/antimeridian-ts, Apache-2.0), which itself is a port of the Python antimeridian package by Pete Gadomski (https://github.com/gadomski/antimeridian).
Deviations from antimeridian-ts (mostly in favor of the Python implementation):
crossingLatitudeFlat and the joining of split segments
in buildPolygons are fixed to match the Python implementation.Options for fixing GeoJSON.
Type: Object
(boolean?)
: Force the geometry to enclose the north pole.
(boolean?)
: Force the geometry to enclose the south pole.
(boolean?)
: Fix the winding order so that exterior rings are counter-clockwise and holes are clockwise (as per RFC 7946).
(boolean?)
: Compute the latitude at which a segment crosses the antimeridian on the great circle between the two points. If set to
false
, a planar (flat) interpolation is used instead.
(boolean?)
: Reverse the coordinates of LineStrings and Polygons before fixing.
A bounding box (2D oder 3D).
A point (2D or 3D).
A data provider.
Type: Object
Statistics
Type: Object
Computed histogram statistics.
Type: Object
Pagination links.
Type: Object
The RGB bands.
Type: Object
Extents
Type: Object
(SpatialExtent)
: Spatial extents
(TemporalExtent)
: Temporal extents
Spatial Extents
Type: Object
Temporal Extents
Type: Object
Metadata for an item, the item properties.
Type: Object
(string)
: Date and Time
Object with an asset and the corresponding score.
Type: Object
A function that can influence the score.
Returns a relative addition to the score. Negative values subtract from the score.
Type: Function
(Asset)
The asset to calculate the score for.
The single-band assets for RGB composites.
Type: Object