1d38c30c0SXin LI 2d38c30c0SXin LI#------------------------------------------------------------------------------ 3*43a5ec4eSXin LI# $File: sosi,v 1.2 2021/02/23 00:51:10 christos Exp $ 4d38c30c0SXin LI# SOSI 5d38c30c0SXin LI# Summary: Systematic Organization of Spatial Information 6d38c30c0SXin LI# Long description: Norwegian text based map format 7d38c30c0SXin LI# File extension: .sos 8d38c30c0SXin LI# Full name: Petter Reinholdtsen (pere@hungry.com) 9d38c30c0SXin LI# Reference: https://en.wikipedia.org/wiki/SOSI 10d38c30c0SXin LI# 11d38c30c0SXin LI# Example SOSI files available from 12d38c30c0SXin LI# https://trac.osgeo.org/gdal/ticket/3638 13d38c30c0SXin LI# https://nedlasting.geonorge.no/geonorge/Basisdata/N50Kartdata/SOSI/ 14d38c30c0SXin LI# https://nedlasting.geonorge.no/geonorge/Samferdsel/Elveg/SOSI/ 15d38c30c0SXin LI# 16d38c30c0SXin LI# Start with optional comments (from "!" to the next line end) 17d38c30c0SXin LI# followed by ".HODE" and end with "\n.SLUTT" followed by an optional 18d38c30c0SXin LI# separator (any number of " ", "\t", "\n" or "\r"), might have BOM at 19d38c30c0SXin LI# the start and following ".HODE" near the start there is "..OMR=C3=85DE" 20d38c30c0SXin LI# (either UTF-8, ISO-8859-1 or some 7 bit Norwegian charset based on 21d38c30c0SXin LI# ASCII) , "..TRANSPAR", "..TEGNSETT " followed by the charset and a 22d38c30c0SXin LI# separator, as well as "..SOSI-VERSJON " followed by the format 23d38c30c0SXin LI# version and a separator. 24d38c30c0SXin LI# 25d38c30c0SXin LI# FIXME figure out how to accept any of [space], [tab], [newline] and 26*43a5ec4eSXin LI# [carriage return] as separators, not only line end. 27d38c30c0SXin LI 28d38c30c0SXin LI# Not searching for full "OMR=C3=85DE" to match also for non-UTF-8 29d38c30c0SXin LI# character sets 30d38c30c0SXin LI0 search ..OMR 31d38c30c0SXin LI>0 search ..TRANSPAR 32d38c30c0SXin LI>>0 search .HODE SOSI map data 33d38c30c0SXin LI>>>&0 search ..SOSI-VERSJON 34d38c30c0SXin LI>>>>&1 string x \b, version %s 35d38c30c0SXin LI# FIXME could not figure out way to make a match for .SLUTT at the end required 36d38c30c0SXin LI#>-7 string \n.SLUTT slutt 37d38c30c0SXin LI#>-8 string \n.SLUTT\n slutt-nl 38d38c30c0SXin LI#>-9 string \n.SLUTT\r\n slutt-crnl2 39d38c30c0SXin LI!:mime text/vnd.sosi 40d38c30c0SXin LI!:ext sos 41