cubewerx.stratos

class Stratos:

The CubeWerx Stratos Administration Interface. See the product documentation for an overview of the Stratos product itself.

Stratos( deploymentUrl: str, username: str, password: str, authUrl: str = None, language: str = None)

Create a new Stratos object.

Arguments:
  • deploymentUrl: The URL of a CubeWerx Stratos deployment. E.g., "https://somewhere.com/cubewerx/".
  • username: The username (with an Administrator role) to log in as.
  • password: the password of the specified username.
  • authUrl: The URL of the CubeWerx Stratos Authentication Server to use (e.g., "https://somewhereelse.com/cubewerx/auth"), or None to use the one provided by the specified deployment.
  • language: the user's preferred language(s) as a comma-separated list of RFC 4647 language tags (e.g., "en-CA,en,fr-CA,fr"), or None. Note that currently most of the strings that CubeWerx Stratos produces are available only in English.

If the login is unsuccessful for any reason, a LoginException is raised. The reason can be ascertained by which specific subclass is raised.

Raises:
deploymentUrl: str

The URL of this CubeWerx Stratos deployment. (read-only)

credentials: Credentials

The credentials of the CubeWerx Stratos administration user that we're logged in as. (read-only)

serverVersion: str

The x.y.z version number of the CubeWerx Stratos Geospatial Data Server. (read-only)

serverVersionFull: str

The full version string of the CubeWerx Stratos Geospatial Data Server. (read-only)

licenseExpirationDate: datetime.date | None

The license expiry date of the CubeWerx Stratos Geospatial Data Server, or None if the license has no expiry date. (read-only)

language: str | None

The user's preferred language(s) as a comma-separated list of RFC 4647 language tags (e.g., "en-CA,en,fr-CA,fr"), or None. Note that currently most of the strings that CubeWerx Stratos produces are available only in English.

commonRequestHeaders: dict

The HTTP headers that must be added to manually-crafted admin API or OGC API server requests in order to pass the correct credentials and language preferences, etc. (read-only)

def getStats( self, nPeriods: int = 24, nSecondsPerPeriod: int = 3600) -> Stats:

Fetch current system statistics.

Arguments:
  • nPeriods: The number of time periods to return in the nActiveUsers list.
  • nSecondsPerPeriod: The duration in seconds of each time period in the nActiveUsers list.
Returns:

A Stats object providing current system statistics.

def getRequestHistory(self, maxPeriods: int = 24) -> RequestHistory:

Fetch a summary of the recent request history.

Arguments:
  • maxPeriods: The maximum number of time periods (typically but not necessarily months, depending on configuration) to return.
Returns:

A summary of the recent request history.

def getLoginHistory( self, username: str | None = None, ipAddress: str | None = None, fromTime: datetime.datetime | None = None, toTime: datetime.datetime | None = None, order: str = 'forward', num: int = 100) -> list[LoginHistoryEntry]:

Fetch a login history.

Arguments:
  • username: The CwAuth user to fetch the login history of, or None to fetch the login history of all users.
  • ipAddress: The IP address to fetch the login history of, or None to fetch the login history of all IP addresses. If an IPv4 address with less than four octets is specified, it matches all IP address beginning with the specified octets.
  • fromTime: The start date and time inclusive (in the server's time zone) of the login history to fetch, or None to fetch back indefinitely.
  • toTime: The end date and time inclusive (in the server's time zone) of the login history to fetch, or None to fetch to the current time.
  • order: The chronological order of the returned entries, one of "forward" or "reverse".
  • num: The maximum number of most-recent entries to return.
Returns:

A list of LoginHistoryEntry objects.

def getConfigParams(self) -> dict[str, ConfigParam]:

Fetch the available configuration parameters and their values.

Returns:

A dictionary mapping configuration parameter names to ConfigParam objects.

def getAuthUsers(self, usernames: list = None) -> list[AuthUser]:

Fetch a list of CwAuth users.

Arguments:
  • usernames: A list of usernames to fetch, or None/[] to fetch all users. If specified, the users will be returned in the specified order. If a specified username doesn't exist, it's omitted from the returned list.
Returns:

The list of all or selected CwAuth users of the Stratos Geospatial Data Server.

def getAuthUser(self, username: str) -> AuthUser | None:

Fetch the specified CwAuth user.

Arguments:
  • username: a username
Returns:

The CwAuth user with the specified username, or None if no such user exists.

def addOrReplaceAuthUser(self, user: AuthUser) -> bool:

Add a new CwAuth user to the Stratos Geospatial Data Server. If a user with the same username already exists, that user's definition is replaced.

Arguments:
  • user: A CwAuth user definition. Must have an e-mail address and a password set.
Returns:

True if an existing user was replaced, or False if a new user was added.

def updateAuthUser(self, user: AuthUser):

Commit a CwAuth user update to the Stratos Geospatial Data Server. The intended flow is 1) fetch the definition of a user with Stratos.getAuthUsers() or Stratos.getAuthUser(), 2) update one or more properties of that user, and 3) call this method to commit those changes.

Arguments:
  • user: A modified CwAuth user definition.
def removeAuthUser(self, user: AuthUser | str) -> bool:

Remove the specified CwAuth user from the Stratos Geospatial Data Server. The special "admin" user cannot be removed.

Note that if this AuthUser is in an AuthUser list that was fetched via a call to Stratos.getAuthUsers(), the object isn't automatically removed from the list. It's up to the caller to do that if necessary.

Arguments:
  • user: A CwAuth user definition or username.
Returns:

True if the user was removed, or False if the user didn't exist.

def getRoles(self, roleNames: list = None) -> list[Role]:

Fetch a list of roles.

Arguments:
  • roleNames: A list of role names to fetch, or None/[] to fetch all roles; if specified, the roles will be returned in the specified order. If a specified role name doesn't exist, it's omitted from the returned list.
Returns:

The list of all or selected roles of the Stratos Geospatial Data Server.

def getRole(self, roleName: str) -> Role | None:

Fetch the specified role.

Arguments:
  • roleName: A role name.
Returns:

The role with the specified name, or None if no such role exists.

def addOrReplaceRole(self, role: Role) -> bool:

Add a new role to the Stratos Geospatial Data Server. If a role with the same name already exists, that role's definition is replaced.

Arguments:
  • role: A role definition.
Returns:

True if an existing role was replaced, or False if a new role was added.

def updateRole(self, role: Role):

Commit a CwAuth role update to the Stratos Geospatial Data Server. The intended flow is 1) fetch the definition of a role with Stratos.getRoles() or Stratos.getRole(), 2) update one or more properties of that role, and 3) call this method to commit those changes.

Arguments:
  • role: A modified role definition.
def removeRole(self, role: Role | str) -> bool:

Remove the specified role from the Stratos Geospatial Data Server. Built-in roles such as "Administrator" cannot be removed. (This can be checked with role.isBuiltin.)

Arguments:
  • role: A role definition or role name.
Returns:

True if the role was removed, or False if the role didn't exist.

def getApiKeys(self) -> list[ApiKey]:

Fetch the list of API keys.

Returns:

The list of all API keys of the Stratos Geospatial Data Server.

def getApiKey(self, key: str) -> ApiKey | None:

Fetch the specified API key.

Arguments:
  • key: An API key string.
Returns:

The API key with the specified key string, or None if no such API key exists.

def addOrReplaceApiKey(self, apiKey: ApiKey) -> bool:

Add a new API key to the Stratos Geospatial Data Server. If an API key with the same key string already exists, that API key's definition is replaced. If apiKey.key isn't set, the server will auto-generate a key string and set apiKey.key accordingly.

Arguments:
  • apiKey: An API key definition.
Returns:

True if an existing API key was replaced, or False if a new API key was added.

def updateApiKey(self, apiKey: ApiKey):

Commit an API key update to the Stratos Geospatial Data Server. The intended flow is 1) fetch the definition of an API key with Stratos.getApiKeys() or Stratos.getApiKey(), 2) update one or more properties of that API key, and 3) call this method to commit those changes.

Arguments:
  • apiKey: A modified API key definition.
def removeApiKey(self, apiKey: ApiKey | str) -> bool:

Remove the specified API key from the Stratos Geospatial Data Server.

Arguments:
  • apiKey: An API key definition or key string.
Returns:

True if the API key was removed, or False if the API key didn't exist.

def getQuotas(self) -> list[Quota]:

Fetch the list of quotas.

Returns:

The list of the current quotas that are in place in the Stratos Geospatial Data Server.

def getQuota(self, id: str) -> Quota | None:

Fetch the specified quota.

Arguments:
  • id: A quota ID.
Returns:

The quota with the specified ID, or None if no such quota exists.

def addQuota( self, identityType: QuotaIdentityType, identity: str, field: QuotaField, service: str, operation: str, granularity: QuotaGranularity, limit: int, usage: int = 0) -> Quota:

Add a new quota. Note that quotas are not active unless the value of the audit.quotas.enable configuration parameter is set to true.

Arguments:
  • identityType: The type of identity that this quota is on.
  • identity: The identity (username, role or API key) that this quota is on. The specified username, role or API key must exist.
  • field: The thing being quotad.
  • service: The service (as known by CubeWerx Stratos Analytics) that this quota applies to. E.g., "WMS", "WMTS", "WCS", "WFS", "WPS", "CSW", or "*" if the quota applies to all services.
  • operation: The operation (as known by CubeWerx Stratos Analytics) that this quota applies to. (e.g., "GetMap", "GetFeature"), or "*" if the quota applies to all operations.
  • granularity: The granularity of this quota (i.e., what unit of time it applies to).
  • limit: The limit that this quota imposes.
  • usage: The current usage (which will be automatically reset at the beginning of every unit of time specified by the granularity field).
Returns:

The new quota.

def updateQuota( self, quota: Quota | str, limit: int | None = None, usage: int | None = None):

Update the limit and/or usage of a quota.

Arguments:
  • quota: A Quota object or ID.
  • limit: The new limit that this quota imposes, or None to not change.
  • usage: The new current usage (which will be automatically reset at the beginning of every unit of time specified by the granularity field), or None to not change.
def removeQuota(self, quota: Quota | str) -> bool:

Remove the specified quota from the Stratos Geospatial Data Server.

Arguments:
  • quota: A Quota object or ID.
Returns:

True if the quota was removed, or False if the quota didn't exist.

def getCubestorDatabases(self) -> list[CubestorDatabase]:

Fetch the list of CubeSTOR database details.

Returns:

The list of all CubeSTOR databases of the Stratos Geospatial Data Server.

def getCubestorDatabase(self, name: str) -> CubestorDatabase | None:

Fetch the details of the specified CubeSTOR database.

Arguments:
  • name: A CubeSTOR database name.
Returns:

The details of the CubeSTOR database with the specified name, or None if no such database exists.

def addCubestorDatabase( self, name: str, title: str | None = None, description: str | None = None) -> CubestorDatabase:

Add a new CubeSTOR database to the Stratos Geospatial Data Server.

Arguments:
  • name: The name of the CubeSTOR database name to create. The name must be no longer than 64 characters, and must not contain a backtick or a slash. There are a few other restrictions as well; CubestorDatabase.isValidName() can be called to check the validity of a name.
  • title: The title of the database, or None.
  • description: A short description of the database, or None.
Returns:

The new CubeSTOR database details.

