in Windows Phone 8 I need when iam in the range of 1km from a specific point i see a toast notification - windows-phone-8

I need in WP 8 when a device be in the range of specific point (say 1km range) the application shown a toast notification tell me that am near this place.

You should fix a set of coordinates, latitude and longitude which is your specific point.
You have the position changed event for the geolocator which you can handle.
like here:: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247548(v=vs.105).aspx
Once you have that working, you can calculate distance between two locations as shown here,
Calculating Distance between two Latitude and Longitude GeoCoordinates
And you can show any pop up on the screen if you find that the distance is greater than or equal to 1km.
Hope that helps.

Related

Filter POIs that are close to a route

I have a list of Points-of-Interest (e.g. car rest areas).
The user selects the Starting Point and the Ending Point.
This generates a route.
How can I programmatically filter the POIs that are close (e.g. 50 meters distance from the road) that route?
Can Google Maps SDK or OSRM offer this functionality?
Thank you,
Nick
1. You have to find the distance from one POI to the road.
In order to accomplish this, you have to store your road in a mathematical fashion:
You can sample equidistant points of your road and store them in an array (more practical, less precise) and then calculate the distance of the POI from every point in the array, then save the minor result and repeat the whole process for every POIs.
You can store a road in a function (more and more complex, but more precise). Now that you have this function, you can calculate same distance from your POI, take the minimum value and repeat for all POIs.
2. Google Distance Matrix can actually do this
With this Api you can calculate distance till 2500 origins * destinations points.
The result will give you an array of rows, with each row corresponding
to an origin, and each element within that row corresponds to a pairing of the origin with a destination value.
Example of a request:
https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=32.777211,35.021250&destinations=32.778663,35.015757&key=YOURAPIKEY
This is very useful to your goal, because lets you specify more than one points of which calculates distance.

Google places radar search with a radius greater than 50,000 meters

I'm trying to find all Panera restaurants within a 200 mile radius of a certain point.
Here is the URL I have been using so far :
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=39.52963,-119.81380&radius=321869&type=restaurant&name=panera&key=your-key-here
However, I have found out that radius has a maximum of 30 miles. Can anyone suggest a quick workaround for me?
Thanks to all in advance.
Open Google Maps and save 8-10 or more points' lat,long value to trigger your request. Then use a loop to find all places within these points. If you want more precise results, increase first trigger points for your requests.
I tried, it works.
Assume we are using php
$triggerPoints = array("lat1,long1", "lat2,long2", "lat3,long3",....);
foreeach(triggerPoints as $t){
$requestUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=$t&radius=[YOUR_RADIUS_VALUE]&type=restaurant&name=panera&key=your-key-here";
$results = file_get_contents($requestUrl);
//Do what you want with response JSON data
}
Important: When you choose trigger points, those points should intersect according to your radius value. So you don't miss any restaurants
Business license with for higher usage limits.
Contact Google sales
Google place nearby search maximum 50,000 meters (31 miles) .
if you try enter more than 50,000 it not work proper.
There is another way for find all restaurants in a city.
google provide Text Search Requests
https://maps.googleapis.com/maps/api/place/textsearch/json?query=restaurants+in+Reno,NV,89501,USA&key={API_KEY}
query = keyword + in + city Name
for get city name using latitude longitude
http://maps.googleapis.com/maps/api/geocode/json?latlng=39.52963,-119.81380&sensor=true
For more information how to get city name using latitude longitude
https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding
for more information about how to use Text Search Requests
https://developers.google.com/places/web-service/search

Google geocoding viewports

Does the viewports in the Google geocoding represents the boundary boxes of the location ? Iam trying to use google viewports of particular city or location to search for the latitude and longitude values that fall in those bounding values.
I have two tables called tblproperty and tblemailalerts, tblproperty has got latitude and longitude values and tblemailalerts also got viewport + latitude and longitude values . Now I want to get the sql to get the matching records with accuracy
I want to achieve similar to zoopla search
for example when user selects location as london , properties should be shown within the boundaries of london. If they select london within 1/4 mile radius i should get the properties within the london + properties with 1/4 radius
The viewport bounds parameter only biases the results. It's not a hard limit. You can read about viewport biasing in the API documentation.
However, the viewport returned by Google for a query for "London" does represent a bounding box you can use in your SQL query.
You could also use the OpenStreetMap API. The query to get a bounding box for London is:
http://nominatim.openstreetmap.org/search?q=London&format=json
In there you will find a number of bounding boxes for places called "London" around the world, but the first one is London, United Kingdom.

to find locations in google map within 5 km radius of a given point

hey i just want to gather the locations in google maps database which are under 5 km radius of the given point.. i will be storing them in database for later processing .....can this be done...thanks...how to get longitude and latitude of points with in the required circle...
You can use PlaceSearches
with the parameter : radius

What should be the sspn value for 1mile X 1mile square on map for google local search api

What should be the sspn value for 1mile X 1mile square on map for google local search api?
I tried out sspn value to be 0.01,0.01 but not very sure about this.
I need to search from google local search for businesses within 1 mile radius of the current user's position.
The latitude part of the sspn is 0.0145.
The longitude part varies depending on where you are. The closer to the pole you are, the fewer miles there are per degree. If you're on the equator, then it's 0.0145, the same as the latitude, but as you move towards the poles it gets larger in proportion to 1/(cos(latitude))
The equation is 180/(3959*cos(latitude)*pi) per mile.
However, since you only need the sspn values accurate to within a factor of 2, the values 0.015,0.025 would be sufficiently accurate for much of the Earth.