# 地震 (https://nolantw.github.io/cwa/reference/earthquakes/)

## `earthquakes.latest`

```python
def latest(*, language: Language = 'zh-TW') -> Earthquake | None
```

回傳最新一筆有感地震報告。

```python
client.earthquakes.latest(*, language: Language = 'zh-TW') -> Earthquake | None
await async_client.earthquakes.latest(*, language: Language = 'zh-TW') -> Earthquake | None
```

## `earthquakes.recent`

```python
def recent(*, limit: int = 20, language: Language = 'zh-TW') -> tuple[Earthquake, ...]
```

查詢近期有感地震報告，從最新發震的報告開始。

```python
client.earthquakes.recent(*, limit: int = 20, language: Language = 'zh-TW') -> tuple[Earthquake, ...]
await async_client.earthquakes.recent(*, limit: int = 20, language: Language = 'zh-TW') -> tuple[Earthquake, ...]
```

## `Earthquake`

```python
number: str | None
occurred_at: datetime
published_at: datetime | None
revision: str | None
magnitude: float
magnitude_scale: str
depth_km: float
epicenter: Coordinates
epicenter_description: str
maximum_intensity: IntensityLevel | None
intensities: tuple[ReportedIntensity, ...]
source: Source
report_url: str | None
report_type: str | None
```

氣象署發布的有感地震報告。`number` 為報告編號，氣象署未編號的小區域有感地震報告為 `None`。

### `Earthquake.distance_to`

```python
def distance_to(location: PointInput) -> float
def distance_to(location: Sequence[PointInput]) -> Mapping[Point, float]
```

計算到震央的水平距離，單位為公里。

### `Earthquake.intensity_at`

```python
def intensity_at(location: IntensityInput) -> IntensityLevel | None
def intensity_at(location: Sequence[IntensityInput]) -> Mapping[IntensityArea, IntensityLevel | None]
```

查詢指定行政區層級的已發布震度。

## `IntensityLevel`

```python
label: str
```

氣象署的震度分級，包含弱級與強級。

## `earthquakes.Language`

```python
type Language = Literal['zh-TW', 'en']
```

地震報告語言：zh-TW 或 en。

## `ReportedIntensity`

```python
label: str
level: IntensityLevel | None
county: County | None
township: Township | None
description: str | None
station_id: str | None
station_name: str | None
```

已發布的震度原文及對應級別。