Calculating length of a street with Google Maps - maps

I have to calculate length of a street with Google Maps API. I've already searched for "start and end point of a street", etc... there are no good solutions.
What I need in example:
1. Look for "Ludwigstraße, München"
2. Get length of this street in meter (miles or whatever)
Does anyone have a good idea or any other method how to manage this? Perhaps there is a possibility to make this via overlays?

If you had start and end point of street already, try to use google map api distance matrix, that service will return the distance between start and end point.enter link description here

Related

Moving Pepper from a point to another

I am trying to move Pepper from one point to another which involves a turn of 90 degrees and it is around 40 metres distance. I can make it work when there are no obstacles but when there are obstacles the Pepper stops and then we don't know his location to move again. I am using ALNavigation navigateTo method.
I have tried getting the position by using ALMotion getRobotPosition but it is very error prone and I don't know if we can use that while using ALNavigation API.
Please suggest any solution for this.
Thanks
Your best bet is to use ALNavigationProxy::navigateToInMap.
You can play around with this example: https://github.com/aldebaran/naoqi_navigation_samples
Get the code from github or http://doc.aldebaran.com/2-5/naoqi/motion/exploration-api.html#exploration-api
-see the sample code at the bottom of the page.
Map your space
ALNavigationProxy::navigateToInMap

Google Maps API - Getting fastest route with multiple way points

I have been reviewing the Google maps API, (specifically the Directions API), and in theory I know what I want but am having trouble finding the documentation for it;
I have a set of addresses that I would like the fastest route for;
maps.googleapis.com/maps/api/directions/json?origin=START_ADDRESS&destination=###1###&waypoints=###2###,###3###,###ETC###&key=MY_API_KEY
I have surrounded the params I will explain below with ###;
1; This is unknown as I want the furthest address to be the last point; At the moment this is done by getting all of the times distance and just doing it that way, but If I have 3 addresses and address 2 is closer than address 3, but its quicker to go to address 1 then address 3 then address 2 last then it's not good.
2&3; Google seems to just go through the addresses in the order I put them here, and what I actually want is to go in order of the fastest route, the order of addresses does not actually indicate this.
Just wondering what approach I could take, is there something I have missed in the API,
Thanks in advance,
Robert
NB: If something isn't clear please comment and I will try to clarify.
Found out there is an optimise parameter for way-points!:
maps.googleapis.com/maps/api/directions/json?origin=x&destination=x&waypoints=optimise:true|y|z&key=MY_API_KEY

Why does my touch develop script keep crashing?

The question isn't exactly concerned with touch develop rather just basic programming "structure" or syntax.
what I am trying to do is create a simple compass working on the phones heading capability. The heading capability just spits out degree readings to several (like 12) decimal places.
Anyway, even just letting the phone spit out the heading, eventually the phone will crash, why is that? Running out of memory?
The reason I came here is because of this:
I want to update the page with a photo of an associated rotation based on degree readout. I can't figure out how to do something like if 0 < x < 1 post this picture. Since the heading readout varies like 321.18364947363 and 321.10243635471
So currently I am testing this: several if / if else statements saying if heading output is 1 post picture with 1 degree rotation, 2 post picture with 2 degree rotation. This definitely and guaranteed crashes the phone. Why? Memory?
If you are a touch developer, would it be easier and more sane to simply take a round object, center it in relation to a square image and use it as a sprite or object which then you can dictate what angular velocity and position the object has without doing / using 360 individual images.
GAH! Damn character limits / thread format
this is what follows what I last wrote below for anyone that cares :
The concept seems simple enough but I am basically a programming noob, I was all over the place trying to learn Python, Java and C/C#/C++. ( I wrote this on my Windows Phone 8 but I was unable to copy the text ( GAY ) ) I am happy to have come across Touch Develop because it is better for me as a visual learner. (Thanks for the life story )right ? haha
The idea would have been to use this dumb pink against black giant compass with three headings / points of interests namely A fixed relative north, the heading and a position given by the person to be found's lat and long coordinates relative to the finder's phone's current location (lat and long ). This app in my mind would be used for party scenarios. I would have benefited from this app had the circumstances been right, I was lost at a party and I had to take a cab home for $110.00 because I didn't drive to that party.

Array of addresses: closest place with iphone geolocation in ios6

I have an array of street addresses, I want my app to sort that array starting with the closest address to my location (GPS).
Now that Apple has released iOS Maps in iOS 6, what is the easier way to do that?
Thanks,
Matt.
Approach I'd take would be use CLGeocoder to obtain CLLocation instances for each address (there are several async methods provided by the class to do this). Save the values obtained if needed for future sorts to save having to re-obtain them. Get your location as a CLLocation instance. Use -[ CLLocation distanceFromLocation: ] to obtain distance between your device location and each address location. Sort on these distance values.
Hope this helps!
Mark

Detecting Largest Blob in a binary image

I want to detect the largest BLOB in a binary image for my project. can you please guide me on how can I do this?
Thanks
Use findContours to find all blobs in image and using contourArea you can calculate blob's area. So just find contour (blob) with biggest area.
A good point of start would be the CVBloblib . I used it in the past and it works fine.
Then it is just a question of calculating the blobs area or perimeter, depending on what you want :)
I don't know what is the best practice here, but I'd do it somehow like this:
First find all blobs. You could use cvBlobslib or cvBlob or findContours etc.
Then store all blobs in vector. Sort your vector by blobs' area. And then get the last blob.
bool sortBlobsASC(CBlob first, CBlob second) {
return first.Area() < second.Area();
}
std::sort(myvec.begin(), myvec.end(), sortBlobsASC);

Resources