def updateCubestorDatabase( self, cubestorDatabase: CubestorDatabase | str, title: str | None = None, description: str | None = None):

Update the title and/or description of a CubeSTOR database.

Arguments:
  • cubestorDatabase: A CubeSTOR database details object or database name.
  • title: the new title of the database, "" to clear the title, or None to not change.
  • description: The new short description of the database, "" to clear the description, or None to not change.
def removeCubestorDatabase(self, cubestorDatabase: CubestorDatabase | str) -> bool:

Remove the specified CubeSTOR database from the Stratos Geospatial Data Server. WARNING: This will remove any and all data that has been loaded into this database. Some databases cannot be removed (determinable by the canDelete property of the CubestorDatabase object). One such situation is if the CubeSTOR database is currently the source of of a data store. In this situation, the database must first be removed as the source of the data store (e.g., by setting dataStore.source to None and then calling dataStore.commitUpdates(), or by calling Stratos.removeDataStore()).

Note that if this CubestorDatabase is in a CubestorDatabase list that was fetched via a call to Stratos.getCubestorDatabases(), the object isn't automatically removed from the list. It's up to the caller to do that if necessary.

Arguments:
  • cubestorDatabase: A CubeSTOR database details object or database name.
Returns:

True if the CubeSTOR database was removed, or False if the CubeSTOR database didn't exist.

def getDataStores(self) -> list[DataStore]:

Fetch the list of CubeWerx Stratos data stores. A data store is a data source (dataset) that's exposed as a set of web services with full access control, etc.

Returns:

The list of all data stores of the Stratos Geospatial Data Server.

def getDataStore(self, id: str) -> DataStore | None:

Fetch the specified CubeWerx Stratos data store.

Arguments:
  • id: a data store ID
Returns:

The CubeWerx Stratos data store with the specified ID, or None if no such data store exists.

def addOrReplaceDataStore(self, dataStore: DataStore) -> bool:

Add a new data store to the Stratos Geospatial Data Server. If a data store with the same ID already exists, that data store's definition is replaced.

Arguments:
  • dataStore: A data store definition. Must have a data store type and source set.
Returns:

True if an existing data store was replaced, or False if a new data store was added.

def updateDataStore(self, dataStore: DataStore):

Commit data store updates to the Stratos Geospatial Data Server. This is the same as calling DataStore.commitUpdates(). The intended flow is 1) fetch the definition of a data store with Stratos.getDataStores() or Stratos.getDataStore(), 2) update one or more properties of that data store, and 3) call this method (or DataStore.commitUpdates()) to commit those changes.

Arguments:
  • dataStore: A modified data store definition.
def removeDataStore(self, dataStore: DataStore | str) -> bool:

Remove the specified data store from the Stratos Geospatial Data Server. Some data stores cannot be removed (determinable by the canDelete property of the DataStore object).

Note that if this DataStore is in a DataStore list that was fetched via a call to Stratos.getDataStores(), the object isn't automatically removed from the list. It's up to the caller to do that if necessary.

Arguments:
  • dataStore: A data store definition or ID.
Returns:

True if the data store was removed, or False if the data store didn't exist.

def getProcessingAcrs(self) -> list[AccessControlRule]:

Fetch the access control rules that are currently in place for the processing server (i.e., the OGC WPS and the "OGC API - Processes" endpoints. These access control rules can be modified and then sent back to the server with a call to setProcessingAcrs.

Returns:

The access control rules that are currently in place for the processing server (i.e., the OGC WPS and the "OGC API - Processes" endpoints).

def setProcessingAcrs( self, accessControlRules: list[AccessControlRule] | None):

Set the access control rules for the processing server (i.e., the OGC WPS and the "OGC API - Processes" endpoints). These access control rules must not refer to any content, and must not have any "except" clauses. The only operation classes they should grant are EXECUTE_PROCESS and MANAGE_PROCESSES.

Arguments:
  • accessControlRules: The new set of access control rules to put in place for the processing server (i.e., the OGC WPS and the "OGC API - Processes" endpoints).
def getCatalogues(self) -> list[Catalogue]:

Fetch the list of CubeWerx Stratos catalogues.

Returns:

The list of all catalogues of the Stratos Geospatial Data Server.

def getCatalogue(self, id: str) -> Catalogue | None:

Fetch the specified CubeWerx Stratos catalogue.

Arguments:
  • id: a catalogue ID
Returns:

The CubeWerx Stratos catalogue with the specified ID, or None if no such catalogue exists.

def addCatalogue( self, id: str, title: MultilingualString | str | None = None, description: MultilingualString | str | None = None, keywords: list[str] | None = None, accessControlRules: list[AccessControlRule] = [], blocking: bool = False, showProgress: bool = False) -> Catalogue | Job:

Add a new catalogue to the Stratos Geospatial Data Server.

Arguments:
  • id: The ID to give the catalogue. The Stratos Geospatial Data Server must not already have a catalogue with this ID. The ID must be no longer than 64 characters, and must not contain a backtick or a slash. There are a few other restrictions as well; Catalogue.isValidId() can be called to check the validity of an ID.
  • title: A title to give the catalogue, or None.
  • description: A brief textual description to give the catalogue, or None.
  • keywords: A set of searcheable keywords for the catalogue, or None.
  • accessControlRules: The set of access control rules to put in put in place for the catalogue. Each rule must have exactly one "grant" clause and no "except" clauses. The one "grant" clause must not refer to any content, and must not list operation classes other than GET_RECORD, INSERT_RECORD, UPDATE_RECORD, DELETE_RECORD and HARVEST_RECORDS.
  • blocking: If False, the method will return immediately with a Job object and the creation of the catalogue will proceed concurrently. The progress of the catalogue creation can be monitored through the returned Job object. If True, the method won't return until the catalogue is fully created (useful for scripting), in which case a Catalogue object is returned.
  • showProgress: Whether or not to report the catalogue-creation progress to stdout. Only relevant if blocking=True.
Returns:

A job (that can be monitored for progress), or a Catalogue object representing the new catalogue if blocking was specified as True.

def updateCatalogue(self, catalogue: Catalogue):

Commit catalogue updates to the Stratos Geospatial Data Server. This is the same as calling Catalogue.commitUpdates(). The intended flow is 1) fetch the definition of a catalogue with Stratos.getCatalogues() or Stratos.getCatalogue(), 2) update one or more properties of that catalogue, and 3) call this method (or Catalogue.commitUpdates()) to commit those changes.

Arguments:
  • catalogue: A catalogue.
def removeCatalogue(self, catalogue: Catalogue | str) -> bool:

Remove the specified catalogue from the Stratos Geospatial Data Server.

Note that if this Catalogue is in a Catalogue list that was fetched via a call to Stratos.getCatalogues(), the object isn't automatically removed from the list. It's up to the caller to do that if necessary.

Arguments:
Returns:

True if the catalogue was removed, or False if the catalogue didn't exist.

def getCacheSummaries(self) -> list[CacheSummary]:

Fetch the current usage summaries of the Stratos server cache, broken down by category.

Returns:

The current usage summaries of the Stratos server cache.

def clearCache(self, category: str | None = None):

Clear the Stratos server cache.

Arguments:
  • category: the specific category to clear (e.g., "wmtsCapabilities"), or None for all.
class AccessControlRule:

A CubeWerx Access Control Rule.

A rule grants whatever is specified by the "grant" clauses minus whatever is specified by the "except" clauses.

AccessControlRule(jsonRep: dict = {})

Create a new access control rule.

Arguments:
  • jsonRep: A dictionary supplying properties. Do not specify; for internal use only.
appliesTo: list[str]

The identities that this rule applies to. A specific syntax is required for each identity. E.g., "cwAuth{*}", "cwAuth{jsmith}", "cwAuth{%Analyst}", "oidConnect{mySub@https://myIssuer.com}", "oidConnect{https://myIssuer.com}", "ipAddress{20.76.201.171}", ipAddress{20.76.201}", "everybody".

expiresAt: datetime.datetime | None

When this rule expires, or None for never. After this date and time, the rule ceases to grant access.

grants: list[AccessControlRuleClause]

The clauses that indicate what's being granted by this rule.

excepts: list[AccessControlRuleClause]

The clauses that indicate exceptions to what's being granted by this rule. Note that these clauses do not revoke any access that may be granted by another rule.

class AccessControlRuleClause:

A CubeWerx Access Control Rule Clause.

There are two types of rule clauses: "grant" and "except". A "grant" clause specifies the operation classes that are being granted, and the content that is being granted for those operations. If no operation classes are specified, it means "all operations". Similarly, if no content is specified, it means "all content".

An "except" clause specifies exceptions to what's being granted by the rule. It does not cause the rule to revoke any access that may be granted by another rule.

AccessControlRuleClause(jsonRep: dict = {})

Create a new access control rule clause.

Arguments:
  • jsonRep: A dictionary supplying properties; do not specify; for internal use only.
operationClasses: list[OperationClass]

The operation classes that are being granted (or excepted in the case of an "except" clause). If empty, all operation classes are granted (or excepted).

content: list[ContentRef]

The content that's being granted (or excepted in the case of an "except" clause). If empty, all content is granted (or excepted).

class ApiKey:

An API key.

To create a new API key, create a new ApiKey object (either specifying the desired key string or letting the server auto-generate one for you), set any other desired properties, and call Stratos.addOrReplaceApiKey().

To change the details of an existing API key, fetch the ApiKey object via Stratos.getApiKeys() or Stratos.getApiKey(), update one or more properties of tha API key, and call Stratos.updateApiKey() object to commit those changes.

To remove an API key, call Stratos.removeApiKey().

ApiKey(key: str = None, dictionary: dict = {})

Create a new ApiKey object.

Arguments:
  • key: The desired API key string, or ""/None to let the server auto-generate one. An API key string cannot contain a "/" character.
  • dictionary: A dictionary supplying properties. Do not specify; for internal use only.
key

The API key string. (read-only)

description: str | None

A brief textual description of this API key, or None.

contactEmail: str | None

The e-mail address to contact regarding this API key, or None.

expiresAt: datetime.datetime | None

