HERE Maps Directions limitation - directions

It looks that HERE Maps Direction resource is returning legs between two waypoints only. If I add more waypoints then it will be ignored by the API. Limitation?

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);

DJI Mobile SDK Way point mission configuration in order not to brake at every waypoint

in our we Mission Planning APP based on Mobile SDK we need to define very dense way points (we have way points every 10 meters).
In that situation the aircraft behaviour is the following: once at the waypoint position it brakes and then accelarates again to go to the next waypoint.
Is there any configuration about the mission or about the way points able to avoid the stop at each waypoint?
It is not possible to set a target speed on each waypoint, however is it possible not to brake at every waypoint?
Thanks
It is actually possible to do all of what you want with DJI SDK.
DJIWaypointMission has a flight path mode property which takes two options: normal and curved. Normal flies the mission the way you expect, with stops between each waypoint. Curved however, will make the drone fly through the waypoints without stopping. The radius of the curve that the drone makes at each waypoint is configurable by changing the value at each waypoint.
DJIWaypoint has coordinate, altitude and heading fields which help specify the drone's position at that particular waypoint. It also has a gimbalPitch property which can help orient the pitch of the gimbal to what you want. The speed property will allow you to set the speed of the aircraft between two particular waypoints.
Now, instead of creating DJIWaypointActions to take pictures, what you can do is set the shootPhotoDistance property of each DJIWaypoint to some value greater than your maximum inter-waypoint distance. Doing this will instruct the drone to take one picture as soon as it reaches the waypoint (without stopping if your waypoint mission is curved).
So, in conclusion what you want to do is create a WaypointMission with a curved flight mode, and add the list of all your custom waypoints which have the shootPhotoDistance property set to a large distance.
The waypoint code uses stopping at each waypoint as the method to know that a waypoint has been reached. So programming the drone to go to a waypoint, the waypoint is reached, the drone stops, and then completes various actions such as taking a picture.
If you do not want the drone to stop at each waypoint then use a curved path instead of a normal path. However in this instance, since using a curved path, the drone does not stop but it is also not possible to complete actions such as taking a picture at each waypoint.
The usual method around this is to choose waypoints relatively far away from each other and then use timing to take a picture every couple of seconds.
In addition be careful of wanting waypoints every 10m. The issue is one of precision/accuracy of the GPS system unless you are using RTK. If you are not using rtk then a specific waypoint lat/lng can frequently vary by a couple of meters between each flight depending on satellite lock and other factors.

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

Find street intersections within an area in using Google Maps API

Given a square area, what is the best way to find the approximate coordinates of every street intersection within the given area ?
Since there is no description of your application, I can't tell if you need to use Google Maps or if another data source would answer your needs.
If http://openstreetmap.org fulfills the requirements of your application, then it's easy:
the OSM API has a request to pull data from a rectangular region. You get XML data.
filter this data to keep only the street you are interested in, probably the "key=highway" tags
filter this to keep only the points belonging to two or more lines.
Please disregard this if Google Maps is a requirement.
But still: since the roads exist independently of the database, the above method will yield roads intersections (in lat/long coordinates) with a pretty high correlation with what you would get from Google maps ;-) You can then use those points to display them over a Google map, knowing that both datasets aren't identical so it won't be perfect.
Might not be the easiest method but I used a seperate database of our countries roads with their linestrings.
I took the first and last points of each line string, then counted the number of roads within 50 m of each start/end point. I then took the nodes from navigation route and used these to compare the number of roads intersecting with each node. I then looked at the direction each start point and the next point along that road, which gives you direction. from that with a bit of maths you can work out the number and angle of the roads at the next intersection. I then made a road rules application that tells you which vehicles to give way to

How to color fill a country on a map outline

Is it possible in Bing or Nokia maps to display a blank map of the world where each country is only outlined by its border, and then fill some countries with a solid color? Thanks!
A recent blog post on developer.here.com announced that:
The Geocoder API now supports the retrieval of admin boundary shapes
(multi-polygon coordinates) with geocoding results. This feature is
available for all countries & territories - in line with the country's
depth of coverage.
The HERE Community Examples on GitHub offers a web-based example showing this. It is written in JavaScript but should give you the idea.
Make http request to the REST Geocoder service using the additionaldata=IncludeShapeLevel,[level], parameter
Parse Well-known-Text format (WKT) using a regular expression.
Take the coordinates and convert to Polygon
Now depending on your situation, on a phone you may prefer to offer offline only support - because you know the maps are available directly from the device, so if you know for sure which regions you require it would make sense to pre-load the shapes based on a KML or GeoJSON file. If you don't know beforehand, your app relies on http anyway (or the potential set of locations is arbitrarily large) you may as well just http use REST geocoding for the regions you need.
By the way, one advantage of the online solution - because the Bing and Nokia Maps both use the same dataset as HERE, you can be certain that any shapes you download will match exactly.
You can render arbitrary polygons on top of Bing maps, but there's no built in functionality to render regions like provinces, states, counties, etc. In order to highlight a region you would need to provide all the points of a polygon and overlay it over a region on the map. Here's a great article that discusses drawing "advanced" polygon shapes with version 7 of the Bing Maps AJAX control.
“Advanced Shapes” (i.e. Donut Polygons) on Bing Maps
A possible duplicate question in regards to Bing maps API
Bing map - highlight country with a polygon on hover

Resources