[NUUG kart] Yet another tool to convert kartverket data to OSM

Gnonthgol gnonthgol at gmail.com
Sun Jan 11 14:09:18 CET 2015

Hash: SHA1

Den 11. jan. 2015 13:45, Thomas Weidner skreiv:
> Yes, I totally plead guilty of NIH syndrome here. One thing I did not seem to be possible with sosi2osm is collecting all roads and road route numbers and output a corresponding relation at the end. But then, at some point I stopped looking at it.

This is not possible in sosi2osm. I thought about such cases and figured it was better to just postprocess the osm files in good tools rather then try to implement such tools myself. sosi2osm is only converting objects directly and allows you to run the tags through a lua script as the tags in SOSI is hiriarchical
and even allows multiple values.

> If sosi2osm is the project to go and you can maybe only copy some SOSI->OSM tag mapping from my source this would also be fine for me.

Thank you.

> Unfortunately Java has no nice way of switching the input encoding while reading the file, so I put it on the TODO list, but it should be fixed.

The simple hack here would be to just reopen the file once the charset is determined.

>> You have probably seen the SOSI standard definitions over at http://www.kartverket.no/en/SOSI-Standard-in-English/SOSI/
> I read the Norwegian standard document about the SOSI format (using google translate)

These are the same files but translated manually.

> The BNF is international ;). I think apart from the encoding issue, there are two problems:
> 1. The parser does not handle data values correctly, strings ("a quoted string") are not parsed correctly

I have even seen SOSI documents containing strings that should be quoted but are not.

> 3. to correctly understand files you seem to have to read the definition files. For example "..VNR X Y Z" is really shorthand notation for "..VNR ...VEGKATEGORI X ...VEGSTATUS Y ...VEGNUMMER Z"

The FYBA library is also missing this feature.

> The FYBA C library seems to be pretty complete, but also pretty ancient. Maybe having an alternative is not that bad.

If there were a nice modern alternative we could use I think even the officials would prefer it. The problem with making parsers though is that you have to handle a lot of almost standard documents too. FYBA does a very good job at this at the moment but it a pain to get to work. If I could get FYBA to work on
windows I would have loved to publish a binary of sosi2osm for windows.

Version: GnuPG v1


More information about the kart mailing list