Thread
:
Importing List of POIs into Maemo Mapper 2.3
View Single Post
abby_normal
2008-02-02 , 19:38
Posts: 48 | Thanked: 4 times | Joined on Jan 2008
#
13
Success!!
Rick, thank you for putting me on the right track. It took some further tweaking, but I've finally got it working as desired. The steps I had to follow are listed below, for anyone who cares.
I definitely understand that you don't have all the time in the world to devote to supporting poi_loader (and what you've done so far is great!). But if you ever start working on a new version, you might want to look in to some of the behavior described below. For now, as long as I've got a way to get from A to B, I'm happy!
So, here goes:
(1) Prepare GPX file. The categories are in <sym></sym> tags. I actually found that poi_loader can handle slashes in the category names just fine. The program also can handle line feeds in the <desc></desc> tags, but it will convert them to space characters on loading. What I did is convert my line feeds to a delimiter (an asterisk surrounded by spaces) just because I prefer the way it looks. It might be possible to preserve line feeds in a future version of poi_loader (because the Mapper import function supports that), if you care to get that working.
Note: neither poi_loader nor the Mapper import function seems to like <metadata> tags. I recommend deleting those tags from any GPX file to be loaded into Mapper. In general, it's probably best to delete any tags that do not contain the specific data you wish to load.
(2) Change extension of GPX file to ".mmp" - let's call it "poi.mmp".
(3) Create additional "dummy" .mmp file that has one POI entry for each new category to be added in the database. You'll see why this is necessary below. Let's call this one "dummy.mmp". (If you're only loading a few POIs, you can probably skip creating the dummy file and just use "poi.mmp" for all of the following steps).
(4) Run poi_loader, create blank new database (so my existing POIs don't get munged if something evil happens). Let's call it "poi.db".
(5) Import dummy.mmp file into database. This always crashes with an error first time around: "Run-time error '9': subscript out of range". poi_loader terminates.
(6) Relaunch poi_loader. Open "poi.db". Import "dummy.mmp". This works, but for some reason most of the POIs are not assigned to the right categories. The new categories are entered into the category table (which you can see by browsing the database), but for some reason most of the new POIs have not been assigned the right category id.
(7) Quit poi_loader and restart (this does appear to be necessary). Open "poi.db". Import "dummy.mmp" again. THIS time, the rows are loaded with the correct categories. One or 2 rows (the ones that were initially loaded with the correct categories) are recognized as duplicates, but the majority are added as new POIs (presumably because the program recognizes that the category IDs do not match).
(8) Quit poi_loader and restart (last time!). Open "poi.db". Import "poi.mmp", which has the "real" rows (in my case, 35,000+ of them). Voila! Aside from a few rows failing (actually a few dozen), everything is properly imported! This took maybe 20mins on a Core 2 Duo e6600. File sizes - "poi.mmp" was 6.1mb, "poi.db" was 8.9mb.
(9) Copy "poi.db" to Nokia SD card, tell Maemo Mapper to use it as the POI database. Everything shows up, with descriptions and categories properly handled. However, Mapper is not particularly "fast" with this many POIs. I don't know if the POI database is indexed--if not that might be a nice enhancement in the future. Other programs & hardware can deal with even larger POI databases, so a speed enhancement should be possible, "in theory."
One could possibly skip step (7), since the categories are presumably loaded into the category table correctly by this point.
So, this whole process took way more time and effort than expected (and getting the data into GPX format was even more complicated, but that's another story). But, it's nice to have it working, and encouraging to know that it CAN be done.
Perhaps in the future there will be software that can handle POI conversions much more elegantly than the existing stuff (and I've tried about a dozen programs at this point). That's not a knock on these programs--a lot of them are quite useful for certain things--but I found no single program that can convert among all POI formats reliably and elegantly. Moreover, even though GPX is supposed to be a universal standard, programs vary widely in their ability to handle the same GPX file (which is supposedly well-formed according to the schema). Some fail if certain tags (e.g. <metadata>) aren't the way they expect. Some ignore tags (like <desc>, <sym>) that you'd expect them to recognize. Some handle the data in these tags more completely than others (e.g. some can handle linefeeds, some can't).
Anyway, thanks again to Rick and the others who offered suggestions. I hope all this is of some use to someone else!
__________________
Igor:
I'm almost sure that was the name.
Quote & Reply
|
abby_normal
View Public Profile
Send a private message to abby_normal
Find all posts by abby_normal