-
Notifications
You must be signed in to change notification settings - Fork 0
Mapping
The mapping module contains functions that utilise various mapping services to gain geographical data.
It's mainly for use by functions in the heuristics
module, but you can use it to customise what types of points of interest are looked for.
dist(loc1, loc2, prnt=False)
Gets the walking distance between two (latitude, longitude)
tuples.
Note: requires an OSRM HTTP server to be running at localhost:5000
, and the osrm-py
module.
alt(loc, prnt=False)
Gets the altitude of a (latitude, longitude)
tuple.
Note: requires the SRTM.py
module.
poi(loc, radius=100, prnt=False)
Finds the number of points of interest within radius
metres of loc
.
The OverPass API is used for the query.
What is considered a 'point of interest' is determined by the features
dictionary in the mapping
module, and is a subset of OpenStreetMap's Map Features. This dictionary can be changed to find different points of interest.
Note: Sending requests to the OverPass API has been found to be disproportionately slow. It is recommended to use a cache (and save it to a file for later) if you want to use this metric.