How does OSM store GPX data?

I’m curious to know how OSM stores GPX data because I was screwing around with gpsbabel and it turned a 9180 point file into a 3200 point file, but the file size difference was about half, even though there was a third the actual data.

Also when I gzip’d both files, the original file was 35k, the gpsbabel file ended up to be 45k.

I filtered the data by doing this:

gpsbabel -i gpx -f test1.gpx -x simplify,crosstrack,error=0.0001k -o gpx -F test2.gpx

I don’t need to worry about filtering HDOP etc, as the app does this before making the gpx file.

Anyone able to shed some light on this?

Open the files in a text editor and compare them. That should show why the files sizes are not what is expected.

I know why, gpsbabel adds a lot of whitespace that my app isn’t, and bloating out tags and stuff that isn’t in the original.

However that isn’t my question, I was curious to know how OSM stores traces so I could optimise the best format to upload. Basically if they store all the points in some DB table, or store using GPX compressed files, since gpsbabel can reduce redundant data and would make smaller DB table, however if they just compress GPX files then it doesn’t matter necessarily.