The date and time (UTC) that this API key expires (after which time it's effectively disabled), or None if this API key never expires.

isEnabled: bool

Is this API key enabled (subject to expiresAt)?

class AreaSource:

A reference to a source of polygons, multi-surfaces and/or envelopes to be used for access control.

AreaSource( urlOrFilePath: str | None = None, format: str | None = None, where: str = None)

Create a new area-source reference.

Arguments:
  • urlOrFilePath: A URL or local file path (absolute or relative to the server URL or directory) to the source, or None (but then required to be set via the property).
  • format: The name of the convert-library driver that should be used to read this source (e.g., "GeoJSON", "shape"), or None. If None, an attempt will be made to sniff the format.
  • where: A CQL2 WHERE clause filter to select a subset of the geometries, or None to apply no filter.
urlOrFilePath: str | None

A URL or local file path (absolute or relative to the server URL or directory) to the source, or None.

format: str | None

The name of the convert-library driver that should be used to read this source (e.g., "GeoJSON", "shape"), or None. If None, an attempt will be made to sniff the format.

where: str | None

A CQL2 WHERE clause filter to select a subset of the geometries, or None to apply no filter.

class AuthUser:

A CubeWerx Stratos CwAuth user account.

To create a new CubeWerx Stratos CwAuth user, create a new AuthUser object (specifying the desired username), set the required e-mail address and password for the user, set any other desired properties, and call Stratos.addOrReplaceAuthUser().

To change the details of an existing CubeWerx Stratos CwAuth user account, fetch the AuthUser object via the Stratos.getAuthUsers() or Stratos.getAuthUser(), update one or more properties of that user, and call Stratos.updateAuthUser() to commit those changes.

To remove a CubeWerx Stratos CwAuth user account, call Stratos.removeAuthUser().

AuthUser(username: str = None, dictionary: dict = {})

Create a new AuthUser object.

Arguments:
  • username: The user's username. Each CubeWerx Stratos CwAuth user account must have a unique username. Required unless supplied via the dictionary parameter.
  • dictionary: A dictionary supplying properties. Do not specify; for internal use only.
username: str

The unique username of this CubeWerx Stratos CwAuth user account. (read-only)

firstName: str | None

The first (given) name of this CubeWerx Stratos CwAuth user account (possibly also with middle name(s) and/or initial(s)), or None.

lastName: str | None

The last (family) name (i.e., surname) of this CubeWerx Stratos CwAuth user account, or None.

displayName: str

An appropriate name to display for this CubeWerx Stratos CwAuth user account, either the user's first and/or last name if set, or the user's username otherwise. (read-only)

emailAddress: str | None

The e-mail address of this CubeWerx Stratos CwAuth user account, or None.

roles: list[str]

The list of roles that this CubeWerx Stratos CwAuth user account has. These are the role names only. To get the full Role objects (for descriptions, etc.), pass this list to Stratos.getRoles(). This list of roles can be re-specified with a user.roles = [...] assignment. However, to add or remove a role to/from the existing list, use AuthUser.addRole() or AuthUser.removeRole() rather than user.roles.append() or user.roles.remove().

def addRole(self, roleName: str):

Add a role to this CubeWerx Stratos CwAuth user account.

Arguments:
  • roleName: The name of the role to add to this CubeWerx Stratos CwAuth user account. The specified role must exist. If the user already has this role, this is a no-op.
def removeRole(self, roleName: str):

Remove a role from this CubeWerx Stratos CwAuth user account.

Arguments:
  • roleName: The name of the role to remove (revoke) from this CubeWerx Stratos CwAuth user account. If the user doesn't have this role, this is a no-op.
maxSeats: int | None

The maximum number of times this CubeWerx Stratos CwAuth user account can be logged in, or None.

isEditable: bool

Is this CubeWerx Stratos CwAuth user allowed to edit their own information?

isEnabled: bool

Is this CubeWerx Stratos CwAuth user account enabled (i.e., can users sign in with this account)?

password: str | None

The password for this CubeWerx Stratos CwAuth user account, or None. Note that none of the user information returned by Stratos.getAuthUsers() or Stratos.getAuthUser() will include a password. However, a password must be set when calling Stratos.addOrReplaceAuthUser().

@staticmethod
def isValidUsername(username: str) -> bool | str:

Whether or not the specified username is a valid username for a CwAuth user. WARNING: This will return a string (not False) if the username is not valid, so be sure test with "is True" or "is not True".

Arguments:
  • username: The username to test.
Returns:

True if the specified username is a valid username for a CwAuth user, or a short string describing why it isn't.

class CacheSummary:

The current usage summary of a specific category of the Stratos server cache.

category: str

The Stratos server cache category that this usage summary represents. (read-only)

nEntries: int

The number of entries in this category. (read-only)

nDiskBytes: int

The disk usage (in bytes) of this category. (read-only)

class Catalogue:

A CubeWerx Stratos catalogue.

Do not instantiate directly. To get a list of catalogues or a specific catalogue, call Stratos.getCatalogues() or Stratos.getCatalogue() respectively. To create a new catalogue, call Stratos.addCatalogue().

To change the details of an existing catalogue, update one or more properties of the Catalogue object and call Catalogue.commitUpdates() or Stratos.updateCatalogue() to commit those changes.

To remove a catalogue, call Stratos.removeCatalogue().

id: str

The unique ID of this CubeWerx Stratos catalogue. (read-only)

title: MultilingualString | None

The title of this catalogue, or None.

description: MultilingualString | None

A brief textual description of this catalogue, or None.

keywords: list[str]

A set of searcheable keywords for the catalogue.

nRecords: int

The number of records that are in this catalogue. (read-only)

harvestedUrls: list[HarvestedUrl]

The URLs that this catalogue has harvested. (read-only)

accessControlRules: list[AccessControlRule]

The set of access control rules for this catalogue. Each rule must have exactly one "grant" clause and no "except" clauses. The one "grant" clause must not refer to any content, and must not list operation classes other than GET_RECORD, INSERT_RECORD, UPDATE_RECORD, DELETE_RECORD and HARVEST_RECORDS. Like most of the other Catalogue properties, this can be adjusted, but adjustments will not be commited to the server until Catalogue.commitUpdates() or Stratos.updateCatalogue() is called.

def commitUpdates(self):

Commit catalogue updates to the Stratos Geospatial Data Server.

def harvest( self, url: str, resourceType: HarvestResourceType, blocking: bool = False, showProgress: bool = False) -> HarvestedUrl | Job:

Harvests (or reharvests) the resource(s) at the specified URL.

Note that if blocking is specified as False, the nRecords and harvestedUrls properties will not get automatically updated. The updateFromServer() method can be called after the job is complete to update these properties to their new values.

Arguments:
  • url: The URL to (re)harvest. This can also be an absolute path in the server's filesystem.
  • resourceType: The expected resource type.
  • blocking: If False, the method will return immediately with a Job object and the harvest operation will proceed concurrently. The progress of the harvest can be monitored through the returned Job object. If True, the method won't return until the harvest is complete (useful for scripting), in which case True is returned.
  • showProgress: Whether or not to report the progress of the harvest to stdout. Only relevant if blocking=True.
Returns:

A job (that can be monitored for progress), or the resulting HarvestedUrl if blocking was specified as True.

def unharvest(self, harvestedUrl: HarvestedUrl | str):

Unharvests the resource(s) that were harvested from the specified URL.

Arguments:
  • harvestedUrl: A HarvestedUrl object or ID (note: not the actual URL).
def updateFromServer(self):

Updates the properties to match their new actual values. This is useful, for example, after performing a non-blocking harvest().

Returns:

True if successful, or False if this catalogue no longer exists.

@staticmethod
def isValidId(id: str) -> bool | str:

Whether or not the specified ID is a valid ID for a catalogue. WARNING: This will return a string (not False) if the ID is not valid, so be sure test with "is True" or "is not True".

Arguments:
  • id: The ID to test.
Returns:

True if the specified ID is a valid ID for a catalogue, or a short string describing why it isn't.

class ConfigParam:

The details of a CubeWerx Stratos configuration parameter.

name: str

The name of this configuration parameter. (read-only)

description: str | None

A description of this configuration parameter, or None. (read-only)

The type of this configuration parameter. (read-only)

range: list[str]

The list of allowed case-insensitive values of this configuration parameter if of type ENUMERATED, or None otherwise. (read-only)

isGlobal: bool

Whether or not this is a global configuration parameter that affects all deployments. (read-only)

defaultValueStr: str

The string representation of the default value of this configuration parameter. (read-only)

defaultValue

The default value of this configuration parameter, expressed as the appropriate Python type according to the following table:

Config Param Type    Python type
-----------------    -----------
BOOLEAN              bool
NUMBER               float (can be math.inf)
STRING               str
PASSWORD             str
PERCENTAGE           float (0..100)
URL                  str
DURATION             float (in seconds)
ENUMERATED           str
MULTILINGUAL_STRING  cubewerx.stratos.MultilingualString
STRING_LIST          list[str]
STRING_MAP           dict[str,str]
JSON                 bool|int|float|str|list|dict

(read-only)

explicitValueStr: str | None

The string representation of the value that's explicitly set for this configuration parameter, or None if the default value is active. Setting this (or clearing it by setting it to None) will automatically update the server.

explicitValue

The value that's explicitly set for this configuration parameter, expressed as the appropriate Python type, or None if the default value is active. Setting this (or clearing it by setting it to None) will automatically update the server.

Config Param Type    Python type
-----------------    -----------
BOOLEAN              bool
NUMBER               float (can be math.inf)
STRING               str
PASSWORD             str
PERCENTAGE           float (0..100)
URL                  str
DURATION             float (in seconds)
ENUMERATED           str
MULTILINGUAL_STRING  cubewerx.stratos.MultilingualString
STRING_LIST          list[str]
STRING_MAP           dict[str,str]
JSON                 bool|int|float|str|list|dict
class ConfigParamType(enum.StrEnum):

An enumeration of the configuration parameter types.

BOOLEAN = <ConfigParamType.BOOLEAN: 'Boolean'>
NUMBER = <ConfigParamType.NUMBER: 'Number'>
STRING = <ConfigParamType.STRING: 'String'>
PASSWORD = <ConfigParamType.PASSWORD: 'Password'>
PERCENTAGE = <ConfigParamType.PERCENTAGE: 'Percentage'>
URL = <ConfigParamType.URL: 'URL'>
DURATION = <ConfigParamType.DURATION: 'Duration'>
ENUMERATED = <ConfigParamType.ENUMERATED: 'Enumerated'>
MULTILINGUAL_STRING = <ConfigParamType.MULTILINGUAL_STRING: 'MultilingualString'>
STRING_LIST = <ConfigParamType.STRING_LIST: 'StringList'>
STRING_MAP = <ConfigParamType.STRING_MAP: 'StringMap'>
JSON = <ConfigParamType.JSON: 'JSON'>
class ContentRef:

The content that's being granted (or excepted in the case of an "except" clause).

Within a "grant" clause, content is all-inclusive by default. That is, if no spatial area is specified, it means "everywhere", if no feature filters are specified, it means "all features", and if no property names are specified, it means "all properties". Within an "except" clause, however, content is all-inclusive by default only if it's empty (other than the required "name" property). Otherwise it only includes (excepts) the mentioned thing(s).

ContentRef(name: str = None, jsonRep: dict = {})

Create a new content reference.

Arguments:
  • name: The name/ID of the feature set, layer or process that's being granted (or excepted in the case of an "except" clause), or "*" for all. Required unless supplied via the jsonRep parameter.
  • jsonRep: a dictionary supplying properties. Do not specify; for internal use only.
name: str

The name/ID of the feature set, layer or process that's being granted (or excepted in the case of an "except" clause), or "*" for all.

areas: list[geojson.geometry.Polygon | AreaSource]

The spatial areas that are being granted (or excepted in the case of an "except" clause).

minScaleDenominator: float | None

The level of detail to grant access to, expressed as a minimum scale denominator (e.g., a minimum scale denominator of 100000 indicates that no detail finer than a scale of 1/100000 should be granted), or None to not limit level of detail in this way. The lower the specified number, the more detail is granted. This is mutually exclusive with the finestResolution property. I.e., setting this property, even to None, automatically sets the finestResolution property to None.

finestResolution: dict | None

The level of detail to grant access to, expressed as a dictionary with a "resolution" field indicating a resolution (i.e., units per pixel) and a "crs" field indicating the coordinate reference system that the resolution should be interpreted with respect to (e.g., { "resolution": 10000, "crs": "EPSG:3857" }), or None to not limit level of detail in this way. The lower the specified number, the more detail is granted. This is mutually exclusive with the minScaleDenominator property I.e., setting this property, even to None, automatically sets the minScaleDenominator property to None.

where: str | None

A CQL2 WHERE clause filter that limits feature-set content to only those features that pass through the filter, or None to apply no filter.

properties: list[str]

The set of feature-set properties to grant access to (or except in the case of an "except" clause). If no properties are specified, it means "all properties".

watermark: Watermark | None

A watermark to apply for map layer rendering, or None.

class Credentials:

The credentials of the CubeWerx Stratos administration user that we're logged in as.

username: str

The unique username of this CubeWerx Stratos CwAuth user account. (read-only)

firstName: str | None

The first name of this CubeWerx Stratos CwAuth user account (possibly also with middle name(s) and/or initial(s)), or None. (read-only)

lastName: str | None

The last name of this CubeWerx Stratos CwAuth user account, or None. (read-only)

displayName: str

An appropriate name to display for this CubeWerx Stratos CwAuth user account, either the user's first and/or last name if set, or the user's username otherwise. (read-only)

emailAddress: str | None

The e-mail address of this CubeWerx Stratos CwAuth user account, or None. (read-only)

roles: list[str]

The list of roles that this CubeWerx Stratos CwAuth user account has. These are the role names only. To get the full Role objects (for descriptions, etc.), pass this list to Stratos.getRoles(). (read-only)

class CubestorDatabase:

The details of a CubeSTOR database.

Do not instantiate directly. To get a list of CubeSTOR database details or the details of a specific CubeSTOR database, call Stratos.getCubestorDatabases() or Stratos.getCubestorDatabase() respectively. To create, update or remove a CubeSTOR database, call Stratos.addCubestorDatabase(), Stratos.updateCubestorDatabase() or Stratos.removeCubestorDatabase() respectively.

name: str

The name of this CubeSTOR database. (read-only)

title: str | None

The title of this CubeSTOR database, or None. (read-only)

description: str | None

A brief textual description of this CubeSTOR database, or None. (read-only)

nFeatureSets: int

The number of feature sets that are in this CubeSTOR database. (read-only)

dataStoreId: str | None

The ID of the data store that this CubeSTOR database is the source of, or None if this CubeSTOR database is not the source of any data store. (read-only)

canDelete: bool

Whether or not this CubeSTOR database can currently be removed through this API. (read-only)

@staticmethod
def isValidName(name: str) -> bool | str:

Whether or not the specified name is a valid name for a CubeSTOR database. WARNING: This will return a string (not False) if the name is not valid, so be sure test with "is True" or "is not True".

Arguments:
  • name: The name to test.
Returns:

True if the specified name is a valid name for a CubeSTOR database, or a short string describing why it isn't.

class DataStore:

A CubeWerx Stratos data store. A data store is a data source (dataset) that's exposed as a set of web services with full access control, etc. Only data stores of type "cubestor" will have the full power of tiling, scalability and efficiency.

To create a new CubeWerx Stratos data store, create a new DataStore object (specifying the desired ID), set the required data store type and source properties, set any other desired properties, and call Stratos.addOrReplaceDataStore().

To change the details of an existing CubeWerx Stratos data store, fetch the DataStore object via Stratos.getDataStores() or Stratos.getDataStore(), update one or more properties of that data store, and call DataStore.commitUpdates() or Stratos.updateDataStore() to commit those changes. Layer manipulation is an exception; any changes to the layers of a data store are updated on the server immediately.

To remove a CubeWerx Stratos data store, call Stratos.removeDataStore().

DataStore(id: str = None, jsonRep: dict = {})

Create a new DataStore object.

Arguments:
  • id: The desired ID of the data store. Each data store must have a unique ID. The ID must not contain a colon or a slash, and must not be one of the two reserved values "processing" or "catalogues". DataStore.isValidId() can be called to check the validity of an ID. Required unless supplied via the jsonRep parameter.
  • jsonRep: A dictionary supplying properties. Do not specify; for internal use only.
id: str

The unique ID of this CubeWerx Stratos data store. (read-only)

type: str | None

The type of data store (i.e., the type of its source). Valid values are "cubestor" (for a CubeSTOR database), "oradb" (for a CubeWerx OraDB database), "ogcapi" (for an OGC API Service), "wms" (for an OGC Web Map Service), "wmts" (for an OGC Web Map Tile Service), "wfs" (for an OGC Web Map Feature Service), "arcgismap" for an ESRI® ArcGIS® Map service, and "GeoJSON" (for a GeoJSON source).

source: str | None

The name (for data stores of type "cubestor"), connect string (for data stores of type "oradb") or URL (for all other data store types) of the source of the data store. For data stores of type "cubestor", it's recommended that the GUI admin client fetch the list of available CubeSTOR databases via a call to Stratos.getCubestorDatabases() and present them in a drop-down list.

title: MultilingualString | None

The title of this data store, or None. If None, the title of the source is used.

description: MultilingualString | None

A brief textual description of this data store, or None. If None, the description of the source is used.

attributionTitle: MultilingualString | None

A human-readable attribution for this data store, or None.

attributionUrl: str | None

A URL to link to for the attribution of this data store, or None.

attributionHtml: MultilingualString | None

A human-readable attribution (with HTML markup) for this data store, or None; overrides both attributionTitle and attributionUrl.

attributionLogoUrl: str | None

A URL of a logo to display for the attribution of this data store, or None.

licenseTitle: MultilingualString | None

Human-readable text describing how this data store is licensed, or None.

licenseUrl: str | None

A URL to link to for the license of this data store, or None.

licenseHtml: MultilingualString | None

Human-readable text (with HTML markup) describing how this data store is licensed, or None. Overrides both licenseTitle and licenseUrl.

isExternalService: bool

Whether or not the source of this data store is an external service that CubeWerx Stratos clients can access directly. If True, the Stratos Geospatial Data Server may redirect certain client requests directly to the source server for more efficient operation.

omitDataStoreTheme: bool

The CubeWerx Stratos WMS and WMTS web services are capable of combining multiple data stores into a single set of offerings, and furthermore are capable of providing their the list of available layers as a hierarchical set of themes. Normally each data store served by such a web service is given its own top-level theme. Setting this to True will disable this behavour for this data store, putting the offerings of this data store (which may themselves be organized by a theme hierarchy) directly as top-level items.

stylesUrl: str | None

A URL to a Styled-Layer Descriptor (SLD) document providing a set of styles for (and therefore defining the layers of) the coverages and/or feature sets provided by the source of this data store. Not necessary if the data store source provides its own layers and styles.

extraStylesUrl: str | None

A URL to a Styled-Layer Descriptor (SLD) document providing an additional set of styles for the coverages and/or feature sets provided by the source of this data store, augmenting what may be provided by the data store source or by the stylesUrl field.

provideSpectralIndexStyles: bool

Whether or not to provide a set of spectral-index styles for the coverages of this data store. For each coverage, only the spectral-index styles that are compatible with the channels/bands of that coverage will be provided.

simulateTiles: list[str]

Some data store types (such as "cubestor", "ogcapi", and "wmts") are capable of natively providing map tiles, while others aren't. Setting this gives the Stratos Geospatial Data Server permission to provide a tile interface by making tile-sized map requests to the data store source. The value is a list of coordinate-reference-system strings indicating the coordinate reference systems that such simulated tiles should be provided in. It's common to provide tiles in at least the Web Mercator (EPSG:3857) coordinate reference system. This should only be set to a non-empty list if the data store source is incapable of natively providing map tiles.

hints: dict[str, str]

A set of hints to provide to the CubeWerx Stratos convert library to help it understand or process the data store sources. Black magic.

accessControlRules: list[AccessControlRule]

The set of access control rules for this data store. Like most of the other DataStore properties, this can be adjusted, but adjustments will not be commited to the server until DataStore.commitUpdates() or Stratos.updateDataStore() is called.

canBeManaged: bool

Whether or not layers can be added to or removed from this data store, and whether or not the contents of the layers of this data store can be managed. True if and only if the data store is of type "cubestor" and is part of a Stratos Geospatial Data Server. I.e., if the caller manually creates a new DataStore object, it can't be managed until Stratos.addOrReplaceDataStore() is called. (read-only)

ogcApiUrl: str | None

The URL of the OGC API landing page for this data store, or None if the data store is not yet associated with a Stratos Geospatial Data Server. (read-only)

def commitUpdates(self):

Commit data store updates to the Stratos Geospatial Data Server.

def getLayers(self, forceRefetch: bool = False) -> list[Layer]:

Return the list of layers (feature sets) that this data store provides.

Arguments:
  • forceRefetch: If True, the list of layers is (re-)fetched from the server even if a cached copy exists.
Returns:

The list of layers that this data store provides.

def getLayer( self, layerId: str, forceRefetch: bool = False) -> Layer | None:

Return the specified layer (feature set) within this data store.

Arguments:
  • layerId: a layer ID
  • forceRefetch: If True, the list of layers is (re-)fetched from the server even if a cached copy exists.
Returns:

The layer with the specified ID, or None if no such layer exists in this data store.

def addVectorLayer( self, id: str, jsonSchema: object | str | None = None, title: str | None = None, description: str | None = None, addDefaultStyle: bool = True) -> Layer:

Add a vector layer to this data store. This can only be done for data stores whose DataStore.canBeManaged property is True. The layer is immediately added to the Stratos Geospatial Data Server; there's no need to call DataStore.commitUpdates() to commit the addition.

Arguments:
  • id: The ID to give the layer. The data store must not already have a layer with this ID. The ID must be no longer than 64 characters, and must not contain a backtick or a slash. There are a few other restrictions as well; Layer.isValidId() can be called to check the validity of an ID.
  • jsonSchema: The JSON schema describing the data that will be loaded into this layer, or None. It can be passed as an object (like what json.load() provides), a string representation of the schema, or a file path or URL to a JSON schema. As per "OGC API - Features - Part 5: Schemas", if a property is marked with "x-ogc-role": "primary-geometry", then it's considered the property that will hold the feature's primary geometry. If no geometry property is present, one will be automatically added. If the schema is specified as None, the features of the resulting layer will have no properties (other than its geometry).
  • title: A title to give the layer, or None.
  • description: A brief textual description to give the layer, or None.
  • addDefaultStyle: Whether or not to automatically add a default style (with an ID of "default") to the layer, making maps and map tiles available for it.
Returns:

The new vector layer.

def addVectorLayerWithData( self, id: str, filePathsOrFeatureCollection: list[str] | geojson.feature.FeatureCollection, title: str | None = None, description: str | None = None, dataCoordSys: str | None = None, nominalResM: float | None = None, addDefaultStyle: bool = True) -> Layer | Job:

Add a vector layer to this data store and populate it with some initial data. The schema of the layer will be sniffed from this initial data. This can only be done for data stores whose DataStore.canBeManaged property is True. The layer is immediately added to the Stratos Geospatial Data Server; there's no need to call DataStore.commitUpdates() to commit the addition.

You will eventually need to call Layer.updateTiles() to incorporate this new data into the map and data tiles of the layer (but not until the job is complete!).

Arguments:
  • id: The ID to give the layer. The data store must not already have a layer with this ID. The ID must be no longer than 64 characters, and must not contain a backtick or a slash. There are a few other restrictions as well; Layer.isValidId() can be called to check the validity of an ID. filePathsOrFeatureCollection: Either a list of one or more fully-qualified local file paths of source vector data to be loaded (including any necessary auxilliary files), or a GeoJSON FeatureCollection to be loaded. It's also possible to specify a single-element list consisting of the fully-qualified local file path of a ZIP file containing the source data to load, as long as it meets the following requirements: a) it's the only specified file, b) it has a '.zip' suffix, and c) it consists only of files or of exactly one directory whose contents exist only of files. title: A title to give the layer, or None. description: A brief textual description to give the layer, or None. dataCoordSys: The coordinate system that the data is in (e.g. "http://www.opengis.net/def/crs/OGC/1.3/CRS84"), or None to auto-detect. nominalResM: The nominal resolution of this data in metres, or None to autodetect. This helps the server know how deep to pregenerate tiles. addDefaultStyle: Whether or not to automatically add a default style (with an ID of "default") to the layer, making maps and map tiles available for it.
