Module maxar_platform.ogc
Provides
OGC access to MGP images, footprints, and seamlines. For searching imagery, a streamlined
client that works similar to pystac-client
is included as an alternative to using WFS
GetFeature calls.
References
https://developers.maxar.com/docs/streaming-imagery/ https://developers.maxar.com/docs/streaming-basemap/
Sub-modules
Functions
WebCoverageService(url, version=None, xml=None, cookies=None, timeout=30, auth=None, headers=None)
: wcs factory function, returns a version specific WebCoverageService object
WebFeatureService(url, version='1.0.0', xml=None, parse_remote_metadata=False, timeout=30, username=None, password=None, headers=None, auth=None)
: wfs factory function, returns a version specific WebFeatureService object
@type url: string
@param url: url of WFS capabilities document
@type xml: string
@param xml: elementtree object
@type parse_remote_metadata: boolean
@param parse_remote_metadata: whether to fully process MetadataURL elements
@param headers: HTTP headers to send with requests
@param timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@param auth: instance of owslib.util.Authentication
@return: initialized WebFeatureService object (version dependent)
WebMapService(url, version='1.1.1', xml=None, username=None, password=None, parse_remote_metadata=False, timeout=30, headers=None, auth=None)
: wms factory function, returns a version specific WebMapService object
@type url: string
@param url: url of WFS capabilities document
@type xml: string
@param xml: elementtree object
@type parse_remote_metadata: boolean
@param parse_remote_metadata: whether to fully process MetadataURL elements
@param headers: HTTP headers to send with requests
@param timeout: time (in seconds) after which requests should timeout
@param username: service authentication username
@param password: service authentication password
@param auth: instance of owslib.util.Authentication
@return: initialized WebFeatureService_2_0_0 object
flip_axis_order(bbox)
: Flips a bbox from x,y to y,x and vice versa
Parameters
----------
bbox: list or tuple
A bounding box
Returns
-------
list
A flipped bounding box
Classes
FeatureSearch(base_url, params, limit=200, max_items=None)
: Executes the search and can return results in several formats
Parameters
----------
base_url: str
WFS base URL
params: dict
WFS search parameters
page_size: int, optional
Number of records to fetch when paginating, defaults to 200
max_items: int
Total number of records to fetch
### Methods
`feature_collection(self)`
: Return search results as single FeatureCollection
Yields
------
FeatureCollection
`features(self)`
: Generator returning individual GeoJSON Features
Yields
------
Feature
`pages(self)`
: Generator returning paginated fetches as GeoJSON FeatureCollections
Yields
------
FeatureCollection
WfsSearchClient(base_url, default_typename=None)
: A search client for WFS
This provides a similar interface to `pystac_client` as used by the SDK for Discovery
### Methods
`find(self, cat_id, typename=None)`
: Find a feature by Catalog ID
The field name that stores the Catalog ID can vary so this function is
configured to use the correct field name.
Parameters
----------
cat_id: str
Catalog ID of the image
typename: str
Typename to search, this will be already defined by the class but can be changed
`search(self, query, typename=None, bbox=None, bbox_xy=None, limit=200, max_items=None, **parameters)`
: Initialize a search
Parameters
----------
query: str
CQL query
typename: str
Typename to search. This should already be defined on the class but can be changed if needed.
bbox: list or tuple
Bounding box. Since the WFS layers are in EPSG:4326, the bounding box must follow the defined coordinate
order of longitude, latitude.
bbox_xy: list or tuple
Bounding box in latitude, longitude order for convenience
max_items:
Maximum number of results to fetch
Keywords
--------
Additional keywords are passed through to the WFS GetFeature call as parameters
Notes
-----
While this functions similarly to `pystac-client`, the results are in GeoJSON. `pystac-client` returns
STAC Items either as PySTAC objects or serialized as dictionaries.
Returns
-------
FeatureSearch
The class that executes searches
`typename_to_id(self, typename)`
: