[Gpsbabel-code] xcsv and structured data
Brought to you by:
robertl
From: Ron P. <ro...@pa...> - 2005-07-29 16:02:31
|
This is a continuation of the discussion about the new capabilities page, but since it's gotten off-track for that subject line, and since it's probably also of general interest, I thought I'd split it out. First of all, "xmap" is a misnomer for the format we call that. While it is a format that works with XMap HH, it's also the general import/export format for lots of other DeLorme applications. I wonder if we should consider either renaming it or duplicating it. It's also a lot more flexible than we give it credit for. In fact, it's almost as flexible as .an1, including the ability to express circles and rectangles and map notes and so on. The part that interests me, though, is that it can actually contain multiple arcs as well as two different flavors of waypoints, which means it could work a lot better with a mixture of waypoints and routes than it currently does. I think we can accomplish some cool stuff with some extensions to the style file. ROUTE_PROLOGUE - printed at the beginning of each route (e.g. BEGIN LINE) ROUTE_EPILOGUE - printed at the end of each route (e.g. END) ROUTES_PROLOGUE - printed before all routes (xmap would print nothing.) ROUTES_EPILOGUE - printed after all routes TRACK_PROLOGUE - as above, but for tracks. TRACK_EPILOGUE TRACKS_PROLOGUE TRACKS_EPILOGUE On read, if we see a line matching the route prologue, we assume that the following waypoint data should be stuck into a route. Ditto tracks, etc. What to do in the case of xmap, where both routes and tracks use the same prologue? I think which one has priority on read should be explicit somehow in the style file: PRIORITY WAYPOINT,TRACK,ROUTE This would allow the 'arc' type to read as a track by default, just by including PRIORITY TRACK at the top. All that stuff is probably pretty easy. Here's something uglier: I think we should be able to add command-line options in the style file. For my purposes, it'd be sufficient to have a block in the style file something like this: OPTION mapnotes PROLOGUE "BEGIN MAPNOTE" OPTION_END so if "mapnotes" is specified as a command-line option, the contents of the OPTION block override the default options. This would let us create map notes instead of symbols if that was our wont (but not both within the same file, even though the format supports that. I consider this a bug in my proposal but probably not worthy of being fixed.) Any thoughts? Better ways to do this? Rotten fruit? |