Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 18 Dec 2014, 02:03
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Converting GPS coordinates to a TomTom format |Solved|
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
chapchap70

Joined: 18 Nov 2010
Posts: 150
Location: The Island Of Long (NY, USA)

PostPosted: Tue 25 Nov 2014, 23:27    Post_subject:  Converting GPS coordinates to a TomTom format |Solved|  

I make 20 plus deliveries per day in my job and use a TomTom XL with itinerary files. Since TomTom is linux based, I can open and read the *.itn files.

I am trying http://www.gpsvisualizer.com//geocoder/ to geocode waypoints because I think this could be a quicker way than manually entering all the addresses.

The coordinates output into standard decimal latitude and longitude readings. Random examples:

Quote:
40.7820015|-73.8317032|New York, NY|New York, NY||Bing Maps|city/town
39.1071281|-84.5041275|Cincinnati, OH|Cincinnati, OH||Bing Maps|city/town
42.3586617|-71.0567398|Boston, MA|Boston, MA||Bing Maps|city/town
38.8903694|-77.0319595|Washington DC|Washington, DC||Bing Maps|city/town


GPS converters like GPS Babel don't seem to be able to convert the coordinates into TomTom *.itn files.

TomTom uses 7 intergers, swaps the latitude and longitude and removes the decimal points. If I copy and paste the following into the temporary.iti file, it would route me to New York, NY

-7383170|4078200|

Is there a spreadsheet command or some other way to automatically switch the standard coordinate format into this one? I couldn't even figure out how to remove the decimal points.

Thanks

Edited_time_total
Back to top
View user's profile Send_private_message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 141
Location: Germany

PostPosted: Wed 26 Nov 2014, 03:51    Post_subject:  

I assume you know how to make a script.
Code:
#!/bin/sh
Original="40.7820015|-73.8317032|New York, NY|New York, NY||Bing Maps|city/town"

DOTOUT="\."
RET1=$(echo $Original|cut -d'|' -f1)
RET2=$(echo $Original|cut -d'|' -f2)
echo $RET1
echo $RET2
echo $RET1 >/tmp/ret1
echo $RET2 >/tmp/ret2
sed -i 's|'"$DOTOUT"'|''|' /tmp/ret1
sed -i 's|'"$DOTOUT"'|''|' /tmp/ret2
read RET1NEW < /tmp/ret1
read RET2NEW < /tmp/ret2

echo $RET1NEW
echo $RET2NEW

echo -n $RET2NEW > /tmp/output_new_refined
echo -n "|" >> /tmp/output_new_refined
echo -n $RET1NEW >> /tmp/output_new_refined
echo "|" >> /tmp/output_new_refined  # output a new line after this

Output of above example:
Code:
-738317032|407820015|
Just read out your file in a loop using the code above:
Code:

while read LINE;
do

 above code modified for your output purposes

done < original_data_file_here

_________________
RSH

LazY Puppy
Back to top
View user's profile Send_private_message 
chapchap70

Joined: 18 Nov 2010
Posts: 150
Location: The Island Of Long (NY, USA)

PostPosted: Wed 26 Nov 2014, 18:23    Post_subject:  

Thanks LazY Puppy, that couldn't be better!

I will delve into this over our Thanksgiving holiday to see what else I can make the script do.

By the way, if you come across the pond, don't use those coordinates if you want to get to Manhattan. Those coordinates will get you into a parking lot in Queens; by 20th St if I remember correctly. Laughing
Back to top
View user's profile Send_private_message 
chapchap70

Joined: 18 Nov 2010
Posts: 150
Location: The Island Of Long (NY, USA)

PostPosted: Sun 30 Nov 2014, 22:01    Post_subject:  Found This!  

For those interested, I found this site that uses google maps to geocode latitude and longitude. It is capable of exporting the waypoints to my TomTom after calculating the fastest route. This does a better job with the data I get from work (it isn't clean) and geocodes with fewer errors.

The code is available for viewing and modification to anyone's specific use and is at the link below.

http://optimap.net/
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0481s ][ Queries: 11 (0.0031s) ][ GZIP on ]