Returns:

The new vector layer, or a job (that can be monitored for progress) if the creation of the layer needs to be performed asynchronously. Currently the latter occurs when one or more file paths are specified.

def addCoverageLayer( self, id: str, title: str = None, description: str = None, addDefaultStyle: bool = True) -> Layer:

Add a coverage layer to this data store. This can only be done for data stores whose DataStore.canBeManaged property is True. The layer is immediately added to the Stratos Geospatial Data Server; there's no need to call DataStore.commitUpdates() to commit the addition.

Arguments:
  • id: The ID to give the layer. The data store must not already have a layer with this ID. The ID must be no longer than 64 characters, and must not contain a backtick or a slash. There are a few other restrictions as well; Layer.isValidId() can be called to check the validity of an ID. title: A title to give the layer, or None. description: A brief textual description to give the layer, or None. addDefaultStyle: Whether or not to automatically add a default style (with an ID of "default") to the layer, making maps and map tiles available for it.
Returns:

The new coverage layer.

def removeLayer(self, layer: Layer | str) -> bool:

Remove a layer from this data store. This can only be done for data stores whose DataStore.canBeManaged property is True, and should only be done if no tile update is in progress for the layer. The layer is immediately removed from the Stratos Geospatial Data Server; there's no need to call DataStore.commitUpdates() to commit the removal.

