I have a working map based ios app which centers on the users location and move as the user moves. I wish to add functionality to it so that when the map is opened it drops pins where the nearest 'butcheries' are. I can't find an example of such a 'search' query. Thanks
there are two ways
1) query a web API which delivers those results (i.e. factual.com)
2) forward the query to the local Google maps SDK (some dozen megabytes)
Related
Using the web version of Google Maps, I can enter a general place, like a neighborhood, and it will show that neighborhood, with its borders directly highlighted. Like this:
I want to be able to do this using the iOS SDK. However, I cannot determine through the documentation how to load a location by means other than a Lat/Long. Does this require the use of the Places API to work? If so, how?
Once I am able to display this, I want to display the user's current location on the screen, but keep the frame locked to the neighborhood. Basically, it will indicate to the user when they have wandered outside the specified area.
The Google Maps Api does NOT return neighborhood boundaries. You will have to build your own API for that.
If you're interested in NYC neighborhoods - I would contact the owner of locality.nyc - he can provide you with an API for that.
In my rails application i have some model Location that holds the address and corresponding latitude and longitude.
At the main page, user can search for a location from which he wants to find the nearest places in location table.
I use JavaScript Google API for geocoding on the client side. Since the limit per user is 25000 req/day i guess i do not need to worry about it cause no one will want to search for a location so many times. I use Ajax for sending geocoded latitude and longitude from client to the server.
Now i'm on the sever side and have a reference point and table of locations. But at this moment, i guess i cannot use geocoder gem which use Google API for estimating some nearby locations, cause from the server side there is a limit of 2500 requests per day and i expect to exceed it(don't want to pay either).
What tool can i use to easily return some nearby locations without calling external API? I know that there are other API's but all of them have either limitations or obligations and since it's more like mathematical calculation i can't see the reason to play around with API at this point.
Assuming that you're using a relational database, you can use ElasticSearch to index your Locations and search through them using Geo Distance Range Query.
Other similar option would be use a Mongo collection and take advantage of the Mongo's $near operator.
Edit:
There're some questions related to your question which can be useful if you're using MySQL/PostgreSQL:
Find closest 10 cities with MySQL using latitude and longitude?
postgres longitude longitude query
I'm making an iOS app that needs to be able to find the most populated cities within a radius from a certain point, and to calculate a route that passes through a certain number of those cities, that satisfy a certain time constraint. I'm planning to use Google to give me polylines that I can put directly on an Apple Map in the Mapkit for Xcode. I've looked into the Google Maps SDK for iOS, and Google Places. Google also has a Directions API, and a Distance Matrix API. With so many API's, I'm slightly confused about which one I should use, and for what.
Additionally, do Google API's provide city population, or should I find that via another database?
You can use Google Maps URL Scheme to get directions for Google Maps iOS.
If you are ever confused about which API to use for Google Maps, you can use API picker.
There is no Google API that give city population, so you would need to find it with a another database.
I come here to ask you some informations or maybe help to try to do what i want.
Here it's what i want to realize:
I have a website and on it i have some places in database (with lattitude and longitude saved). I want allow users, when they click on a button, display a map with a marker on their actual position and others markers who will represent the places from the database near them.
I found some tools like google map API v3. With it i can show the user position but i don't know how i can display the position of the places store in my database.
If you have any ideas or examples.
Thank you.
(PS: Sorry for my english)
I built a similar app with Spring and Java. What you'll have to do is create Placemark JS objects and pass them to the Google Maps API. You can also pass a map size to determine the scope of the map returned to the user.
In order to determine nearby locations, simply build some ruby/rails code to limit the distance of locations from the user location.
Get user location
Determine which locations to show on map within your rails app
Pass desired placemarks to Google Maps (This can be found in API docs which are great)
Display the map returned by Google Maps on a view.
I think you could use geocoder gem for that:
http://www.rubygeocoder.com/
I am creating a webpage that includes maps for my software engineering thesis. The page will include following features:
Show a specific location and save it to a database;
Showing different roads in the same map and save then to database;
Getting the nearest road that passes nearby a specific location pointed by a user - a little search function;
Users might be allowed to create different roads, which can be saved in a database.
The thing is that the service (API) used should be free. For this reason, we might not be using Google Maps.
We are using Java for the Model Classes.
Which maps API can I use?
How can I ask it which of the roads is nearest to a certain point (location) on the map?
Google Maps API is Free as long as you are not using more than a certain amount of traffic. If its for a class project it should be fine, but if that project turned into a commercial site, it would become expensive.