Introducing GPXClean for Windows!

 

Before I get long winded, I wish to thank BobKZ and Box Car (or is it 'Sox Car' wink ) for helping me beat up the very early beta versions (like last week!). It's a very small package that doesn't require an install. Just save somewhere where Windows (sorry Mac guys...) can find it and run. It's basically a filter program that will parse your .gpx files one line at a time, making the pre-described changes in each record. Cleans up case issues (all caps, lower, etc), removes extra spaces, expands out abbreviations, etc. Read on...

What GPXClean does (without asking):

  • What GPXClean will do: Compresses multiple spaces into a single space in the 'gpxx:StreetAddress' & 'gpxx:City' fields
  • Removes spaces from the beginning and end of anything in the 'gpxx:StreetAddress' & 'gpxx:City' fields
  • Log to a file any changes made that aren't case related (upper to lower, i.e.)

What GPXClean can do (optional):

  • Change the character case in the 'name' field
  • Change the character case in the 'gpxx:StreetAddress' & 'gpxx:City' fields
  • Change abbreviated road types into their long names (Rd to Road, Ave to Avenue, etc.) and remove trailing periods
  • Add/change/remove the country field
  • Modify the format of the phone number (to either xxx-xxx-xxxx, (xxx) xxx-xxxx or xxx.xxx.xxxx)
  • Append ' - ' to the POI name, to make it more unique
  • Make sure mcx stays McX (McAllen, McDonalds, McMillan, etc.) if 'normal' is set in Name (-poi) or City & Address (-case) fields
  • Make sure states are capitalized if 'normal' is set in Name (-poi) or Address (-case) fields
  • If -case is 'normal', it will capitalize directions (N, S, E, W, NE, etc.) and remove the period
  • Log to a file any format changes in the phone number

The best part about it is it's free. My time, my server, your benefit. Let's start spring cleaning early!

http://camerabob.dyndns.org:5190/poi-factory/gpxclean.html

Enjoy all

-Bob

P.S. -message me if your find any errors anywhere with the package or web site. I'll do my best to correct them.

--
Striving to make the NYC Metro area project the best.
<<Page 2>>

Sam's to Sam

deleted

--
(formerly known as condump) RV 770 LMT-S, Nuvi2797LMT, Nuvi765T

Version .90 is up

Due to a majority interest, I added the ability of the program to change ALL occurrences of the street type to whatever is defined in the dictionary. So "Blvd", "Blv", "Bl", "Bvd", "Blve" and "Boulevard" will all be changed to whatever is defined in the .ini file. Call it 'Bob's Road' for all I care. grin This way the custom field can be used for something else... Not why I wrote the thing, but I guess I don't think like most....

Keep the feedback coming.

--
Striving to make the NYC Metro area project the best.

POI Name Field Not Working

@Camerabob,

fyi ...

downloaded the v0.90 today and found the name field is not working at all. Every POI is missing the POI Name in the output.

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

Geeezzzz

That didn't happen to me. Let me take a look...

--
Striving to make the NYC Metro area project the best.

disregard this

replied double...

--
Striving to make the NYC Metro area project the best.

Custom output

Randomly when it changes " RD." = " Rd" from my custom changes the output is missing the < before /GPXX

-begin custom-
Search term = Replacement term (example)
" Ave." = " Ave"
" Dr." = " Dr"
" Rd." = " Rd"
" St." = " St"
-end custom-

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

Simple Command line

Just in case this helps

On my last 2 posts I am putting all switches and filenames in the ini and just clicking on the exe to run.

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

3 things

1) Could you post a POI entry that fails?
2) You can now do that without using the custom area.
3) Does it fail without the custom area?

--
Striving to make the NYC Metro area project the best.

Grainger File

I just finished updating the Grainger.gpx file I maintain last night to upload to the Factory. Everything is the same as the current file except for 36 entries deleted. The Name field for every entry has "Grainger #123" where 123 is variable.

If I leave the ini file in the folder but copy v0.89 exe over v0.90 the NAME field works. If I copy v0.90 back to the folder again the NAME field fails again.

Will worry about the missing "<" after the name field is fixed.

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

They are related.

Try the new 90.0.1 I just uploaded. Let me know how that goes.

By the way, did all the failed entries have "Road" at the end?

--
Striving to make the NYC Metro area project the best.

nope

Still no name field in the output.

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

Found it.

Grab the newest. Sorry for the hassle. I downloaded the same file and ran it myself. v0.90.0.2. Somehow a variable name changed...

--
Striving to make the NYC Metro area project the best.

Custom Fields

Did you find the randomly missing "<". Search the change file and you will see them missing now and then,

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

Where?

In the Name field? This fix may have corrected that.

--
Striving to make the NYC Metro area project the best.