WARNING: This will remove all data associated with the layer!!! This could be catastrophic if done unintentionally, so be careful!

Arguments:
  • layer: A Layer object or ID.
Returns:

True if the layer was removed, or False if the layer didn't exist.

@staticmethod
def isValidId(id: str) -> bool | str:

Whether or not the specified ID is a valid ID for a data store. WARNING: This will return a string (not False) if the ID is not valid, so be sure test with "is True" or "is not True".

Arguments:
  • id: The ID to test.
Returns:

True if the specified ID is a valid ID for a data store, or a short string describing why it isn't.

class HarvestedUrl:

A URL harvested by a CubeWerx Stratos catalogue.

url: str

The actual URL. This can also be an absolute path in the server's filesystem. (read-only)

id: str

A unique ID for this harvested URL. (read-only)

nRecords: int | None

The number of records that have been harvested at this URL, or None if unknown. (read-only)

class HarvestResourceType(enum.Enum):

An enumeration of the different resurce types that can be harvested by the catalogue.

WFS_CAPABILITIES_DOC = <HarvestResourceType.WFS_CAPABILITIES_DOC: ('WFS (capabilities document)', 'http://www.opengis.net/wfs', 'urn:cw:def:ebRIM-HarvestResourceType:wfs', 'OGCWFS', 'WFS')>
WFS_BASE_URL = <HarvestResourceType.WFS_BASE_URL: ('WFS (base URL)', 'urn:cw:def:ebRIM-HarvestResourceType:wfsBaseUrl', 'OGCWFSBASEURL', 'WFSBASEURL')>
WCS_CAPABILITIES_DOC = <HarvestResourceType.WCS_CAPABILITIES_DOC: ('WCS (capabilities document)', 'http://www.opengis.net/wcs', 'urn:cw:def:ebRIM-HarvestResourceType:wcs', 'OGCWCS', 'WCS', 'http://www.opengis.net/wcs/1.1')>
WCS_BASE_URL = <HarvestResourceType.WCS_BASE_URL: ('WCS (base URL)', 'urn:cw:def:ebRIM-HarvestResourceType:wcsBaseUrl', 'OGCWCSBASEURL', 'WCSBASEURL')>
WMS_CAPABILITIES_DOC = <HarvestResourceType.WMS_CAPABILITIES_DOC: ('WMS (capabilities document)', 'http://www.opengis.net/wms', 'urn:cw:def:ebRIM-HarvestResourceType:wms', 'OGCWMS', 'WMS')>
WMS_BASE_URL = <HarvestResourceType.WMS_BASE_URL: ('WMS (base URL)', 'urn:cw:def:ebRIM-HarvestResourceType:wmsBaseUrl', 'OGCWMSBASEURL', 'WMSBASEURL')>
WMTS_CAPABILITIES_DOC = <HarvestResourceType.WMTS_CAPABILITIES_DOC: ('WMTS (capabilities document)', 'http://www.opengis.net/wmts', 'urn:cw:def:ebRIM-HarvestResourceType:wmts', 'OGCWMTS', 'WMTS')>
WMTS_BASE_URL = <HarvestResourceType.WMTS_BASE_URL: ('WMTS (base URL)', 'urn:cw:def:ebRIM-HarvestResourceType:wmtsBaseUrl', 'OGCWMTSBASEURL', 'WMTSBASEURL')>
CUBESERV_CAPABILITIES_DOC = <HarvestResourceType.CUBESERV_CAPABILITIES_DOC: ('CubeSERV (capabilities document)', 'urn:cw:def:ebRIM-HarvestResourceType:cubeServ', 'CUBESERV')>
CUBESERV_BASE_URL = <HarvestResourceType.CUBESERV_BASE_URL: ('CubeSERV (base URL)', 'urn:cw:def:ebRIM-HarvestResourceType:cubeServBaseUrl', 'CUBESERVBASEURL')>
RADARSAT2_DATA_PRODUCT = <HarvestResourceType.RADARSAT2_DATA_PRODUCT: ('RADARSAT2 data product', 'urn:cw:def:ebRIM-HarvestResourceType:radarsat2', 'RADARSAT2')>
RCM_DATA_PRODUCT = <HarvestResourceType.RCM_DATA_PRODUCT: ('RADARSAT2 data product', 'urn:cw:def:ebRIM-HarvestResourceType:rcm', 'RCM')>
SENTINEL1_DATA_PRODUCT = <HarvestResourceType.SENTINEL1_DATA_PRODUCT: ('SENTINEL1 data product', 'urn:cw:def:ebRIM-HarvestResourceType:sentinel1', 'SENTINEL1')>
STAC_ITEM = <HarvestResourceType.STAC_ITEM: ('STAC item', 'urn:cw:def:ebRIM-HarvestResourceType:stacitem', 'STACITEM')>
OGC_PROCESS = <HarvestResourceType.OGC_PROCESS: ('OGC process', 'urn:cw:def:ebRIM-HarvestResourceType:ogcProcess', 'PROCESS', 'OGCPROCESS')>
DIRECTORY = <HarvestResourceType.DIRECTORY: ('directory', 'urn:cw:def:ebRIM-HarvestResourceType:directory', 'DIRECTORY')>
displayString: str

A human-readable title for this type. (read-only)

class Job(abc.ABC):

An asynchronous job that can be monitored for progress.

Do not instantiate directly.

status: str

The status of the job. Typical values are "running", "successful" and "failed". (read-only)

progress: float

The progress (as a percentage from 0 to 100) of the job. (read-only)

message: str | None

A brief message indicating what the job is doing, or None. (read-only)

isComplete: bool

Whether or not the job has completed (successfully or otherwise). (read-only)

isSuccessful: bool

Whether or not the job has completed successfully. (read-only)

isFailed: bool

Whether or not the job has completed unsuccessfully. If True, the exception property will typically contain the reason for the failure. (read-only)

exception: ServerException | None

The error that has occurred (if isFailed), or None. (read-only)

def waitUntilComplete(self, showProgress: bool = False):

Monitor the job and don't return until the job is complete. Useful for scripting.

Arguments:
  • showProgress: Whether or not to report the progress to sdout.
class Layer:

A layer (called a "collection" in the OGC API) that's available through a data store.

Do not instantiate directly. To add a layer to a data store, call either DataStore.addVectorLayer() or DataStore.addCoverageLayer().

id: str

The ID/name of this layer. (read-only)

title: str | None

The title of this layer, or None. Setting this (or clearing it by setting it to the empty string or None) will automatically update the server.

description: str | None

A brief textual description of this layer, or None. Setting this (or clearing it by setting it to the empty string or None) will automatically update the server.

wgs84Extent: list | None

The WGS 84 Geographic bounding box of this layer ([minLon, minLat, maxLon, maxLat]), or None. If minLon > maxLon, then the bounding box spans the antimeridian. (read-only)

isVectors: bool

Whether or not this a vector layer. (read-only)

isCoverage: bool

Whether or not this a coverage layer. (read-only)

isMappable: bool

Whether or not maps can be requested from this layer. (read-only)

canBeManaged: bool

Whether or not the data and styles of this layer can be manipulated. (read-only)

ogcApiUrl: str

The URL of the OGC API collection representing this layer. (read-only)

styles: list[Style]

The styles available for this layer. (read-only) To manipulate styles, see Layer.addStyle(), Layer.removeStyle() and Style.update().

tileUpdateProgress: float

The progress (as a percentage from 0 to 100) of the current or last tile-update job for this layer. (read-only)

def getMap( self, width: int | None = None, height: int | None = None, wgs84Extent: list[float] | None = None, style: Style | str | None = None) -> PIL.Image.Image:

Return a map of the layer as an image in the Spherical Mercator (EPSG:3857) coordinate system. This can only be done if isMappable. Note that the map might not show source images or vector features that were very recently added, as the tiling of this new data might not yet be complete.

Arguments:
  • width: The width of the map in pixels, or None for auto.
  • height: The height of the map in pixels, or None for auto.
  • wgs84Extent: The WGS 84 Geographic spatial extent of the area of interest (expressed as [minLon, minLat, maxLon, maxLat]), or None to request a map of the entire layer.
  • style: The style to use (either a Style object or the ID/Name of the style), or None to use the default style.
Returns:

The requested map image.

def getNVectorFeatures( self, wgs84Extent: geojson.geometry.Polygon | list[float] | None = None, relation: SpatialRelation | None = None) -> int:

Return the number vector features in this layer.

Arguments:
  • wgs84Extent: The WGS 84 Geographic spatial extent of the area of interest (expressed as a GeoJSON Polygon or as a [minLon, minLat, maxLon, maxLat] array), or None to request the number of features of the entire layer.
  • relation: The spatial relation to use when comparing against the specified wgs84Extent, or None for the default (INTERSECTS)
Returns:

The number of vector features in this layer.

def getVectorFeatures( self, wgs84Extent: geojson.geometry.Polygon | list[float] | None = None, relation: SpatialRelation | None = None, limit: int | None = None, offset: int = 0, simplifyToScale: float | None = None) -> geojson.feature.FeatureCollection:

Fetch the vector features of this layer. This can only be done if isVectors.

