跳至內容
tdx-tw
API 參考

道路事件

RoadEvents

events

def events(
    area: City | str | TrafficArea,
    *,
    query: Query[RoadEvent] | QueryParams | None = None,
    limit: int | None = None,
    offset: int = 0,
    cache_ttl: float | None = None,
) -> Records[RoadEvent]

取得預告的道路事件,例如施工與封閉。

live_events

def live_events(
    area: City | str | TrafficArea,
    *,
    query: Query[RoadEvent] | QueryParams | None = None,
    limit: int | None = None,
    offset: int = 0,
    cache_ttl: float | None = None,
) -> Records[RoadEvent]

取得目前的道路事件與影響。

authorities

def authorities(
    *,
    query: Query[RoadEventAuthority] | QueryParams | None = None,
    limit: int | None = None,
    offset: int = 0,
    cache_ttl: float | None = None,
) -> Records[RoadEventAuthority]

取得提供道路事件的機關。

RampLocation

class RampLocation(BaseModel):
    direction: str | None
    entry_exit: str | None

HighwayLocation

class HighwayLocation(BaseModel):
    road: str | None
    direction: str | None
    start_km: str | None
    end_km: str | None
    section_start: str | None
    section_end: str | None
    interchange: str | None
    ramp: RampLocation | None

CityRoadway

class CityRoadway(BaseModel):
    city: str | None
    town: str | None
    road: str | None
    direction: str | None
    section_start: str | None
    section_end: str | None

CityRoadLocation

class CityRoadLocation(BaseModel):
    roadways: tuple[CityRoadway, ...] | None

IntersectionLocation

class IntersectionLocation(BaseModel):
    city: str | None
    roads: tuple[str, ...] | None

AddressLocation

class AddressLocation(BaseModel):
    city: str | None
    town: str | None
    road: str | None
    lane: str | None
    alley: str | None
    start_number: str | None
    end_number: str | None

PlaceLocation

class PlaceLocation(BaseModel):
    point_of_interest: str | None

RoadEventLocation

class RoadEventLocation(BaseModel):
    highway: HighwayLocation | None
    city_road: CityRoadLocation | None
    intersection: IntersectionLocation | None
    address: AddressLocation | None
    place: PlaceLocation | None
    other: str | None

RoadEventDuration

class RoadEventDuration(BaseModel):
    occurrence_type: int | None
    occurrence_days: tuple[int, ...] | None
    occurrence_dates: tuple[str, ...] | None
    start_time: str | None
    end_time: str | None
    starts_at: MaybeTimestamp
    ends_at: MaybeTimestamp

RoadEventDetour

class RoadEventDetour(BaseModel):
    description: str | None
    attachment_url: str | None
    geometry: str | None

RoadEventImpact

class RoadEventImpact(BaseModel):
    description: str | None
    severity: int | None
    regulations: tuple[int, ...] | None
    block_way: int | None
    blocked_lanes: str | None
    duration: RoadEventDuration | None
    detour: RoadEventDetour | None

RoadEvent

class RoadEvent(BaseModel):
    id: str
    title: str | None
    description: str | None
    type: int | None
    subtype: int | None
    step: int | None
    effective_at: MaybeTimestamp
    expires_at: MaybeTimestamp
    positions: str | None
    geometry: str | None
    location_type: int | None
    location: RoadEventLocation | None
    impact: RoadEventImpact | None
    url: str | None
    attachment_urls: tuple[str, ...] | None
    source: str | None
    published_at: MaybeTimestamp
    updated_at: MaybeTimestamp

RoadEventAuthority

class RoadEventAuthority(BaseModel):
    code: str
    id: str | None
    name: Name | None
    telephone: str | None
    email: str | None
    address: str | None
    website: str | None
    updated_at: MaybeTimestamp
    oid: str | None
    logo_url: str | None