View previous topic :: View next topic |
Author |
Message |
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 11:22 am Post subject: McGuider Users: Speed Camera Database Conversion Script Here |
|
|
I have written a batch file that takes the tab-deliminated speed camera database files offered by www.pocketgpsworld.com and converts them into McGuider's own UPI format. The script uses a program made by Sygic (the coders of McGuider) but simplifies the process by allowing the user to simply dump the txt and bmp files from the speed camera database into one directory, execute the script and output the UPI files to another directory.
You can download the script from www.jwtcs.co.uk/TXT2UPIv1.0.zip
You will also need a copy of the speed camera database from PocketGPSWorld - doesn't matter which version (zoned, consolodated etc.) you choose as the script is setup to determine using a file pattern. Just make sure you download the file formatted for McGuider (which is currently a tab-deliminated text file which McGuider does not support without conversion).
Hope this is useful for you McGuider users.
p.s. obviously this release does NOT contain the camera database as these are © PGPSW. |
|
Back to top |
|
|
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 11:24 am Post subject: |
|
|
I know there are already scripts to do this, but my script is a "one4all" in that it does not matter which version of the database you use from PGPSW as long as it follows their naming convention "pocketgps_*.txt". |
|
Back to top |
|
|
scarymonkey Lifetime Member
Joined: May 09, 2007 Posts: 454 Location: Worcestershire
|
Posted: Tue Mar 10, 2009 11:31 am Post subject: |
|
|
Not checked the results yet but I would expect you to have no icons on the screen with the script as you have specified a path to the bmp file, where the command line syntax for the poiconvertor program just needs the filename itself (I think it embeds the path into the UPI file itself). |
|
Back to top |
|
|
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 11:40 am Post subject: |
|
|
Nope - works perfectly. Tested on the drive home from work yesterday (including the beauty that won me lifetime membership :D) |
|
Back to top |
|
|
scarymonkey Lifetime Member
Joined: May 09, 2007 Posts: 454 Location: Worcestershire
|
Posted: Tue Mar 10, 2009 11:42 am Post subject: |
|
|
Had a chance to check now and I was right, all the icons show as grey question marks as the icon file cannot be found.
If you change the convert line to
Code: | for %%i in (.\in\pocketgps_*.txt) do echo - Converting %%~ni.txt to %%~ni.upi & convert.exe .\in\%%~ni.txt %%~ni.bmp .\out\%%~ni.upi |
it will produce a valid UPI file with icons.
Good script though adn much better than the batch files I have been using (note to self - learn scripting!) |
|
Back to top |
|
|
scarymonkey Lifetime Member
Joined: May 09, 2007 Posts: 454 Location: Worcestershire
|
Posted: Tue Mar 10, 2009 11:43 am Post subject: |
|
|
djbenson wrote: | Nope - works perfectly. Tested on the drive home from work yesterday (including the beauty that won me lifetime membership :D) |
What path do you use for the bmp files, and what device? I have just tested on my Touch HD and hd to make the change to the script I detailed above before I got working icons (I put all the icons into the res/icons folder)
Edit to add after a little more testing
I've just converted one of the text files created by your version of the script and it says
Bitmap name in 'Icons' directory is .\in\pocketgps_uk_mobile_20.bmp
Based on this you would need your bmp files to be in res\icons\in\ I believe.
Last edited by scarymonkey on Tue Mar 10, 2009 11:52 am; edited 1 time in total |
|
Back to top |
|
|
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 11:51 am Post subject: |
|
|
N95-8GB. TXT and BMP files in same directory (\in\)
Got the database yesterday, ran it though my batch file and it produced valid UPI's with icons.
Screenshot of latest PGPSW database converted using this batch:
EDIT: Taking out .\in\ from the front of the BMP file in the batch file (as per your quote above) points it to an invalid location - there are no BMP files in the root, they should be in the .\in\ folder. |
|
Back to top |
|
|
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 11:55 am Post subject: |
|
|
...and running convert.exe in command line mode (convert.exe /?) shows the syntax as;
input file - icon file - output file
Bizarre. |
|
Back to top |
|
|
scarymonkey Lifetime Member
Joined: May 09, 2007 Posts: 454 Location: Worcestershire
|
Posted: Tue Mar 10, 2009 11:56 am Post subject: |
|
|
djbenson wrote: | N95-8GB. TXT and BMP files in same directory (\in\)
Got the database yesterday, ran it though my batch file and it produced valid UPI's with icons.
EDIT: Taking out .\in\ from the front of the BMP file in the batch file (as per your quote above) points it to an invalid location - there are no BMP files in the root, they should be in the .\in\ folder. |
I meant on the bmp location on your device not on your PC. The Sygic POI Convertor program doesn't actually need the bmp file to be present to create a UPI file when it is run from the command line (not checked when done from the GUI). |
|
Back to top |
|
|
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 11:57 am Post subject: |
|
|
Unless one of us is confused, or the WinMob version works differently to the Symbian version - you don't copy ANY icon files to the device - the icons are embedded within the UPI file
The only files in my map directory are the UPI files - no BMP files at all.
Last edited by djbenson on Tue Mar 10, 2009 11:58 am; edited 1 time in total |
|
Back to top |
|
|
scarymonkey Lifetime Member
Joined: May 09, 2007 Posts: 454 Location: Worcestershire
|
Posted: Tue Mar 10, 2009 11:57 am Post subject: |
|
|
djbenson wrote: | ...and running convert.exe in command line mode (convert.exe /?) shows the syntax as;
input file - icon file - output file
Bizarre. |
I remember having fun when I fist created batch files as I was using the full path in the bmp file format and only ever saw grey question marks. When I changed to just the file name for the bmp file, the icons started appearing on my device. |
|
Back to top |
|
|
scarymonkey Lifetime Member
Joined: May 09, 2007 Posts: 454 Location: Worcestershire
|
Posted: Tue Mar 10, 2009 12:00 pm Post subject: |
|
|
djbenson wrote: | Unless one of us is confused, or the WinMob version works differently to the Symbian version - you don't copy ANY icon files to the device - the icons are embedded within the UPI file |
I am guessing the Win Mobile version is different then as you have to put the icons into a Res/icon directory on the storage card - not in the map/gbr directory though.
Out of interest (and in case there is a different version of McGuider around), what version of the software are you running? |
|
Back to top |
|
|
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 12:04 pm Post subject: |
|
|
Oh I know what's going on here - there's a POI bug in 2009 (v7.7) - a patch was released for the Symbian version put was pulled for the WinMob platform.
So this will only work on the latest Symbian version until Sygic/McGuider update all platforms to cure the POI bug.
UPI is a self contained format and when it works properly (as per the patched Symbian version) you do not need any external image files. |
|
Back to top |
|
|
scarymonkey Lifetime Member
Joined: May 09, 2007 Posts: 454 Location: Worcestershire
|
Posted: Tue Mar 10, 2009 12:07 pm Post subject: |
|
|
djbenson wrote: | Oh I know what's going on here - there's a POI bug in 2009 (v7.7) - a patch was released for the Symbian version put was pulled for the WinMob platform.
So this will only work on the latest Symbian version until Sygic/McGuider update all platforms to cure the POI bug. |
You were one of the few that managed to get the Symbian update before TA pulled it then and now I can see what they changed to fix it. Fortunately for WinMobile users there is no bug for POI in the current software (at least nothing like the one that affected Symbian users). I am also wondering when TA will authorise the update ot be released again as it is still not showing in McGuider Assistant for me.
For anyone who tries your script though, the change I highlighted above works fine for WinMobile using 7.7 as currently released. The BMP files need to be put into the icon directory as well. This is explained in the help pdf sygic supply with the poi convertor. |
|
Back to top |
|
|
djbenson Lifetime Member
Joined: Jul 12, 2006 Posts: 15
|
Posted: Tue Mar 10, 2009 12:10 pm Post subject: |
|
|
Out of curiosity, I made the amendment, uploaded the files to my device, and as I thought, it broke it:
I will add some more code to ask which platform the files are destined for...that way the resulting files should always work. Will you give it a go once I've uploaded it? |
|
Back to top |
|
|
|
Posted: Today Post subject: Pocket GPS Advertising |
|
|
We see you’re using an ad-blocker. We’re fine with that and won’t stop you visiting the site.
Have you considered making a donation towards website running costs?. Or you could disable your ad-blocker for this site. We think you’ll find our adverts are not overbearing!
|
|
Back to top |
|
|
|