Arguments:
  • wgs84Extent: The WGS 84 Geographic spatial extent of the area of interest (expressed as a GeoJSON Polygon or as a [minLon, minLat, maxLon, maxLat] array), or None to request the features of the entire layer.
  • relation: The spatial relation to use when comparing against the specified wgs84Extent, or None for the default (INTERSECTS)
  • limit: The maximum number of vector features to return, or None to let the server decide.
  • offset: The zero-based start index of the first feature to return. Useful for paging.
  • simplifyToScale: The scale (ratio of the distance on the map to the corresponding distance on the ground) to simplify the geometries to, or None to not simplify.
Returns:

The vector features of this layer.

def addVectorFeatures( self, filePathsOrFeatureCollection: list[str] | geojson.feature.FeatureCollection, dataCoordSys: str | None = None, nominalResM: float | None = None) -> Job | None:

Add one or more vector features to this layer. This can only be done if canBeManaged and isVectors. Note that this does not update the wgs84Extent property of the Layer object.

You will eventually need to call Layer.updateTiles() to incorporate this new data into the map and data tiles of the layer (but not until the job is complete!).

Arguments:
  • filePathsOrFeatureCollection: Either a list of one or more fully-qualified local file paths of source vector data to be loaded (including any necessary auxilliary files), or a GeoJSON FeatureCollection to be loaded. It's also possible to specify a single-element list consisting of the fully-qualified local file path of a ZIP file containing the source data to load, as long as it meets the following requirements: a) it's the only specified file, b) it has a '.zip' suffix, and c) it consists only of files or of exactly one directory whose contents exist only of files.
  • dataCoordSys: The coordinate system that the data is in (e.g. "http://www.opengis.net/def/crs/OGC/1.3/CRS84"), or None to auto-detect.
  • nominalResM: The nominal resolution of this data in metres, or None to autodetect. This helps the server know how deep to pregenerate tiles.
Returns:

A job (that can be monitored for progress) if the creation of the layer needs to be performed asynchronously, or None otherwise. Currently the former occurs when one or more file paths are specified.

def removeVectorFeatures( self, wgs84Extent: geojson.geometry.Polygon | list[float] | None = None, relation: SpatialRelation | None = None) -> int:

Remove vector features from this layer. This can only be done if canBeManaged and isVectors. Note that this does not update the wgs84Extent property of the Layer object.

You will eventually need to call Layer.updateTiles() to update the map and data tiles of the layer.

Arguments:
  • wgs84Extent: The WGS 84 Geographic spatial extent of the area to remove the features from (expressed as a GeoJSON Polygon or as a [minLon, minLat, maxLon, maxLat] array), or None to remove all of the features of the layer.
  • relation: The spatial relation to use when comparing against the specified wgs84Extent, or None for the default (INTERSECTS)
Returns:

The number of vector features removed.

def getSourceImages( self, includeGood: bool = True, includeBad: bool = False) -> list[SourceImage]:

Return a list of all of the source images of this layer, regardless of what collection (if any) they're in. Only useful for coverage layers.

Arguments:
  • includeGood: Whether or not to include good source images.
  • includeBad: Whether or not to include bad source images.
Returns:

A list of the source images of this layer.

def addSourceImages( self, filePaths: list[str], hints: SourceImageHints = None) -> list[SourceImage]:

Add one or more source images to this layer. This can only be done if canBeManaged and isCoverage. Source images added in this way don't get added to a specific collection. Also note that this does not update the wgs84Extent property of the Layer object.

You will eventually need to call Layer.updateTiles() to incorporate these new images into the map and data tiles of the layer.

Arguments:
  • filePaths: The fully-qualified local file paths to the source image(s) to be added, including any necessary auxilliary files. Alternatively, a ZIP file containing the source image(s) to be added can be specified, as long as it meets the following requirements: a) it's the only specified file, b) it has a '.zip' suffix, and c) it consists only of files or of exactly one directory whose contents exist only of files.
  • hints: Hints to help the Stratos Geospatial Data Server interpret the source images, or None.
Returns:

A list of the source images that were added. Note that some of the source images may be marked as bad, and should be adjusted or removed.

def removeSourceImages(self, sourceImages: list[SourceImage | str]):

Remove one or more source images from this layer, regardless of whether or not they're in a specific collection. This can only be done if canBeManaged and isCoverage. Also note that this does not update the wgs84Extent property of the Layer object.

You will eventually need to call Layer.updateTiles() to update the map and data tiles of the layer.

Arguments:
  • sourceImages: The source-image objects or IDs to remove.
def getCollections(self) -> list[SourceImageCollection]:

Return a list of all of the source-image collections of this layer.

Returns:

A list of the source-image collections of this layer.

def addCollection( self, title: str | None = None, description: str | None = None, referenceOnlyPath: str | None = None, hints: list[SourceImageHints] | None = None) -> SourceImageCollection | Job:

Add an empty source-image collection to this layer. This can only be done if canBeManaged and isCoverage. The collection is immediately added to the Stratos Geospatial Data Server.

Arguments:
  • title: A title to give the collection, or None.
  • description: A brief textual description to give the collection, or None.
  • referenceOnlyPath: If specified, this will be created as a reference-only collection for the source images in the specified local directory (beginning with a '/'), remote HTTP directory (beginning with an 'https://') or remote S3 directory (beginning with an 's3://'). The directory must exist and be accessible by the server. If the directory is a remote Amazon S3 directory, the access keys for the S3 bucket must be present in the value of the s3.awsKeys configuration parameter. Source images may not be added to or removed from reference-only collections using this API. Whenever source images are added to or removed from the directory by some other means (e.g., direct upload or filesystem copy), the collection should be rescanned by calling SourceImageCollection.rescan.
  • hints: A set of default hints to apply to all new source images that are added to this collection, or None.
Returns:

The new source-image collection, or a job (that can be monitored for progress) if the creation of the collection needs to be performed asynchronously. Currently the latter occurs when a referenceOnlyPath is specified, since the path will need to be scanned and that can take a while.

def removeCollection(self, collection: SourceImageCollection | str) -> bool:

Remove the specified source-image collection from this layer. This can only be done if canBeManaged and isCoverage.

WARNING: Unless it's a reference-only collection, all of the source-image files will also be removed, so be careful!

You will eventually need to call Layer.updateTiles() to update the map and data tiles of the layer.

Arguments:
Returns:

True if the collection was removed, or False if the collection didn't exist.

def getStyle(self, styleId: str) -> Style | None:

Return the style with the specified ID, or None if this layer has no such style.

Arguments:
  • styleId: The ID of the style to return.
def addStyle(self, styleId: str, sld11UserStyleXmlStr: str) -> Style:

Adds a new style to this layer. This can only be done if canBeManaged.

You will eventually need to call Layer.updateTiles() to update the map and data tiles of the layer.

Arguments:
  • styleId: The ID to assign this style. An style ID cannot contain a "/" character.
  • sld11UserStyleXmlStr: An SLD 1.1 UserStyle element containing the style definition. The UserStyle within this definition must match the specified styleId.
def removeStyle(self, style: Style | str) -> bool:

Remove the specified style from this layer. This can only be done if canBeManaged.

Arguments:
  • style: The Style object or ID to remove.
Returns:

True if the style was removed, or False if the layer didn't have this style.

def updateTiles( self, blocking: bool = False, showProgress: bool = False) -> Job | None:

Triggers a tile update on the data and map tiles of the layer. If possible, further manipulation of the data or styles of this layer should be avoided until the tile update is complete.

Arguments:
  • blocking: If False, the method will return immediately and the tile-update job will proceed concurrently. The progress of the tile update can be monitored through the returned Job object (or by monitoring the Layer.tileUpdateProgress property directly). If True, the method won't return until the tile-update job is complete (useful for scripting).
  • showProgress: Whether or not to report the tile update progress to stdout. Only relevant if blocking=True.
@staticmethod
def isValidId(id: str) -> bool | str:

Whether or not the specified ID is a valid ID for a layer. WARNING: This will return a string (not False) if the ID is not valid, so be sure test with "is True" or "is not True".

Arguments:
  • id: The ID to test.
Returns:

True if the specified ID is a valid name for a layer, or a short string describing why it isn't.

class LoginHistoryEntry:

An entry of the login history.

timestamp: datetime.datetime

