Azure Maps - Route directions across the ocean - azure-maps

I am trying to calculate the distance between two coordinates across the Atlantic Ocean using the Azure Maps routing service.
Unfortunately I always get the following error:
{
"error": {
"code": "400 BadRequest",
"message": "Engine error while executing route request: NO_ROUTE_FOUND"
}
}
Does Azure Maps support the calculation or am I doing something wrong?
This is the example of the request which returns the error:
https://atlas.microsoft.com/route/directions/json?api-version=1.0&subscription-key=XXXX-XXXX-XXXX-XXXX&query=29.757290,-95.357379:48.876584,2.339379
The coordinates are valid.
29.757290,-95.357379 is Houston (Texas, USA)
48.876584,2.339379 is Paris (France, Europe)
Can anybody help? Thanks.

The routing service calculates routes along roads, so it will fail to calculate a route that crosses the Atlantic Ocean. If you want to calculate the straight line (geodesic) path across between two points you have multiple options:
Use the great circle distance service: https://learn.microsoft.com/en-us/rest/api/maps/spatial/get-great-circle-distance?tabs=HTTP
If using the Azure Maps Web SDK, there is a built in math library. Use atlas.math.getDistanceTo function: https://learn.microsoft.com/en-us/javascript/api/azure-maps-control/atlas.math?view=azure-maps-typescript-latest#azure-maps-control-atlas-math-getdistanceto
Use the Haversine Formula directly in your code: https://rosettacode.org/wiki/Haversine_formula (this link provides the formula in over 120 programming languages).

Related

Google Street View Premium Plan API - API server rejects your request

I'm trying to switch from basic Google Street View API to Premium. As such, when I'm using:
(space after https is added because I can't post more than two links in the post)
https:/ /maps.googleapis.com/maps/api/streetview?location=40.720032,-73.988354&size=400x400&fov=90&heading=235&pitch=10&key=MY_PREMIUM_API_KEY
I get an image with a Google watermark, which does not scale further than 640x640, same as when using a basic API key.
Okay, to use the advantages of Premium GSV API, I also need to make a digital signature. I've generated a secret key and signed my url (with dropped domain, as said in the tutorial) using python code from there: https:/ /github.com/googlemaps/url-signing/blob/gh-pages/urlsigner.py - it generates just the same signature as one on the Google website: https://developers.google.com/maps/documentation/streetview/get-api-key?hl=en_GB#premium-key
Finally, I add the signature to the URL:
(space after https is added because I can't post more than two links in the post)
https:/ /maps.googleapis.com/maps/api/streetview?location=40.720032,-73.988354&size=400x400&fov=90&heading=235&pitch=10&key=MY_PREMIUM_API_KEY&signature=MY_BASE64_SIGNATURE
However, this is what I get in return instead of an image:
"The Google Maps API server rejected your request. This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: https://console.developers.google.com/apis/library?project=_"
It cannot be that API project is not activated, as basic API with this project & Premium key works. Any ideas, why does it happen and Premium image download doesn't work?
It appeared to be a purely technical problem, the quotas were exceeded.

Comparing Google Analytics and Data from our Hosting Provider

Our hosting provider uses an app called AWStats for to give us data about visits/visitors etc. However when I compare that to my google analytics data the numbers are far off. For example AWStats says we had about 5000 visitors but GA says about 1500. How can I uncover the source of the disparity?
A few ideas:
Improper implementation for one or both analytics services
Different definition of what a visitor is for both analytics services. For example, does GA say that you have 1500 unique visitors? or 1500 visits?
Have you tried using a program like HTTPFox to look at the requests getting sent? Are there duplicate requests?

Places api for Apple Maps

We have google api list out the places.i.e:
https://maps.googleapis.com/maps/api/place/autocomplete/xml?input=Amoeba&types=establishment&location=37.76999,-122.44696&radius=500&sensor=true&key=AddYourOwnKeyHere
Using this we get the list of places.
But My question is:How to get the list of places using Apple Maps in iOS 6.1(That means with out using google Api).
I guess what you want to know is how to get a list of interesting locations / places from the maps api. I believe what you want is not provided. IMHO you will always have to refer to a specific server such as Google / Yelp / ... to give you a list of interesting places. iOS6 Maps API only provides a means how to present those on the device.
Hope it helps,
EL

Options for Filtering Data in real time - Will a rule engine based approach work?

I'm looking for options/alternative to achieve the following.
I want to connect to several data sources (e.g., Google Places, Flickr, Twitter ...) using their APIs. Once I get some data back I want to apply my "user-defined dynamic filters" (defined at runtime) on the fetched data.
Example Filters
Show me only restaurants that have a ratting more than 4 AND have more than 100 ratings.
Show all tweets that are X miles from location A and Y miles from location B
Is it possible to use a rule engine (esp. Drools) to do such filtering ? Does it make sense ?
My proposed architecture is mobile devices connecting to my own server and this server then dispatching requests to the external world and doing all the heavy work (mainly filtering) of data based on user preferences.
Any suggestions/pointers/alternatives would be appreciated.
Thanks.
Yes, Drools Fusion allows you to easily deal with this kind of scenario. Here is a very simple example application that plays around with twitter messages using the twitter4j API:
https://github.com/droolsjbpm/droolsjbpm-contributed-experiments/tree/master/twittercbr
Please note that there is an online and an offline version in that example. To run the online version you need to get access tokens on the twitter home page and configure them in the configuration file:
https://github.com/droolsjbpm/droolsjbpm-contributed-experiments/blob/master/twittercbr/src/main/resources/twitter4j.properties
check the twitter4j documentation for details.

Is there a limit on number of placemarks returned by Google Maps Geocoding API v2?

So, the question is: is there a limit on number of placemarks returned by Google Maps Geocoding API v2? I searched through the web but this limit (if it exists) is nowhere explicitly stated. However I've never seen Geocoding API return more than 10 placemarks regardless of how common the input is (there is Lenin str. in every Russian town but Maps.app on my iPhone returns just 9 placemarks). Any thoughts on that?
There is a way to by-pass the limit by exporting the map as a kml file using the View in Google Earth link at the top of the map. You will need to host this kml file in a publicly accessible server and you load it into maps by searching the Google map for the URL of the KML file.
The problem for a collaboration map is that the process will need to be repeated every time that the My Map map is updated.

Resources