Get nearest business name/type by address or GPS coordinate - ios

I'm writing an iOS application and it would be very handy to know the way to find a nearest business name (and especially business type, such as restaurant/hotel/store etc.) by a GPS coordinate, or at least by an address.
So just curious, is there such API/Web service out there?

Yes
Bing
Google Places
Yahoo Geo Technologies
I'm sure there are loads more to be found with a quick google

OK, it seems like I have to answer my own question. I didn't try it out in code, but the answer is here:
http://code.google.com/apis/maps/documentation/places/
Unfortunately there seems to be a cap on how many times Google places API can be called (for free), i.e. 1000 times per day (for the same API_key.)

Related

Scalable solution for geocoding on iOS

I'm working on an iOS app that pulls events from Google Calendar and subsequently generates pins on a map for each event (based on what the event creator fills in for "Location"). The user can select a date range (today, this week, this month, etc.) and see all the events taking place near them over that period.
Problem 1: The app is for my local university, so a majority of the locations will be buildings on campus. These buildings have inconsistent addresses that are often difficult to find, so it would be good if the location "Foo Hall" would result in a pin on that building. Google Maps is capable of doing this, however Apple Maps has no knowledge of the buildings on my school campus.
Problem 2: In an ideal situation, thousands of students would be using this app. Each time they open the app, they could be viewing dozens of pins. Therefore, I'm worried that I may be pushing the limits imposed by Google's geocoding API (definitely the 2500 request limit, and maybe even the 100,000 request limit for the Business API).
So my question is... what would be the best solution for these two problems? Should I create a local database for building names and map them to coordinates? Or is there a way I can overcome the limitations of Google's Geocoding API? Is there a better solution I'm not thinking of?
Thanks for any help!
I would use latitude and longitude coordinates for the buildings and allow for people to add locations to the database if they are meeting somewhere that you have not added already. This way, the pins will drop in the center of the building if you want them to, because you are not relying on an address or on looking up a building name. You simply know that "Foo Hall" is at X latt. and Y long. And if someone selects "Foo Hall" or sees an event at "Foo Hall" there is a perfectly placed pin right in the middle of it on the map. I don't think you need to worry as much about the geocoding API if you are using hardcoded locations for the buildings either, because you won't have to be polling Google to get the building locations.
I would also use some sort of server to store the building locations so they can be updated or added to, either by you or by the users.
That's how I would handle it, good luck!

how to find location with business name?

I am trying to build an iphone app that finds the location with business name.
For example, I want to annotate a restaurant and I want to find it with the name of restaurant. I was trying to use CLGeocoder, but it seems like geocoder does not help in this case. I am not sure what to do.. can anyone give me a hint about this?
Thank you
Google maps will take a business name and return location(s). It sounds like a webservice is what you're needing, you'll just have to think through the inputs, the outputs, and figure out how it all logically fits into your app.
"Business name" is info independent of the address and not available to CLGeocoder. For this you have to use an external service where business names are actually registered. I would suggest the Google Places API, but the search results will still be limited to those businesses registered to Google.
And yes, you will have to dirty your hands with "NSURL stuff", and process the results with "NSJSONSerialization stuff".
If you're happy to consider an SDK-based solution, Huq Industries offer exactly this as part of their Real-world Analytics platform. They've done a lot to address the problem of reliably relating device location to physical businesses accurately by combining location with other data including WiFi. You can get business events by business name, category and address.
Coverage is pretty global and it's mostly free. Check out the SDK repo on GitHub.
Disclaimer: I contributed to this.

Reverse geocoding services

I'm working on a project that returns information based on the user's location. I also want to display the user's town in text (no map) so they can change it if it's not accurate.
If things go well I hope this will be more than a small experiment, so can anyone recommend a good reverse geocoding service with the least restrictions? I notice that Google/Yahoo have a limit to the number of daily queries along with other usage terms. I basically need to take latitude and longitude and convert them to a city/town (which I presume cannot be done using the HTML5 Geolocation API).
Geocoda just launched a geocoding and spatial database service and offers up to 1K queries a month free, with paid plans starting at $49 for 25,000 queries/month. SimpleGeo just closed their Context API so you may want to look at Geocoda or other alternatives.
You're correct, the browser geolocation API only provides coordinates.
I use SimpleGeo a lot and recommend them. They offer 10K queries a day free then 0.25USD per 1K calls after that. Their Context API is what you're going to want, it pretty much does what is says on the tin. Works server-side and client-side (without requiring you to draw a map, like Google.)
GeoNames can also do this and allows up to 30K "credits" a day, different queries expend different credit amounts. The free service has highly variable performance, the paid service is more consistent. I've used them in the past, but don't much anymore because of the difficulty of automatically dealing with their data, which is more "pure" but less meaningful to most people.

Bing API for finding nearby cities

Is there a Bing API for finding nearby cities given a city name or lat/long combination?
I don't know if Bing provides this, but you build your own from the data available from geonames.org
They provide an API to get places near a given lat/lng: http://api.geonames.org/findNearby?lat=47.3&lng=9&username=demo
Or you can also go all out and implement a solution for your own needs using their data, as per this answer: Given the lat/long coordinates, how can we find out the city/country?
I think this is what you're looking for: Bing Maps API Sample
The short answer is no, there is no Bing API for finding nearby cities.
That said, it would be possible to 'cook your own' using the existing APIs. However, one thing that would need clarification is what 'nearby' means. I presume you mean within a specific radius of a given point (determined by a city name or lat/long combination).
Using the Bing Api it would be fairly trivial to implement an algorithm to reverse geocode a location and then test for places within x distance.
Failing that, you could use something like geoPlugin, it is free and you can put it on your sever - thus avoiding 3rd party up-time issues.
http://www.geoplugin.com/webservices/php#php_class
Take a look at the nearby places features, this does exactly what you want.
http://www.geoplugin.com/webservices/extras
No, there isn't. However, it's relatively simple to get the bounding box for a given coordinate and then use the Bing Maps API with that. I'm doing this and used this solution to get what I needed...
https://stackoverflow.com/a/14314146/73680

How do I find a place of business from geolocation information?

Let's say I'm just wondering around with my cellphone and I want to know exactly which place of business I'm in. This would seem to be easy, but I don't see away to do it. It's possible to reverse geocode but this gives an address range. Google doesn't seem to have http base local search using local information, because you could kind of guess from the local search or points of interest. It needs to be through an http API, not an ajax driven map. Is there a way to do this?
You might look at GeoAPI, which lets you search for businesses near a particular lat/lon coordinate and returns detailed information about the business (name, type, hours, etc.). It's a simple JSON API with good documentation and examples.
There's likely more APIs out there for local business data -- which I personally would love to hear about if people want to add them as answers to this question or comments on my answer. What's your favorite? What are the advantages and disadvantages?

Resources