Google Distance Matrix Api - google-distancematrix-api

anyone know, how to use google distance matrix Api but destination from webserver?
for example, i want to use google distance matrix api and latitude longitude destination from this url sempatbimbel.esy.es/actions/jsontbimbel.php

I know it is late. First, you need to get the IP address of this website (like ping in the ASP,PHP,....), then convert the IP to lat/long, something like this http://geoipinfo.org/ . Now, you have two sets of coordinates: Geo coordinates of the website and your destination.
then pass these geolocations to Google AP like this
https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6655101,-73.89188969999998&destinations=40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626&key=YOUR_API_KEY
from https://developers.google.com/maps/documentation/distance-matrix/intro

Related

Xamarin.Forms: how to get driving distance between two points?

My app currently uses Location Services. During debugging, I retrieve my current location using GetLastKnownLocationAsync: myposition.Latitude is 40.758896 while myposition.Latitude is -73.985130.
My SQL Database has a list of Walmart stores, and there's a Walmart with Latitude & Longitude of 40.660992 & -73.7267629.
How can I calculate the driving distance between my set of coordinates and Walmart's coordinates? It would be something like Google Maps' Driving Directions or Waze.
I understand that I can use this SO link to calculate the distance between two sets of point, but I assume apps like Google Maps or Waze consider the actual driving distance between two sets of points. The link above would be great if there were a straight street between two points. Obviously, that's not the case.
I have used Xamarin.Essential library to find the distance between two point
You can use something like this
var location = new Location(21.705723, 72.998199);
var otherLocation = new Location(22.3142, 73.1752);
double distance = location.CalculateDistance(otherLocation,DistanceUnits.Kilometers);

Google Streetview Images without direction or camera angle

Is it possible to get the image based on an address using the API? I have seen that it is possible to get them via latitude, longitude (which I do have) direction and camera angle (which I do not have).
I made some research and found posts from several years ago, which stated it would not be possible - but technology evolves and I wanted to know if anyone has an idea how to get an image based on the address.
Theoretically Google would be able to do that; they know where the images has been taken and can calculate the direction to the address.
It actually is possible,
the nearest streetview panorama can be found via the API, and the heading to the actual position can be calculated.
As in this article:
Google Maps Api StreetView PanoramaOptions Point of View Setting from Lon Lat

How to calculate the driving distance between two points?

In my app I am getting the latitude , longitude co-ordinates of places using GeocodeService now I want to get distance between these places.
I've tried GetDistanceTo method to get the distance two location co-ordinates but it gives me stright distance.
How can I calculate driving distance between two locations?
thanks in advance
To calculate the driving distance you'll have to use the Bing Routes API (or Google, but I assume you're using Bing Maps).
There's an example of using the api to find a driving route between two places here: http://msdn.microsoft.com/en-us/library/gg636957.aspx
The general call is:
http://dev.virtualearth.net/REST/V1/Routes/Driving?o=xml&wp.0=location1&wp.1=location2&avoid=minimizeTolls&key=BingMapsKey
You'll have to register for a Bing Maps API key, and then replace location1 and location2 with the locations you like.
The distance should be returned in travelDistance in the json or xml

Getting route distance given two geo coordinates

I am creating a windows phone application which uses map control in it. I want to calculate the driving distance between two geo coordinates in windows phone? can any help on this please
You need to work through this example in MSDN Magazine http://msdn.microsoft.com/en-us/magazine/hh148148.aspx
It explains how to do the routing and get the distance property in the results.

Plotting dots to a map given latitude and longitude

Summary: I need a tool that can put 60m+ points on a map image. I'm trying to show density map and would like to plot a dot for each point (lat/long) on the map.
Hi I'm working on project that requires a density map. I have latitude and longitude and all the tools that I have seen (Ammap, FusionCharts maps, google charts/map) requires either XML or JSON or some other data type with the data points. Problem here is that, I have 60 million + data points and transferring any type of object with that many data point is not feasible.
One solution I can think of is mapping latitude and longitude to pixels of the map image. That requires a lot of time and work. I was wondering if you guys have done something similar and know of tools that can do this for me. It doesn't have to be free.
You'd be much better off creating a heatmap instead of passing all of the individual points to the map, which would get very busy, very quickly.
There are already a few discussions over at GIS.StackExchange about this exact topic. Search the the [heatmap] tag.
Since you mentioned FusionCharts, assuming you can load all of your data into a Google Fusion Table, it looks like you should be able to make a heat map in Google Fusion Tables).

Resources