|
Posted by houghi on 07/07/07 12:26
I have noticed that Google has a new feature¹ on their maps directions²
What I would like it to turn the routs you create qhith google into a
Tomtom iternerary.itn file.
I have such a script already running on my local machine³ in bash/perl,
but it would be nice if this were possible to do with php. Perhaps I
bite of more then I can chew as I do not have much experience in php
scripting, however here is the idea.
1) Make a route with google maps. Do not forget to move the start and
end point, so you get logtitude and latitude
2) Paste the URL into my site (or anybody elses)
3) copy the file.itn onto your tomtom
As a sample here susch a URL http://tinyurl.com/2ubzlo or the long
version:
http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=Stationsstraat+%4050.879940,+4.092990+to%3AKleemputtenstraat+%4050.873610,+4.091480+to%3AMuilenstraat+%4050.878540,+4.098430&daddr=Meersstraat+%4050.879560,+4.090310&sll=50.876638,4.09436&sspn=0.011915,0.011415&ie=UTF8&om=1&ll=50.877207,4.09436&spn=0.011915,0.011415&z=16
This should be turned into:
5087994|409299|Stationsstraat|4|
5087361|409148|Kleemputtenstraat|1|
5087854|409843|Muilenstraat|1|
5087956|409031|Meersstraat|3|
This means doing a few things in about the following order:
1) Cut up the URL, so you get
Stationsstraat+%4050.879940,+4.092990+to%3AKleemputtenstraat+%4050.873610,+4.091
480+to%3AMuilenstraat+%4050.878540,+4.098430
Meersstraat+%4050.879560,+4.090310
Next turn it into
Stationsstraat 50.879940 4.092990
Kleemputtenstraat 50.873610 4.091480
Muilenstraat 50.878540 4.098430
Meersstraat 50.879560 4.090310
Then into
5087994|409299|Stationsstraat|4|
5087361|409148|Kleemputtenstraat|1|
5087854|409843|Muilenstraat|1|
5087956|409031|Meersstraat|3|
and last but not least give the output as
Stationsstraat_Meersstraat.itn, so it can be saved imediatly
Any help would be apriciated.
¹ http://tinyurl.com/2f8xa7
² http://maps.google.com/maps?f=d
³ http://houghi.org/tomtom/
houghi
--
>>>> Run the following from the bashprompt if you have the kernel sources
for I in `find /usr/src/linux/ -name *.c`; \
do A=`grep -i -A 1 -B 1 fuck $I`;if [ "$A" != "" ]; \
then printf "$I \n$A \n\n"; fi ;done|less
[Back to original message]
|