StreetAddress Field

Randomly when it changes any one of the entries from my custom changes list below the output is missing the < before /gpxx:StreetAddress ending the field.

-begin custom-
Search term = Replacement term (example)
" Ave." = " Ave"
" Dr." = " Dr"
" Rd." = " Rd"
" St." = " St"
-end custom-

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

Change file

The change file shows that occasionally it tries to do a custom change from my list to one of the 4 entries in my list in the previous post that doesn't have the period.

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

OK I was looking in the wrong place

I'll dive into it after shoveling snow and grabbing dinner.

--
Striving to make the NYC Metro area project the best.

Nice

Thanks, have to try.

--
Nuvi 50LM Nuvi 2555LM

Snow

Shoveled my 8" of snow this morning.

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

Look into the .txt file

Pick any record that has a custom substitution. You'll notice that the program is automatically finding Ave. and writing out to Avenue. It also removes the dot. That's good. What's not good (for me) is that the custom area is removing the characters just after the abbreviations when a period is used. (Ave. = aveue -dropped the 'n', drive = drve -dropped the 'i', Street = Steet -dropped the 'r', etc.) It's a PERL Regex thing I have to figure out. In the mean time, if you want Avenue to end up as Ave, just change it in the dictionary section:

-begin dictionary-
Avenue = Ave
Boulevard = Blvd
Drive = Dr
Road = Rd
Street = St
-end dictionary-

I changed it's function in version .90 to include the full words also. They will be translated to whatever is next to them in the dictionary section. Likewise for your other words. No need to reinvent the wheel. Also, the program automatically removes the dot, so you don't have to. The custom section needs help (from me...).

By the way, v .90.0.3 is up with the corrections to the custom dropped character issue.

--
Striving to make the NYC Metro area project the best.

Dictionary

So with the dictionary set as

-begin dictionary-
Avenue = Ave
Boulevard = Blvd
Drive = Dr
Road = Rd
Street = St
-end dictionary-

I understand that "Avenue" will become "Ave" but will "Ave." also become "Ave" without the period?

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

.

camerabob wrote:

What's not good (for me) is that the custom area is removing the characters just after the abbreviations when a period is used. (Ave. = aveue -dropped the 'n', drive = drve -dropped the 'i', Street = Steet -dropped the 'r', etc.) It's a PERL Regex thing I have to figure out.

Sounds like an issue caused by the period having special meaning in a regular expression: "match any character". To match just a period you need to escape it with a backslash. So, for the sample string

123 Avery Ave. North

/Ave./ will match both the 'Aver' in "Avery" and the 'Ave.', while

/Ave\./ will only match the 'Ave.'

Got that

But in a variable, it has to be handled differently.
/\Q$variable/ FYI, will ignore escapes in variables.

@Bear:
Yes, the dictionary will handle all versions of Avenue and convert them to what you want. ...and remove the dot. smile Unless you add it back in on the right, of course.

--
Striving to make the NYC Metro area project the best.

gpxclean

thanks

Just posted v .91.0.3

    Version 0.91.0.3 - January 22, 2012

  • -Changed the code so that the end user can decide what punctuation will be capitalized after in the POI & address and city fields.
  • -91.0.1 - Corrected code so that changes in the .gpx header information won't be shown if they weren't changed in a custom definition.
  • -91.0.2 - Moved the bulk of the program into a subroutine.
  • -91.0.2 - Corrected code so that starnge things wouldn't happen to file names if the -i, -o or -c switches were the last on the command line.
  • -91.0.3 - Changed the way the .ini file name is created and used.
  • -91.0.3 - Cleared up a discrepancy with input method differences between the interpreted version and the compiled (.exe) version.

Perfect for you folks that use the asterisk (*) in the POI name.

Enjoy

--
Striving to make the NYC Metro area project the best.

GPX Clean

Will give it a try, backup files first.

thank you

Thanks man I will try this one too

Great Job

@camerabob,

v0.91zip does it all. Job very well done! Thanks and give your brain a rest!

EDIT:
BTW, I really like the change output file. It's the easy way there is to review the changes and see if your configuration and switches were what you actually intended.

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

:-)

bear007 wrote:

@camerabob,

v0.91zip does it all. Job very well done! Thanks and give your brain a rest!

EDIT:
BTW, I really like the change output file. It's the easy way there is to review the changes and see if your configuration and switches were what you actually intended.

I have no choice. I fried it... Glad you like it. I just ran it on all my .gpx files. Smooth... I can't think of anything else to do to a .gpx file.

--
Striving to make the NYC Metro area project the best.

A couple of things

The -tele "2" and "3" don't appear to work.

The .ini file created is just that ".ini", nothing before the dot.

--
Nuvi 2460LMT

