Tomtom Export Script
From Geoqo
(Difference between revisions)
| (8 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
This gives an example of exporting to a bunch of [[tomtom]] files based on type: | This gives an example of exporting to a bunch of [[tomtom]] files based on type: | ||
| − | + | # research the original set (from the user's -s line) so it's loaded into active memory | |
| − | + | %search | |
| − | + | set:search:geoqo | |
| − | + | ||
| − | + | # save it under a particular new name for us to make use of below: | |
| − | + | %saveset name=tmp:fortomtoms | |
| − | + | ||
| − | + | # tell them how many caches are in it. | |
| − | + | %display | |
| − | + | count:original count: | |
| − | + | ||
| + | # Then create a file per type: | ||
| + | %foreach type Unknown Multi Webcam | ||
| + | %search | ||
| + | set:tmp:fortomtoms&&cache:subtype=%{type} | ||
| + | %display | ||
| + | count:exporting %{type} : | ||
| + | %export | ||
| + | system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F %{type}.ov2 | ||
| + | %endforeach | ||
| + | |||
| + | # Now just search for cache sizes | ||
| + | %foreach size Micro Small Regular | ||
| + | %search | ||
| + | set:tmp:fortomtoms | ||
| + | &&cache:subtype=Traditional | ||
| + | &&cache:groundspeak_container=%{size} | ||
| + | %display | ||
| + | count:exporting %{size} : | ||
| + | %export | ||
| + | system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F %{size}.ov2 | ||
| + | %endforeach | ||
| + | |||
| + | == Running it == | ||
| + | |||
| + | Then you should be able to run the script for a given search like: | ||
| + | |||
| + | '''geoqo --nogui -s set:import:nearme -x FILENAME''' | ||
| + | |||
| + | Which might produce output like: | ||
| + | |||
| + | original count:31 | ||
| + | exporting Unknown :9 | ||
| + | exporting Multi :6 | ||
| + | exporting Webcam :0 | ||
| + | exporting Micro :8 | ||
| + | exporting Small :2 | ||
| + | exporting Regular :5 | ||
| + | |||
| + | And it'll put everything from the ''import:nearme'' set into .ov2 files for use on tomtoms. Don't forget to create .bmp files for the icons. | ||
Hopefully this works ;-) | Hopefully this works ;-) | ||
| + | |||
| + | ==alternative version by dsPolleke ;-)== | ||
| + | |||
| + | |||
| + | #geoqo script | ||
| + | %search | ||
| + | cache:available==True | ||
| + | |||
| + | # first, save what the user searched for | ||
| + | %saveset tmp:fortomtoms | ||
| + | |||
| + | # Then create a file per type: | ||
| + | %foreach type Unknown Multi Webcam | ||
| + | %search | ||
| + | set:tmp:fortomtoms | ||
| + | &&cache:subtype=%{type} | ||
| + | %export | ||
| + | |||
| + | system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F %{type}.ov2 | ||
| + | |||
| + | %endforeach | ||
| + | |||
| + | #just micro's | ||
| + | %search | ||
| + | set:tmp:fortomtoms | ||
| + | &&cache:subtype=Traditional | ||
| + | only:type=Geocache,subtype=Traditional Cache,groundspeak_container=Micro | ||
| + | %export | ||
| + | system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F micro.ov2 | ||
| + | |||
| + | # all other traditionals | ||
| + | %search | ||
| + | set:tmp:fortomtoms | ||
| + | &&cache:subtype=Traditional | ||
| + | +drop:type=Geocache,subtype=Traditional Cache,groundspeak_container=Micro | ||
| + | %export | ||
| + | system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F traditional.ov2 | ||
| + | |||
[[Category:scripting]] | [[Category:scripting]] | ||
Latest revision as of 17:05, 16 June 2008
This gives an example of exporting to a bunch of tomtom files based on type:
# research the original set (from the user's -s line) so it's loaded into active memory
%search
set:search:geoqo
# save it under a particular new name for us to make use of below:
%saveset name=tmp:fortomtoms
# tell them how many caches are in it.
%display
count:original count:
# Then create a file per type:
%foreach type Unknown Multi Webcam
%search
set:tmp:fortomtoms&&cache:subtype=%{type}
%display
count:exporting %{type} :
%export
system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F %{type}.ov2
%endforeach
# Now just search for cache sizes
%foreach size Micro Small Regular
%search
set:tmp:fortomtoms
&&cache:subtype=Traditional
&&cache:groundspeak_container=%{size}
%display
count:exporting %{size} :
%export
system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F %{size}.ov2
%endforeach
Running it
Then you should be able to run the script for a given search like:
geoqo --nogui -s set:import:nearme -x FILENAME
Which might produce output like:
original count:31 exporting Unknown :9 exporting Multi :6 exporting Webcam :0 exporting Micro :8 exporting Small :2 exporting Regular :5
And it'll put everything from the import:nearme set into .ov2 files for use on tomtoms. Don't forget to create .bmp files for the icons.
Hopefully this works ;-)
alternative version by dsPolleke ;-)
#geoqo script
%search
cache:available==True
# first, save what the user searched for
%saveset tmp:fortomtoms
# Then create a file per type:
%foreach type Unknown Multi Webcam
%search
set:tmp:fortomtoms
&&cache:subtype=%{type}
%export
system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F %{type}.ov2
%endforeach
#just micro's
%search
set:tmp:fortomtoms
&&cache:subtype=Traditional
only:type=Geocache,subtype=Traditional Cache,groundspeak_container=Micro
%export
system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F micro.ov2
# all other traditionals
%search
set:tmp:fortomtoms
&&cache:subtype=Traditional
+drop:type=Geocache,subtype=Traditional Cache,groundspeak_container=Micro
%export
system:cmd=gpsbabel -i geo -f %{file:loc} -o tomtom -F traditional.ov2