postgis/postgresql is pretty easy but there are other options:
http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html <-- mysql5 spatial extensions.
I would advise against writing your own because there is the possibility for more errors. But yes, yours would work for gpx files but all govt data is in at least shapefile.