What version are you running?

mmullins98 wrote:

The -tele "2" and "3" don't appear to work.

The .ini file created is just that ".ini", nothing before the dot.

Also is there a dash in the file name? That may screw things up. If so, enclose the name in quotes.

If possible, could you post the command line you ran that failed?

Thanks

--
Striving to make the NYC Metro area project the best.

91.0.3

camerabob wrote:
mmullins98 wrote:

The -tele "2" and "3" don't appear to work.

The .ini file created is just that ".ini", nothing before the dot.

Also is there a dash in the file name? That may screw things up. If so, enclose the name in quotes.

If possible, could you post the command line you ran that failed?

Thanks

91.0.3

Wal-Mart_US&Canada.gpx

Command line: GPXclean.exe

--
Nuvi 2460LMT

I believe the '&' is the issue

Try removing that from the name, and running again. I had that issue with J&R's Steak House. I'll look into that in a later release... If that doesn't work it's definitely the dash. One of them will solve that issue.

--
Striving to make the NYC Metro area project the best.

Thank you

camerabob wrote:

Try removing that from the name, and running again. I had that issue with J&R's Steak House. I'll look into that in a later release... If that doesn't work it's definitely the dash. One of them will solve that issue.

I thank you for all you have done but this has gotten to be to much of a hassle and I am bowing out.

Good luck

--
Nuvi 2460LMT

Sorry you feel so.

Good luck to you as well.

--
Striving to make the NYC Metro area project the best.

Thanks camerabob! I will

Thanks camerabob! I will check it out.

Thanks I will give it a try

Thanks I will give it a try when I have a quiet evening.

--
John B - Garmin 765T

Thanks

Wow! Thanks CameraBob. That's great.

A precaution re: the noble ampersand (&)

This is a special character in the command line world. If your .gpx file name, output file name or change file name contains one of these, you will need to enclose it (the entire file name) in quotation marks. If the file names are contained in the .ini file, you're good to go.

-Bob

Still haven't given up on the 'pretty' graphical version...yet.

--
Striving to make the NYC Metro area project the best.

v 0.91.0.4 is up

Allows you to skip typing in the .gpx extension. It's assumed. (I know what they say about assuming... grin) You can also safely use any extension you want, but the file format will only work for a .gpx formatted file.

Again, due to the DOS/command line limitation, if the name contains an ampersand, surround it with quotes: c:\GPXClean -i "Wal-Mart_United States & Canada"

-Bob

--
Striving to make the NYC Metro area project the best.

NICE.. Will try it out!

NICE.. Will try it out!

Thanks

Appreciate your time and effort

Posted v .92.0.0

Added the ability to create a .csv file (either 4 or -m- column) at the same time using the same corrected data.

Corrected the output to process the custom area last, as opposed to earlier in the process.

Perfect for you maintainers that keep 2 versions on POI Factory. wink

--
Striving to make the NYC Metro area project the best.

New Feature

Wow camerabob. I go to work for a day and you add complete new featues and the program grows. Seems like the programming fever is growing.

For my couple of files it already does a great job.

EDIT: fixed camerabob spelling error

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

Thanks

Looks very useful. Thanks!

Version 92.0.1 is up

Added support for multiple line comments and descriptions.

I guess that's it for a while. I can't think of anything else...

--
Striving to make the NYC Metro area project the best.

What's next??

camerabob wrote:

Added support for multiple line comments and descriptions.

I guess that's it for a while. I can't think of anything else...

That's the beauty of this site camerabob, the users will dream up more ideas and work for you. grin rolleyes

--
Harley BOOM GTS, Zumo 665, (2) Nuvi 765Ts, 1450LMT, 1350LM & others | 2019 Harley Ultra Limited Shrine - Peace Officer Dark Blue

0.92.0.6 has been posted

Updates include:

  • -92.0.2 - Added a date/time stamp to the contents of the .ini and .txt files.
  • -92.0.3 - Added an option for a 4 column short version without comment and description fields in the .csv file.
  • -92.0.4 - Added 'Expwy' and 'Exp' to abbreviation list for 'Expressway'.
  • -92.0.5 - Changed the code so that only the original line is shown in the .txt file custom area when more than one change is made in the line.
  • -92.0.5 - Added support for multiple phone numbers.
  • -92.0.6 - Changed the code so that the changes made via a special mapping are outlined in the .txt file.
  • -92.0.6 - Corrected code so the the special mapping is written to the .ini file.
--
Striving to make the NYC Metro area project the best.

Looks useful

Thanks! :0

--
Expect nothing!, appreciate benignity!

Added symbol list

Added symbol list for Base Camp v 3.0.5

--
Striving to make the NYC Metro area project the best.
<<Page 2>>