The Hunt for POIs (Points of Interests)
But how to get that data?
locations and borders (where available)
know in which administrative region a place belongs
draw administrative regions borders
distance from the city center
What I look for in this document:
A catalog of Points of Interest (POIs)
Caution! Open Data does not mean that I am not going to pay for the service! (see Mingle.io as an example)
http://gis.stackexchange.com/
https://help.openstreetmap.org/questions/15/getting-point-of-interest-data-from-openstreetmap
http://wiki.openstreetmap.org/wiki/List_of_OSM_based_Services (not useful)
The POI database is 28GB and downloadable. http://stackoverflow.com/questions/1875255/open-source-poi-database
Getting POIs: http://www.quora.com/What-are-the-pros-and-cons-of-each-Places-API
Discussion about POI services: http://gis.stackexchange.com/questions/10299/poi-datasets-for-north-america
Aggregators from various (Open) Data sources
SimpleGEO is no more, it has been bought by Urban Airship (http://blog.programmableweb.com/2012/01/12/simplegeo-apis-closed-but-places-data-is-open/ )
Now the data is in Factual: www.factual.com (unclear how much it costs...)
They have a iOS SDK + iOS Demo on GitHub, however in the demo only the US POIs database is used.
A service to query POIs from various datasets.
[ {a.name, a.lat, a.lon, a.amenity, a.cuisine} | a <~ osmpois, a.type =~ "FOOD_" ]
Playing with Mingle.io API
[ {a.name, a.lat, a.lon, a.amenity, a.tourism, a.opening_hours, a.fee} | a <~ osmpois, a.type =~ "TOURIST_", a.tourism =="museum" ]
→ gets us all museums in the dataset!
dist(e.lat, e.lon, 51.5019, -0.1274) < 0.300
[ {a.name, a.lat, a.lon, a.amenity, a.tourism, a.opening_hours, a.fee, a.type, a.information, a.historic} | a <~ osmpois, a.type =~ "TOURIST_", a.tourism =="museum", dist(a.lat, a.lon, 51.5019, -0.1274) < 0.300]
--> 1 result (chuirchill war museum)
[ {a.name, a.lat, a.lon, a.amenity, a.tourism, a.opening_hours, a.fee, a.leisure, a.natural, a.type, a.information, a.historic} | a <~ osmpois, a.leisure=="park", dist(a.lat, a.lon, 51.5019, -0.1274) < 0.300]
--> 1 result (parliament square)
[ {a.name, a.lat, a.lon, a.amenity, a.tourism, a.opening_hours, a.fee, a.leisure, a.natural, a.type, a.information, a.historic} | a <~ osmpois, a.type =~ "POI", dist(a.lat, a.lon, 51.5019, -0.1274) < 1.300]
--> Generic POIs in London
To ask more than 10 results, need to use the API
A correct JSON call is as follows: (Note the \ ESCAPE char)
"expr": "[ {a.name, a.lat, a.lon, a.amenity, a.tourism, a.opening_hours, a.fee, a.leisure, a.natural, a.type, a.information, a.historic} | a <~ osmpois, a.type =~ \"POI\", dist(a.lat, a.lon, 51.5019, -0.1274) < 1.300]",
http://dev.citysdk.waag.org/
"The CitySDK Linked Open Data Distribution API is a linked data distribution platform. Developed by Waag Society, the distribution API is a component of the CitySDK toolkit. This toolkit supports the development of open and interoperable interfaces for open data and city services in eight European cities (Amsterdam, Helsinki, Manchester, Lisbon, Istanbul, Lamia, Rome and Barcelona). The CitySDK Linked Open Data Distribution API enables the distribution and linking of open data sets and city services. "
CitySDK is a very powerful API as it allows to do something different from the rest:
queries based on the administrative region (e.g. query what are the railway stations within a certain city's borders)
working with borders of objects (you can get the border of parks, for example. Very cool!)
However data from OSM is currently not up-to-date. Moreover, some points of interest are duplicated among many layers. While the latter is an issue that requires a different approach to be solved, the real limitating factor here is the inaccuracy of Open Streetmap Data, not the power of the API itself.
The GeoNames geographical database covers all countries and contains over eight million placenames that are available for download free of charge.
They offer JSON services, for free with daily limit based on “credits” (30.000 credits per day). Credits are tracked by login name (registered users, for free). Address is: http://www.geonames.org/export/JSON-webservices.html
get POIs nearby to a certain lat,lon (4 credits).
examples of calls to API:
view-source:api.geonames.org/search?country=NL&name=Amsterdam&username=[YOURUSERNAME_HERE]
view-source:api.geonames.org/search?country=NL&name=Amsterdam&adminCode1=NH&username=[YOURUSERNAME_HERE]
To search for a city called amsterdam in adminCode1=07 (Noord Holland):
view-source:http://api.geonames.org/search?country=NL&name=Amsterdam&adminCode1=07&featureCode=PPLC&username=maggix
Search for a city called Rotterdam:
view-source:http://api.geonames.org/search?country=NL&name=Rotterdam&featureClass=P&featureCode=PPL&username=[YOURUSERNAME_HERE]
Problem with this search comes in US:
view-source:http://api.geonames.org/search?country=US&name=Sacramento&featureClass=P&featureCode=PPL&username=[YOURUSERNAME_HERE]
Using OpenStreetMap: http://wiki.openstreetmap.org/wiki/Using_OpenStreetMap
These are the “things” we want to take out from OSM:
http://wiki.openstreetmap.org/wiki/Map_Features
“Nominatim (from the Latin, by name) is a tool to search OSM data by name and address and to generate synthetic addresses of OSM points (reverse geocoding). It can be found at http://nominatim.openstreetmap.org . Nominatim is also used as one of the sources for the Search box on the OpenStreetMap home page and powers the search on the MapQuest Open Initiative websites.”
Web service: http://nominatim.openstreetmap.org/
Query and obtain JSON: http://nominatim.openstreetmap.org/search.php?q=Vondelpark%2C+Amsterdam&format=json
How to use it: http://wiki.openstreetmap.org/wiki/Nominatim
However, I do not need Nominatim. I need a list of POIs.
http://wiki.openstreetmap.org/wiki/Xapi
There are various services implementing this API, they are hosted by various companies. See InformationFreeway, Nogago or (quoted below) OpenMapQuest.
Overpass API seems more powerful than XAPI. However unclear how to query it:
http://wiki.openstreetmap.org/wiki/Overpass_API
"MapQuest is an online mapping company based in the United States and is wholly-owned by AOL." (Wikipedia)
Mapquest offers an iOS SDK to use OpenStreetmap tiles into app, but uses licensed API: http://developer.mapquest.com/web/products/featured/apple-ios-maps-api (at this page for download link)
Refer to README.TXT for setup
## Using MapQuest Commercial Services (MapQuest map tiles and Geocoding)
To use MapQuest commercial services, you will need to add the following property to your application's info.plist file:
Set the value of this property to your MapQuest key.
MapQuest Open Data maps: http://open.mapquest.com
Editing Open Data maps with Potlatch2 from MapQuest: http://developer.mapquest.com/web/products/open/tools/edit
MapQuest Open Data maps products: http://developer.mapquest.com/web/products/open
It’s possible to query OpenMapQuest and get back JSON, by using this GET request in Postman (add-on for Chrome): http://open.mapquest.com/_svc/searchio?action=mapSearch&query=Parks&shapepoints=-121.22448753036838,49.90014915101582,-77.05944846963166,27.340340242846267&mapSearchArea=(39.54454183982155,-99.16394065624912,13867001,1005,667,1.0,1.0)
(this request will return Parks in the U.S.)
What is it: http://developer.mapquest.com/web/products/open/xapi
User guide: http://open.mapquestapi.com/xapi/ (old! Not updated!)
Sample GET request: http://open.mapquestapi.com/xapi/api/0.6/node[amenity=pub][bbox=-77.041579,38.885851,-77.007247,38.900881]
---> Response is an XML . Tested with Postman
Beginner’s guide to OSM: http://developer.mapquest.com/web/products/open/tools/guide
The product I need is MapQuest Discover: http://discover.mapquest.com/ ← are there API for it?
Search: http://developer.mapquest.com/web/products/dev-services/search-ws (5000 free per day, otherwise Enterprise License needed, $ 2500 per year)
“We started MapBox to make it easy for anyone to design and publish a beautiful custom map.
Our platform gives developers the power to make maps that embody their product and brand. MapBox helps you find bars on foursquare, search for hotels on Hipmunk, and organize notes in Evernote. With our global, autoscaling infrastructure and cross-device compatibility, integrating our maps into your apps is easy even if you have millions of users.”
MapBox provides a SDK to embed in a iOS app their maps. The strength of MapBox is the possibility of using custom map tiles, and that is able to get Polylines out of GeoJSON files, without the need to parse it as I do in the iOS MapKit SDK.
Starting page for developers: http://www.mapbox.com/developers/
MapBox does not provide API to get POIs, so although the MapBox SDK looks quite powerful (allows easy conversion from GeoJSON data to Polylines), it is useless for getting POIs.
Mapbox helped developing the editor for OSM.
http://www.openstreetmap.org/edit?editor=id
Foursquare has the concept of Venues: https://developer.foursquare.com/overview/venues
“Just need a database of places? The Venues Platform allows developers to search for places and access a wealth of information about them, including addresses, popularity, tips, and photos. It's available free and without any user authentication, as long as applications include adequate attribution.”
https://developers.facebook.com/docs/reference/fql/place
Foursquare requires the user to be logged in to Facebook to access the places.
(Consider using Facebook as a platform also for Leaderboards, user login, etc. This would be the basis to build a Facebook Game)
http://dev.virtualearth.net --> http://msdn.microsoft.com/en-us/library/dd877180.aspx
To get POIs, with Bing Maps we have to use “Spatial Data”.
http://msdn.microsoft.com/en-us/library/ff701734.aspx
“The Bing Spatial Data Services are REST-based services that offer three key functionalities: batch geocoding, point of interest (POI) data, and the ability to store and expose your spatial data. These services are ideal for those who need a place to store their spatial data, or who need point of interest data in their application. “
Query example for POIs in EU:
http://spatial.virtualearth.net/REST/v1/data/c2ae584bbccc4916a0acf75d1e6947b4/NavteqEU/NavteqPOIs?spatialFilter=nearby(50.1120796203613,8.68340969085693,100)&$select=EntityID,Latitude,Longitude,DisplayName,__Distance,LanguageCode&$top=3&key=anyBingMapsKey
https://developers.google.com/places/documentation/
For searching for POIs nearby, the search would be:
https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters
(see: https://developers.google.com/places/documentation/search#PlaceSearchRequests )
Google API Client Library for Objective-C has no support for Places (or Maps)
Google Maps SDK for iOS is only for showing map
Look at this tutorial: http://www.raywenderlich.com/13160/using-the-google-places-api-with-mapkit
The Google Places API has the following query limits:
Users with an API key are allowed 1 000 requests per 24 hour period.
Users who have verified their identity through the APIs console are allowed 100 000 requests per 24 hour period. A credit card is required for verification, by enabling billing in the console. We ask for your credit card purely to validate your identity. Your card will not be charged for use of the Places API.
While the lower limit is sufficient for development and testing, we recommend enabling the higher limit before launching your application. It is possible to request additional quota.
Note that some services may have a multiplier. For example, Text Search is subject to a 10 times multiplier, causing each Text Search request to count as 10 requests against your quota.
API: http://www.yelp.com/developers/documentation/v2/overview
Samples: https://github.com/Yelp/yelp-api
(Note: the samples only build a Yelp API client library and not a demo project)