You are right thanks: in fact those couples repeat at each tract in some cases 
even 4 times:  I traced them back to the php script querying the google 
service, rather than the iOS app, as you may see already at:
http://www.miafoto.it/iPhone/inarrivo/php/paletteForLineWithRoute.php?linea=50096&device=iPhone
That is the relevant php function producing that weird result being called by 
the script in the url above for a sequence of origins and destinations:

function interpolate($origin, $destination){
ini_set("memory_limit","200M");
        set_include_path("/iPhone/simplehtmldom_1_5");
        include_once('simple_html_dom.php');
// Create DOM from URL or file
        
$url="http://maps.googleapis.com/maps/api/directions/xml?origin=$origin&destination=$destination&sensor=false&mode=driving";;
        $html = @file_get_html($url);
        echo "<path>";
        $found=preg_match_all('/<points>(.*)<\/points>/sU', $html, $match);
        foreach($match[1] as $polyline){
                $array=decodePolylineToArray($polyline);
                foreach ($array as $point){
                        $latitude=$point[0];
                        $longitude=$point[1];
                        //echo($latitude."|".$longitude."\r\n");
                        
echo("<leg><legLatitude>".$latitude."</legLatitude><legLongitude>".$longitude."</legLongitude></leg>");
                }
        }
        echo "</path>";

}

What could be the problem?

Thanks again,
Fabrizio

Il giorno 30/giu/2012, alle ore 11:59, Andrew Leach ha scritto:

> On 30 June 2012 10:42, Fabrizio Bartolomucci <[email protected]> wrote:
>> Thanks Larry,
>> actually that is quite strange given the coordinates seem to move on the 
>> same direction while the drawn polyline seem to also have a reverse path. I 
>> also tried to just print the first 100 dots, but they already featured that 
>> odd behavior.
>> As for the origin, the main points, in effect corresponding to the threading 
>> of the return path, are the positions of the bus stops of a bus line, and 
>> the points in between are the ones returned by google to connect them 
>> through roads. Could you point me to the points producing that weird effect 
>> and/or to a web site where I may submit my points and have them drawn on a 
>> map without having to mangle with the iOS app?
> 
> I checked the first one
> 2012-06-29 17:16:27.947 inArrivo[6293:707] 41.702019, 12.345350
> 
> which also appears slightly further down:
> 2012-06-29 17:16:27.977 inArrivo[6293:707] 41.702019, 12.345350
> 
> so it's definitely the data. You could try and find a duplicate of
> every row like I did, but that might take some time. It's probably the
> only way though: can you load the points into a database to help you?
> 
> I don't know of a site where you can submit a list of points though,
> other than one where they are encoded first, which isn't going to help
> find duplicate points.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Maps API V2" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-maps-api?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to