Active Topics

 



Notices


Reply
Thread Tools
abby_normal's Avatar
Posts: 48 | Thanked: 4 times | Joined on Jan 2008
#11
Very handy! But I have not found a way to make it generate a category tag . . . is there something particuar I need to do?
__________________
Igor: I'm almost sure that was the name.
 
rcull's Avatar
Posts: 299 | Thanked: 168 times | Joined on Jun 2006 @ Wales UK
#12
abby_normal

To cut a long story short Poi_Loader has its own format ".mmp" which is just a gpx with the category in <sym></sym> tags included. Unfortunately just changing the filename from .gpx to .mmp wont work because as you have seen Poi_Loader removes newlines from a gpx before outputting its .mmp file. Its not expecting mmp files with linefeeds and the program falls over

The only way this is going to work ( without me releasing another version and I haven't got the time at the moment ) is for you to find a way of removing the newline in the <desk>, renaming the file to .mmp and then Poi_Loaders should import the categories ( I'm ) slightly concerned with the "/" too but suck it and see.

Rick
 

The Following User Says Thank You to rcull For This Useful Post:
abby_normal's Avatar
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.
 
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#14
For what it's worth, Maemo Mapper does not support reading categories from GPX files with an Import POI operation. In the Import POI dialog, you can only specify a singular category that becomes the "default" category that is displayed in the subsequent POI List. You can change the categories in the POI List, but only after they have been initially assigned the "default" category of your choice.

The best approach, unfortunately, without resorting to external software, would be to divide your POI into separate GPX files, one for each category, and import them into Maemo Mapper one by one, specifying the appropriate category with each import. It's not the most convenient work flow in the world, but it's the best Maemo Mapper can do at the moment.
 

The Following User Says Thank You to gnuite For This Useful Post:
Posts: 348 | Thanked: 61 times | Joined on Dec 2007
#15
In this process did you try GPSBabel?
 
abby_normal's Avatar
Posts: 48 | Thanked: 4 times | Joined on Jan 2008
#16
Yes, and I was really hoping that it would do the trick. But it had the following problems:

* I had a choice of 3 input formats to begin with: .img (Garmin specific), .mp (used exclusively by cGPSmapper), and .csv. GPSBabel could not read the first two no matter what I tried. It could read the CSV file, but (as noted in the first post in this thread) that file did not contain "category" fields that I could use in Maemo Mapper. Also, whatever I tried, GPSBabel would not intelligently populate the <desc> or <cmt> tags from the CSV file. Going this route, I got a usable but incomplete set of POIs - name, lat, and lon only, no category, no description.

* Even when I finally massaged the .mp data into .csv format (this took a number of steps), GPSBabel would not populate the <desc> or <sym> tags the way I wanted. I finally had to use a custom script in a programming language called Ruby to format my GPX output properly.

Disclaimer: I know virtually nothing about Ruby, but someone from another forum kindly provided a script that I was able to tweak to my satisfaction.
__________________
Igor: I'm almost sure that was the name.
 
abby_normal's Avatar
Posts: 48 | Thanked: 4 times | Joined on Jan 2008
#17
For what it's worth, Maemo Mapper does not support reading categories from GPX files with an Import POI operation.
Thanks, I realize that now. Fortunately poi_loader provides an alternative that is a bit less labor-intensive. My POI file had 68 categories; doing them in 1 batch is nice.

Still--I said it before--I love the program! If I wanted to suggest enhanced POI importing functionality in a future version, would Bugzilla be the place to do it? I haven't used it yet, but I assume it's relatively straightforward.
__________________
Igor: I'm almost sure that was the name.
 
Posts: 348 | Thanked: 61 times | Joined on Dec 2007
#18
Why were your choices limited to those three? GPSBabel will accept almost any file format, including .xml, .gpx, or what have you, and convert to almost any other. Thus the name.
 
rcull's Avatar
Posts: 299 | Thanked: 168 times | Joined on Jun 2006 @ Wales UK
#19
One problem you might have is if you ever want to provide icons for your categories is with naming. The way Mapper works is to name the Icon (a png or jpg with a .jpg extension) the identical name as the category. Having a "/" in the category name makes this impossible.

Rick
 
abby_normal's Avatar
Posts: 48 | Thanked: 4 times | Joined on Jan 2008
#20
Sorry, should have been clearer. The fine folks who complied all of this data and are kindly sharing it free of charge only have it easily to hand in these 3 formats. They are set up primarily to support Garmin units, so everything is geared to generating Garmin .img files. (This is a full set of autorouting maps of New Zealand, by the way, not just POIs. I have seen their stuff working on a Garmin Nuvi unit, it works great, and is a wonderful alternative to paying $300 for Garmin's NZ maps!).

It looks like there are at least a couple of Maemo programs in the works that might have direct support for Garmin files, and that would be pretty cool too. But Maemo Mapper works now, and the ability to swap among different map repositories gives it a "wow" factor that vector-based apps do not currently support.

I'm not knocking GPSBabel. The concept of a "swiss army knife" program for POIs is sorely needed, and it supports a LOT of formats. But, alas, it could not do what I required!
__________________
Igor: I'm almost sure that was the name.
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:50.