Converting BNA to GPX

There are some ancient BNA files on my hard disc, dating back to 1996. They were generated using some proprietary mapping software called “GoldenSoft Map View”. I used this programme in university while writing my thesis. At home, I used selfmade utilities I had written for my Atari ST.

The plan to convert those BNA files to GPX has been there for ages – even considering a re-write of my personal map viewer for those files in some object orientated language. But now, I encountered ogr2ogr which can do the job:

ogrinfo -ro -al -summary /mnt/BACKUP/D/map/world.bna
INFO: Open of `/mnt/BACKUP/D/map/world.bna’
using driver `BNA’ successful.

Layer name: world_points
Geometry: Point
Feature Count: 175
Extent: (-99.239204, -51.675117) – (178.408966, 64.260612)
Layer SRS WKT:
(unknown)
Primary ID: String (0.0)
Secondary ID: String (0.0)

Layer name: world_polygons
Geometry: Multi Polygon
Feature Count: 418
Extent: (-178.456192, -81.035141) – (190.044510, 83.616669)
Layer SRS WKT:
(unknown)
Primary ID: String (0.0)
Secondary ID: String (0.0)

Layer name: world_lines
Geometry: Line String
Feature Count: 3
Extent: (-180.010941, -85.472992) – (179.763107, 55.058968)
Layer SRS WKT:
(unknown)
Primary ID: String (0.0)
Secondary ID: String (0.0)

Looks nice, now give it a try:

ogr2ogr -f “GPX” /tmp/world-bna.gpx /mnt/BACKUP/D/map/world.bna
ERROR 6: Field of name ‘Primary ID’ is not supported in GPX schema. Use GPX_USE_EXTENSIONS creation option to allow use of the element.
ERROR 6: Field of name ‘Secondary ID’ is not supported in GPX schema. Use GPX_USE_EXTENSIONS creation option to allow use of the
element.
ERROR 6: Geometry type of `Multi Polygon’ not supported in GPX.

ERROR 1: Terminating translation prematurely after failed
translation of layer world_polygons

Well, there is still some work left. But we are very close…

After all, it is possible to convert BNA to KML or ESRI.

Open Streetmapping with Motorola A780: Strange values

For some weeks now, I am a proud owner of a linux driven A780 GPS mobile. It is quite easy to open GPS tracks in any text editor: Mounting my Motorola as mass storage is done automagically by udev + hal daemons.

Parsing its contents is less easy – at least if you want to make use of all information stored.
Obviously, tracking is vector orientated: Each vector (logged as one line) has got one start and one end time, latitude, and longitude. In hardly any case, subsequent vectors have common end/start values.

It shouldn’t be very hard to write a parser extracting all given coordinates (i.e. start and end coords for any vector line) – but guessing the meaning of the left columns occurs to be hard:

StDate     StTime   EndDate    EndTime       StLat     EndLat      StLong     EndLong Fix Total     Total #OfObs
(UTC)      (UTC)    (UTC)      (UTC)                                                      Miles     Hours
----------------------------------------------------------------------------------------------------------------
08/23/2008 09:11:15 08/23/2008 09:15:50  52.029861  52.039635    8.555399    8.598636 1 -3649860701231198131961668199318255273253704759060934360615150772018946839312983390068665767128059356237740002978924188506914396338678317267284591053595745998525189226233856.00     0.000 768152
08/23/2008 09:15:53 08/23/2008 09:17:04  52.039892  52.037446    8.599602    8.614022 1 -78118279941557931703363451455652206793696749610332198789022918111496705774753948327901293097707913114779364083391770081968424685419280192230328808432059202942449336286932111339638257750450957502640494359747686692974231552.00     0.000 768152
08/23/2008 09:17:09 08/23/2008 09:17:28  52.037435  52.037543    8.613871    8.613807 1   -0.00     0.000 768152
08/23/2008 09:17:46 08/23/2008 09:18:12  52.037328  52.039549    8.614043    8.617584 1   -0.00     0.000 768152
08/23/2008 09:18:15 08/23/2008 09:19:43  52.040010  52.047724    8.618184    8.635565 1 -344646659481965599028466738922047546765953134524746744268617381020796015676674827437106811168638611102639620443121993900825615697463858624748128071954920622070466913444633264051453952.00     0.000 768152
08/23/2008 09:19:46 08/23/2008 09:25:32  52.048389  52.066178    8.635329    8.662022 1 -438278375512559217652056156777336964928373076093870088506703880101717226850843193135491371767624957503494869835647695687123337567729156216808571666432.00     0.000 768152
08/23/2008 09:25:36 08/23/2008 09:28:46  52.067304  52.101261    8.662473    8.718177 1 30068130744005489155484081831838965166576489273498100822888867340749494086281791865200369474663529612734774394515077434054123978752.00     0.000 768152

Take note of the huge values shown in the “Total Miles” field – if these are decimal numbers, they would be really big numbers; Openoffice.org Calc reads the last column like this:

-3,65E+171
-7,81E+220
0
0
-3,45E+182
-4,38E+149
3,01E+130

And what does the last field mean, cryptically named #OfObs ?

Geomatikprojekt mit Schülergruppen

Was für Wissbegierige die Wikipedia ist, ist das Projekt OpenStreetMap für alle Reisenden, Geographen und Navigatoren. Hier strickt die Weltgemeinschaft fortschrittlicher Internetnutzer/innen an einem globalen Kartennetz, das von Anfang an Gemeingut sein soll.

openstreetmap logo Außer einem Internetzugang benötigen interessierte Beitragsleister (potenzielle Kontributoren) entweder fundierte Ortskenntnis von unbeschrifteten Kartenbereichen – oder ein GPS-Gerät, mit dem sie weiße Flecken auf der Weltkarte vermessen können.

In der letzten Septemberwoche planen wir im Informatikunterricht ein Geomatik-Projekt, für das uns Sponsoren von OpenStreetMap.org 10 GPS-Tracker zur Verfügung stellen.

Dafür gilt bereits jetzt mein Dank u.a. an die Geofabrik in Karlsruhe, die die Buchung und den Versand dieser Geräte übernommen hat.