waypoint2sqlite

For my personal needs, I’ve written a small Ruby script called waypoint2sqlite.rb. It converts waypoints in GPX XML format to a sqlite database file for MaemoMapper. It is released into public domain in the hope it is useful. Use it only if you know what you are doing, at your own risk and responsibility.

Notes:

  • Invoke the script by passing an input directory and an output directory. Both may be the same.
  • The input directory will be scanned recursively for GPX files.
  • The filenames of the GPX files will be used to form the category name. The category will later appear in MaemoMapper, of course.
  • In the output directory you will find the POI database file, called poi.db. If you place an existing poi.db into the output directory, the script will use it.
  • If you use an existing poi.db, the script will not overwrite all waypoints. But it will delete and recreate all waypoints of a category to be imported. This way it is possible to preserve POIs imported from other sources, as long as those belong to unique category names. OTOH, if you import a certain gpx file over and over again, it will not create duplicated waypoints.
  • The script can cope with huge amounts of data; it processed 847.348 POIs in 163 categories in about 2 hours. But be aware that you will render MaemoMapper barely usable when you feed it such an amount of data.
  • Copy the resulting poi.db file to any directory on your tablet. Then select it from the MaemoMapper preference dialog.
  • MaemoMapper can display the POIs as an POI overlay. For any category you want to display, place a PNG icon into the same directory where you put the poi.db file. Then rename the file extensions from png to jpg(sic!). If you place an additional poi.jpg there, this icon will be used for any category without a specific icon.

Credits to John Costigan who created MaemoMapper for the Nokia tablets. It’s a phantastic application and turns the N810 into the perfect companion for mapping enthusiasts!

Comments are closed.