The date and time (in the server's time zone) of the login. (read-only)

ipAddress: str | None

The IP address of the login, or None if unknown. (read-only)

user: str | OidUser

The user account the login, either a string representing the username of a CwAuth user or an OidUser object representing an OpenID Connect user. (read-only)

class MultilingualString(collections.UserDict):

A string expressed in potentially-multiple languages.

This is a dictionary that maps ISO 639-1/RFC 3066 language identifiers (e.g., "en-CA", "fr") to the string expressed in that language. The optional mapping from the empty string ("") indicates the string expressed in an unknown/default language.

MultilingualString(value: str | dict[str, str])

Create a new multilingual string.

Arguments:
  • value: Either a simple string (whose language is undefined) or a dictionary as described above.
class OidUser(typing.TypedDict):

An OpenID Connect user identity.

Keys:

issuer: The issuer URL of the OpenID Connect server that provides the identity. sub: the "sub" (subject) claim of the user identity at the specified OpenID Connect server, or None to refer to all user identities at the specified OpenID Connect server.

issuer: str
sub: str | None
class OperationClass(enum.StrEnum):

An enumeration of the operation classes that can be access controlled. Note that the EXECUTE_PROCESS and MANAGE_PROCESSES operation classes should only be specified in the access control rules for the processing server (see Stratos.getProcessingAcrs() and Stratos.setProcessingAcrs()), and the GET_RECORD, INSERT_RECORD, UPDATE_RECORD, DELETE_RECORD and HARVEST_RECORDS operation classes should only be specified in the access control rules for the catalogue server (see Catalogue.accessControlRules).

GET_MAP = <OperationClass.GET_MAP: 'GetMap'>
GET_FEATURE_INFO = <OperationClass.GET_FEATURE_INFO: 'GetFeatureInfo'>
GET_FEATURE = <OperationClass.GET_FEATURE: 'GetFeature'>
INSERT_FEATURE = <OperationClass.INSERT_FEATURE: 'InsertFeature'>
UPDATE_FEATURE = <OperationClass.UPDATE_FEATURE: 'UpdateFeature'>
DELETE_FEATURE = <OperationClass.DELETE_FEATURE: 'DeleteFeature'>
MANAGE_FEATURE_SETS = <OperationClass.MANAGE_FEATURE_SETS: 'ManageFeatureSets'>
MANAGE_STORED_QUERIES = <OperationClass.MANAGE_STORED_QUERIES: 'ManageStoredQueries'>
MANAGE_STYLES = <OperationClass.MANAGE_STYLES: 'ManageStyles'>
EXECUTE_PROCESS = <OperationClass.EXECUTE_PROCESS: 'ExecuteProcess'>
MANAGE_PROCESSES = <OperationClass.MANAGE_PROCESSES: 'ManageProcesses'>
GET_RECORD = <OperationClass.GET_RECORD: 'GetRecord'>
INSERT_RECORD = <OperationClass.INSERT_RECORD: 'InsertRecord'>
UPDATE_RECORD = <OperationClass.UPDATE_RECORD: 'UpdateRecord'>
DELETE_RECORD = <OperationClass.DELETE_RECORD: 'DeleteRecord'>
HARVEST_RECORDS = <OperationClass.HARVEST_RECORDS: 'HarvestRecords'>
class Quota:

A quota. Note that quotas are not active unless the value of the audit.quotas.enable configuration parameter is set to true.

Do not instantiate directly. To get a list of quotas or a specific quota, call Stratos.getQuotas() or Stratos.getQuota() respectively. To create, update or remove a quota, call Stratos.addQuota(), Stratos.updateQuota() or Stratos.removeQuota() respectively.

id: str

The ID of this quota. (read-only)

identityType: QuotaIdentityType

The type of identity that this quota is on. (read-only)

identity: str

The identity (username, role or API key) that this quota is on. (read-only)

field: QuotaField

The thing being quotad. (read-only)

service: str

The service (as known by CubeWerx Stratos Analytics) that this quota applies to (e.g., "WMS", "WMTS", "WCS", "WFS", "WPS", "CSW"), or "*" if the quota applies to all services. (read-only)

operation: str

The operation (as known by CubeWerx Stratos Analytics) that this quota applies to. (e.g., "GetMap", "GetFeature"), or "*" if the quota applies to all operations. (read-only)

granularity: QuotaGranularity

The granularity of this quota (i.e., what unit of time it applies to). (read-only)

fromDate: datetime.date

The start date (inclusive, in the server's time zone) of the current time window of this quota; this will be automatically adjusted at the beginning of every unit of time specified by the granularity property. (read-only)

toDate: datetime.date

The end date (inclusive, in the server's time zone) of the current time window of this quota; this will be automatically adjusted at the beginning of every unit of time specified by the granularity property. (read-only)

limit: int

The limit that this quota imposes. (read-only)

usage: int

The current usage (which will be automatically reset at the beginning of every unit of time specified by the granularity property). (read-only)

warningNumSent: int

The highest warning level (typically 1 to 3, or 0 for no warning) that the user, role maintainer or API key maintainer has been e-mailed about regarding the current usage level; this will be automatically reset at the beginning of every unit of time specified by the granularity property. (read-only)

class QuotaField(enum.StrEnum):

An enumeration of the things that a quota can be on.

N_REQUESTS = <QuotaField.N_REQUESTS: 'n_requests'>
DURATION = <QuotaField.DURATION: 'duration'>
CPU_SECONDS = <QuotaField.CPU_SECONDS: 'cpu_seconds'>
N_RESPONSE_BYTES = <QuotaField.N_RESPONSE_BYTES: 'n_response_bytes'>
N_FEATURES = <QuotaField.N_FEATURES: 'n_features'>
N_POINTS = <QuotaField.N_POINTS: 'n_points'>
N_PIXELS = <QuotaField.N_PIXELS: 'n_pixels'>
N_NONEMPTY_PIXELS = <QuotaField.N_NONEMPTY_PIXELS: 'n_nonempty_pixels'>
N_FEATURE_BYTES = <QuotaField.N_FEATURE_BYTES: 'n_feature_bytes'>
N_COVERAGE_BYTES = <QuotaField.N_COVERAGE_BYTES: 'n_coverage_bytes'>
N_DOWNLOAD_BYTES = <QuotaField.N_DOWNLOAD_BYTES: 'n_download_bytes'>
N_PROCESSING_UNITS = <QuotaField.N_PROCESSING_UNITS: 'n_processing_units'>
class QuotaGranularity(enum.StrEnum):

An enumeration of granularity of a quota (i.e., what unit of time it applies to).

UNBOUNDED = <QuotaGranularity.UNBOUNDED: 'unbounded'>
ANNUALLY = <QuotaGranularity.ANNUALLY: 'annually'>
SEMIANNUALLY = <QuotaGranularity.SEMIANNUALLY: 'semiannually'>
BIMONTHLY = <QuotaGranularity.BIMONTHLY: 'bimonthly'>
MONTHLY = <QuotaGranularity.MONTHLY: 'monthly'>
WEEKLY = <QuotaGranularity.WEEKLY: 'weekly'>
DAILY = <QuotaGranularity.DAILY: 'daily'>
class QuotaIdentityType(enum.StrEnum):

An enumeration of the identity types that a quota can be on.

USERNAME = <QuotaIdentityType.USERNAME: 'username'>
ROLE = <QuotaIdentityType.ROLE: 'role'>
API_KEY = <QuotaIdentityType.API_KEY: 'api_key'>
class RequestHistory:

A summary of the recent request history.

periodTypeNoun: str

The granularity of the time periods, expressed as a noun. (read-only)

periodTypeAdjective: str

The granularity of the time periods, expressed as an adjective. (read-only)

periods: list[RequestPeriod]

Summaries per time period, in forward chronological order. (read-only)

dailyAverages: RequestSummaries

Daily averages of request activity. (read-only)

class RequestPeriod:

A summary of the recent request history for a specific time period.

fromDate: datetime.date

The start date (inclusive) of the time period. (read-only)

toDate: datetime.date

The end date (inclusive) of the time period. (read-only)

summaries: RequestSummaries

A summary of the recent request history for this time period. (read-only)

class RequestSummaries:

Summaries of requests made and response bytes sent by category.

coverages: RequestSummary

Summary of the coverage data (excluding tile requests). (read-only)

vectors: RequestSummary

Summary of the vector data (excluding tile requests). (read-only)

Summary of the map data (excluding tile requests). (read-only)

Summary of the tile data. (read-only)

offlineDownloads: RequestSummary

Summary of the offline downloads. (read-only)

Summary of all other requests. (read-only)

Summary of all requests. (read-only)

class RequestSummary:

A summary of requests made and response bytes sent.

nRequests: int

The number of requests made. (read-only)

nBytes: int

The number of response bytes sent. (read-only)

class Role:

A CubeWerx Stratos CwAuth role.

Roles are a convenient way of assigning tasks to users, allowing access to be granted to particular data and/or operations based on users' roles rather than having to manage access control rules at a per-user level.

Roles can be assigned to CubeWerx Stratos CwAuth users and OpenID Connect users.

A special built-in "Administrator" role allows full administraton access to a Stratos Geospatial Data Server. This role is hardcoded-assigned to the "admin" CwAuth user, but is also assignable to other users to grant them full administraton access. This role cannot be removed.

To create a new role, create a new Role object (specifying the desired role name), set any other desired properties, and call Stratos.addOrReplaceRole().

To change the details of an existing role, fetch the role object via Stratos.getRoles() or Stratos.getRole(), update one or more properties of that role, and call Stratos.updateRole() to commit those changes.

To remove a role, call Stratos.removeRole().

Role(name: str = None, dictionary: dict = {})

Create a new Role object.

Arguments:
  • name: The name of the role. Each role must have a unique name. Required unless supplied via the dictionary parameter.
  • dictionary: A dictionary supplying properties. Do not specify; for internal use only.
name

The unique name of this role. (read-only)

description: str | None

A brief textual description of this role, or None.

contactEmail: str | None

The e-mail address to contact regarding this role, or None.

isBuiltin: bool

Is this a non-removable built-in role? (read-only)

authUsers: list[str]

The list of CubeWerx Stratos CwAuth user accounts that have this role. These are the usernames only. To get the full AuthUser objects (for full names and e-mail addresses, etc.), pass this list to Stratos.getAuthUsers(). This list of users can be re-specified with a role.authUsers = [...] assignment. However, to add or remove a user to/from the existing list, use Role.addAuthUser() or Role.removeAuthUser() rather than role.authUsers.append() or role.authUsers.remove().

def addAuthUser(self, username: str):

Add a CubeWerx Stratos CwAuth user to this role.

Arguments:
  • username: The username of the CubeWerx Stratos CwAuth user account to add this role to. The specified user must exist. If the user already has this role, this is a no-op.
def removeAuthUser(self, username: str):

Remove a CubeWerx Stratos CwAuth user from this role.

Arguments:
  • username: The username of the CubeWerx Stratos CwAuth user account to remove (revoke) this role from. If the user doesn't have this role, this is a no-op.
oidUsers: list[OidUser]

The list of OpenID Connect user identities that have this role. This list of users can be re-specified with a role.oidUsers = [...] assignment. However, to add or remove a user to/from the existing list, use Role.addOidUser() or Role.removeOidUser() rather than role.oidUsers.append() or role.oidUsers.remove().

def addOidUser(self, oidUser: OidUser):

Add an OpenID Connect user to this role.

Arguments:
  • oidUser: the OpenID Connect user identity to add this role to. If the user already has this role, this is a no-op.
def removeOidUser(self, oidUser: OidUser):

Remove an OpenID Connect user from this role.

Arguments:
  • oidUser: The OpenID Connect user identity to remove (revoke) this role from. If the user doesn't have this role, this is a no-op.
@staticmethod
def isValidName(name: str) -> bool | str:

Whether or not the specified name is a valid name for a CwAuth role. WARNING: This will return a string (not False) if the name is not valid, so be sure test with "is True" or "is not True".

Arguments:
  • name: The name to test.
Returns:

True if the specified name is a valid name for a CwAuth role, or a short string describing why it isn't.

class SourceImage:

A source image (called a "scene" in the OGC API) of a coverage layer.

Do not instantiate directly. To add source images to a coverage layer, call Layer.addSourceImages() or SourceImageCollection.addSourceImages().

id: str

The ID/name of this source image. (read-only)

title: str | None

The title of this source image, or None. (read-only)

collectionId: str | None

The ID of the SourceImageCollection that this source image is in, or Non if it'd not in a collection. (read-only)

wgs84Extent: list | None

The WGS 84 Geographic bounding box of this source image ([minLon, minLat, maxLon, maxLat]), or None. If minLon > maxLon, then the bounding box spans the antimeridian. (read-only)

nominalResM: float | None

The nominal resolution of this source image in metres, or None. (read-only)

dataCitation: str | None

A citation for the source of this source image, or None. (read-only)

isGood: bool

If False, this source image is unuseable for the reason provided by the errorMessage property. Consider adjusting its hints or removing it. (read-only)

errorMessage: str | None

An error message describing why the source image is unuseable, or None. (read-only)

Hints to help the Stratos Geospatial Data Server interpret this source image. If these hints are changed programmatically, commitHintChanges must be called to commit these changes to the Stratos Geospatial Data Server. (read-only, but can be modified in-place)

def getThumbnailImage( self, maxWidth: int | None = None, maxHeight: int | None = None) -> PIL.Image.Image:

Return a thumbnail image for this source image, or None if no thumbnail image is available for this source image.

Arguments:
  • maxWidth: The preferred maximum width of the thumbnail image, or None to let the server decide.
  • maxHeight: The preferred maximum height of the thumbnail image, or None to let the server decide.
Returns:

A thumbnail image for this source image, or None if no thumbnail image is available for this source image.

def commitHintChanges(self):

Commit to the Stratos Geospatial Data Server any changes that were programmatically made to the hints of this source image. Note that this may change the values of some of the properties of the source image, including its ID and whether or not it's considered a good source image.

You will eventually need to call Layer.updateTiles() to update the map and data tiles of the layer.

class SourceImageCollection:

A source-image collection (called a "group" in the CubeWerx extensions to the OGC API) of a coverage layer.

Do not instantiate directly. To add a source-image collection to a coverage layer, call Layer.addCollection().

id: str

The ID/name of this source-image collection. (read-only)

title: MultilingualString | None

The title of this source-image collection, or None. Setting this (or clearing it by setting it to None) will automatically update the server.

description: MultilingualString | None

A brief textual description of this source-image collection, or None. Setting this (or clearing it by setting it to None) will automatically update the server.

isReferenceOnly: bool

If True, this is a reference-only source-image collection. Source images can't be added to or removed from such collections using this API, and it's assumed that the directory specified by the referenceOnlyPath parameter is maintained by some other means (e.g., direct upload or filesystem copy). Whenever source images are added to, removed from or adjusted in this directory, the source-image collection should be rescanned by calling rescan. (read-only)

referenceOnlyPath: str | None

The local directory (beginning with a '/'), remote HTTP directory (beginning with an 'https://') or remote S3 directory (beginning with an 's3://') that contains the source images of this reference-only source-image collection, or None if this isn't a reference-only source-image collection. (read-only)

defaultHints: SourceImageHints

A set of default hints that are applied to all new source images that are added to this collection. If these hints are changed programmatically, commitDefaultHintChanges must be called to commit these changes to the Stratos Geospatial Data Server. (read-only, but can be modified in-place)

nSourceImages: int

The number of source images that are in this collection, including bad source images. (read-only)

nBad: int

The number of bad source images that are in this collection. Bad source images will not be rendered. A bad source image may be fixed by adjusting its hints appropriately and calling badSourceImage.commitHintChanges(). (read-only)

def getSourceImages( self, includeGood: bool = True, includeBad: bool = False) -> list[SourceImage]:

Return a list of all of the source images in this collection.

Arguments:
  • includeGood: Whether or not to include good source images.
  • includeBad: Whether or not to include bad source images.
Returns:

A list of the source images in this collection.

def addSourceImages( self, filePaths: list[str], hints: SourceImageHints = None) -> list[SourceImage]:

Add one or more source images to this collection. This can only be done if the collection is not isReferenceOnly.

You will eventually need to call Layer.updateTiles() to incorporate these new images into the map and data tiles of the layer.

Arguments:
  • filePaths: The fully-qualified local file paths to the source image(s) to be added, including any necessary auxilliary files. Alternatively, a ZIP file containing the source image(s) to be added can be specified, as long as it meets the following requirements: a) it's the only specified file, b) it has a '.zip' suffix, and c) it consists only of files or of exactly one directory whose contents exist only of files.
  • hints: Hints to help the Stratos Geospatial Data Server interpret the source images, or None.
Returns:

A list of the source images that were added. Note that some of the source images may be marked as bad, and should be adjusted or removed.

def removeSourceImages(self, sourceImages: list[SourceImage | str]):

Remove one or more source images from this collection. This can only be done if the collection is not isReferenceOnly.

You will eventually need to call Layer.updateTiles() to update the map and data tiles of the layer.

Arguments:
  • sourceImages: The source-image objects or IDs to remove.
def commitDefaultHintChanges(self):

Commit to the Stratos Geospatial Data Server any changes that were programmatically made to the default hints of this source-image collection.

def rescan(self) -> Job:

Rescan the source images for this collection. New source images that are found will be registered, source images that no longer exist will be unregistered, and an attempt will be made to re-register any source images marked as bad. Typically only useful for reference-only collections.

The nSourceImages and nBad fields of this object will not automatically update after a rescan. To update these fields after a rescan, call refresh after the job completes successfully.

Returns:

A job that can be monitored for progress.

def refresh(self):

Refresh the collection to adjust for any recent server-side changes that may have occurred.

class SourceImageHints:

Hints to help the Stratos Geospatial Data Server interpret a source image.

To specify hints when adding source images to a layer, create a new SourceImageHints object, set the relevant properties, and pass this object to Layer.addSourceImages() or SourceImageCollection.addSourceImages().

To specify or adjust hints of an existing source image, get the SourceImageHints object using SourceImage.hints, set or adjust the relevant properties, and commit the changes by calling SourceImage.commitHintChanges(). Note that this may change the values of some of the properties of the source image, including its ID and whether or not it's considered a good source image.

SourceImageHints(dictionary: dict = {})

Create a new SourceImageHints object.

Arguments:
  • dictionary: A dictionary supplying properties. Do not specify; for internal use only.
dataCoordSys: str | None

The coordinate system that the data is in.

dataCitation: str | None

A citation for the source of the data.

dataTime: datetime.datetime | None

The date (and possibly time) that this data was captured.

nullColor1: datetime.datetime | None

The color in the source images that represents the NULL color, expressed as a hexadecimal red-green-blue color value.

nullColor2: datetime.datetime | None

A second color in the source images that represents the NULL color, expressed as a hexadecimal red-green-blue color value.

nullFuzz: int | None

A fuzz factor to apply when detecting NULL colors (useful for processing lossy data); typically in the range of 0-255 for RGB or greyscale data.

rasterNBits: int | None

The number of significant bits per channel in the source data.

def clear(self):

Remove all hints.

class SpatialRelation(enum.StrEnum):

An enumeration of geometry spatial-relation types.

EQUALS = <SpatialRelation.EQUALS: 'equals'>
DISJOINT = <SpatialRelation.DISJOINT: 'disjoint'>
TOUCHES = <SpatialRelation.TOUCHES: 'touches'>
WITHIN = <SpatialRelation.WITHIN: 'within'>
OVERLAPS = <SpatialRelation.OVERLAPS: 'overlaps'>
CROSSES = <SpatialRelation.CROSSES: 'crosses'>
INTERSECTS = <SpatialRelation.INTERSECTS: 'intersects'>
CONTAINS = <SpatialRelation.CONTAINS: 'contains'>
BBOX = <SpatialRelation.BBOX: 'bbox'>
class Stats:

System statistics.

nActiveUsers: list[int]

The number of unique users that have used the product per specified time period, for the last specified number of time periods, in forward chronological order. For example, if the request was for nPeriods=24 and nSecondsPerPeriod=3600, then this list would contain 24 items with the last item indicating the number of unique users that have used the product within the past hour and the previous item indicating the number of unique users that have used the product during the hour before that, etc. (read-only)

loadAverage: tuple[float, float, float]

The current load average of the system over the last 1, 5 and 15 minutes, respectively. For a normalized system load, divide by the number of CPUs on the system. (read-only)

nCpus: float

The number of CPUs on the system. (read-only)

memoryUsed: int

The number of bytes of physical memory on the system that are currently being used. (read-only)

memoryTotal: int

The number of bytes of physical memory on the system. (read-only)

class Style:

An available style for a layer.

id: str

The ID/name of this style. (read-only)

title: str | None

The title of this style, or None. (read-only)

sld11XmlStr: str

The definition of this style as an SLD 1.1 SymLayerSet XML element. (read-only)

sld11UserStyleXmlStr: str

The definition of this style as an SLD 1.1 UserStyle XML element. (read-only)

canBeUpdated: bool

Whether or not the definition of this style can be changed. (read-only)

ogcApiUrl: str

The OGC API URL of this layer-specific style. (read-only)

def update(self, sld11UserStyleXmlStr: str):

Updates the definition of this style. The style is immediately updated on the Stratos Geospatial Data Server. This can only be done if canBeUpdated.

You will eventually need to call Layer.updateTiles() to update the map and data tiles of the layer.

Arguments:
  • sld11UserStyleXmlStr: An SLD 1.1 UserStyle element containing the new style definition. The UserStyle within this definition must match the ID of the style.
class Watermark:

A watermark to apply for map layer rendering.

Watermark( urlOrFilePath: str | None = None, location: WatermarkLocation | None = None, opacity: float = 1.0)

Create a new watermark.

Arguments:
  • urlOrFilePath: A URL or local file path (absolute or relative to the server URL or directory) to an image to use as the watermark, or None (but then required to be set via the property). PNG is preferred, but JPEG, GIF and TIFF will also work.
  • location: Where the watermark should be applied in the rendered map, or None for the default (TILED). The only location suitable for tiled maps is TILED.
  • opacity: The opacity (0...1) of the watermark (subject to the opacity of the image itself).
urlOrFilePath: str | None

A URL or local file path (absolute or relative to the server URL or directory) to an image to use as the watermark, or None. PNG is preferred, but JPEG, GIF and TIFF will also work.

location: WatermarkLocation

Where the watermark should be applied in the rendered map. The only location suitable for tiled maps is TILED.

opacity: float

The opacity (0...1) of the watermark (subject to the opacity of the image itself).

class WatermarkLocation(enum.StrEnum):

An enumeration of where watermarks can be applied in rendered maps.

NOWHERE = <WatermarkLocation.NOWHERE: 'nowhere'>
TOP_LEFT = <WatermarkLocation.TOP_LEFT: 'top left'>
TOP_CENTER = <WatermarkLocation.TOP_CENTER: 'top center'>
TOP_RIGHT = <WatermarkLocation.TOP_RIGHT: 'top right'>
CENTER_LEFT = <WatermarkLocation.CENTER_LEFT: 'center left'>
CENTER = <WatermarkLocation.CENTER: 'center'>
CENTER_RIGHT = <WatermarkLocation.CENTER_RIGHT: 'center right'>
BOTTOM_LEFT = <WatermarkLocation.BOTTOM_LEFT: 'bottom left'>
BOTTOM_CENTER = <WatermarkLocation.BOTTOM_CENTER: 'bottom center'>
BOTTOM_RIGHT = <WatermarkLocation.BOTTOM_RIGHT: 'bottom right'>
TILED = <WatermarkLocation.TILED: 'tiled'>
class CwException(builtins.Exception):

The base class for all CubeWerx-specific exceptions.

class LoginException(CwException):

The base class for all exceptions related to logging in to a CubeWerx Stratos Geospatial Data Server.

class NotAStratosException(LoginException):

Raised when an attempt is made to connect to a URL that doesn't appear to be a CubeWerx Stratos Geospatial Data Server.

class IncompatibleStratosVersionException(LoginException):

Raised when an attempt is made to connect to a CubeWerx Stratos Geospatial Data Server whose version number is incompatible with this Python package.

class NotAnAuthServerException(LoginException):

Raised when the specified CubeWerx Stratos Authentication Server URL doesn't seem to point to a CubeWerx Stratos Authentication Server.

class AuthServerVersionTooLowException(LoginException):

Raised when an attempt is made to connect to a CubeWerx Stratos Authentication Server whose version number is too low.

class InvalidCredentialsException(LoginException):

Raised when an invalid CubeWerx Stratos username or password is provided.

class NotAdministratorException(LoginException):

Raised when the provided CubeWerx Stratos username and password is accepted, but the specified user doesn't have Administrator privileges.

class LoginAttemptsTooFrequentException(LoginException):

Raised when login attempts to the specified username are being made too frequently. Wait a few seconds and try again.

class NoMoreSeatsException(LoginException):

Raised when no more seats are available for the specified username. Not applicable for most servers.

class ServerException(CwException):

A detailed error report returned by the CubeWerx Stratos Geospatial Data Server.

title: str | None

The title of the error report, or None. (read-only)

details: list[str]

An array of strings describing the error, from most general to most specific. (read-only)

moreInfoUrl: str | None

A URL that provides more information about the error and the request that triggered it, or None. (read-only)

class ServerHttpException(ServerException):

Raised when the CubeWerx Stratos Geospatial Data Server returns an error. Provides a detailed error report.

httpError: requests.exceptions.HTTPError

The HTTPError object describing the error response. (read-only)

httpStatus: int

The HTTP status code of the error. (readOnly)