landtransportsg.geospatial

Geospatial module.

Example usage:

# get a geospatial whole island layer
from landtransportsg import Geospatial
client = Geospatial(API_KEY)
geospatial_whole_island = client.geospatial_whole_island('ArrowMarking')

Methods

class landtransportsg.geospatial.Client(account_key: str)

Bases: Lta

Interact with the geospatial-related endpoints.

References: https://datamall.lta.gov.sg/content/dam/datamall/datasets/LTA_DataMall_API_User_Guide.pdf

Parameters:

account_key (str)

geospatial_layer_ids() tuple[str, ...]

Return the tuple of valid geospatial layer IDs.

Returns:

Tuple of valid geospatial layer IDs.

Return type:

tuple[str, …]

geospatial_whole_island(geospatial_layer_id: str) str

Get the SHP files of the requested geospatial layer.

Parameters:

geospatial_layer_id (str) – Name of geospatial layer. Refer to the GEOSPATIAL_WHOLE_ISLAND_LAYER_IDS constant for the list of valid IDs.

Raises:
  • ValueError – geospatial_layer_id is not specified.

  • ValueError – geospatial_layer_id is not a valid ID.

Returns:

Link for downloading the requested SHP file.

Return type:

Url

Types

landtransportsg.geospatial.Url

alias of str