sosi 1.6 KB

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