Python API¶
Import the extension from pystac.extensions.earthquake. Prefer EarthquakeExtension.ext() over constructing the concrete wrappers directly.
pystac.extensions.earthquake
¶
Implementation of the STAC :stac-ext:Earthquake Extension <earthquake>.
MagnitudeType = Literal['0', '2', '4', 'fa', 'H', 'hn', 'lg', 'm', 'ma', 'mb', 'MbLg', 'mb_lg', 'mc', 'md', 'mdl', 'Me', 'mfa', 'mh', 'Mi', 'mint', 'mj', 'ml', 'ml(texnet)', 'mlg', 'mlr', 'mlv', 'Ms', 'ms_20', 'ms_vx', 'Mt', 'muk', 'mun', 'mw', 'mwb', 'mwc', 'mwp', 'mwr', 'mww', 'no', 'uk', 'Unknown']
module-attribute
¶
StatusType = Literal['automatic', 'reviewed', 'deleted']
module-attribute
¶
EARTHQUAKE_EXTENSION_HOOKS: ExtensionHooks = EarthquakeExtensionHooks()
module-attribute
¶
SCHEMA_URI: str = 'https://stac-extensions.github.io/earthquake/v1.0.0/schema.json'
module-attribute
¶
EarthquakeExtension
¶
Bases: Generic[T], PropertiesExtension, ExtensionManagementMixin[Item | Collection]
Implements the STAC Earthquake Extension for Items and also supports reading/writing extension fields on Assets and Collection Item Asset Definitions.
Schema: https://stac-extensions.github.io/earthquake/v1.0.0/schema.json
Source code in pystac/extensions/earthquake.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
depth: float | None
property
writable
¶
Depth of the event in kilometers.
felt: int | None
property
writable
¶
Reported number of people who felt the event.
magnitude: float | None
property
writable
¶
Magnitude of the earthquake event.
magnitude_type: MagnitudeType | None
property
writable
¶
Magnitude scale used to compute :attr:magnitude.
sources: list[EarthquakeSource] | None
property
writable
¶
Provider-specific source records associated with this event.
status: StatusType | None
property
writable
¶
Review status of the event metadata.
tsunami: bool | None
property
writable
¶
Whether the event was associated with a tsunami.
apply(*, magnitude: float, sources: list[EarthquakeSource], magnitude_type: MagnitudeType | None = None, felt: int | None = None, status: StatusType | None = None, tsunami: bool | None = None, depth: float | None = None) -> None
¶
Apply earthquake fields to the wrapped object.
Note: schema marks eq:magnitude and eq:sources as required.
Source code in pystac/extensions/earthquake.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
ext(obj: T, add_if_missing: bool = False) -> EarthquakeExtension[T]
classmethod
¶
Extend an Item, Asset, or ItemAssetDefinition with earthquake fields.
| Parameters: |
|
|---|
Source code in pystac/extensions/earthquake.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
get_schema_uri() -> str
classmethod
¶
Return the published schema URI for this extension.
Source code in pystac/extensions/earthquake.py
166 167 168 169 | |
EarthquakeSource
¶
Bases: TypedDict
A single source entry stored in the eq:sources field.
Source code in pystac/extensions/earthquake.py
86 87 88 89 90 91 | |
ItemEarthquakeExtension
¶
Bases: EarthquakeExtension[Item]
Concrete earthquake implementation for :class:~pystac.Item objects.
Source code in pystac/extensions/earthquake.py
283 284 285 286 287 288 289 290 291 292 293 294 | |
AssetEarthquakeExtension
¶
Bases: EarthquakeExtension[Asset]
Concrete earthquake implementation for :class:~pystac.Asset objects.
Source code in pystac/extensions/earthquake.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
ItemAssetsEarthquakeExtension
¶
Bases: EarthquakeExtension[ItemAssetDefinition]
Concrete earthquake implementation for item asset definitions.
Source code in pystac/extensions/earthquake.py
314 315 316 317 318 319 320 321 322 | |
EarthquakeExtensionHooks
¶
Bases: ExtensionHooks
Hook registration used when reading or migrating STAC objects.
Source code in pystac/extensions/earthquake.py
325 326 327 328 329 330 331 332 333 | |