Safe Spots are essentially buildings or locations that can be considered safe in a locality. This exercise was undertaken as a part of Safecity initiative to aggregate details of spots that one can depend on for safety in times of a perceived threat or danger. We have considered public places such as police stations, and spots where crowds maybe present such as malls, as they relatively safe. The spots were to be collected and embedded onto Safecity maps, as a quick resource that can be depended upon.
The locations of the following safe spots were gathered for various cities :
- Police Stations
- Hospitals
- Malls
Code here demonstrates flow for collecting details of Delhi hospitals. You'll need to obtain an API key from https://developers.google.com/places/web-service/intro.
Google Maps API allows the user possessing a relevant API key to scrape locations and their details from Google Maps. There are various API's available; Places API is specifically for the places' details.
The API allows search to be scripted both by -
- Specifying location name
- Specifying location co-ordinates (latitude, longitude) as well as radius from the location within which the spots need be to located
The corresponding format for the above url queries can be found at https://developers.google.com/places/web-service/search.
NOTE: Only first 60 search results can be scraped for free.