landtransportsg.geospatial

Client for interacting with the Geospatial API endpoints.

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.Client(account_key)

Bases: landtransportsg.client.__Client

Interact with the geospatial-related endpoints.

References

https://www.mytransport.sg/content/dam/datamall/datasets/LTA_DataMall_API_User_Guide.pdf

geospatial_whole_island(geospatial_layer_id)

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 names.

Returns

(str) Link for downloading the requested SHP file.

Raises
  • ValueError – Raised if geospatial_layer_id is not specified.

  • ValueError – Raised if geospatial_layer_id is not a string.

  • ValueError – Raised if geospatial_layer_id is not a valid ID.