Changes between Version 9 and Version 10 of SOSI


Ignore:
Timestamp:
Oct 24, 2013, 12:41:51 AM (11 years ago)
Author:
sbl
Comment:

Add plugin support hints, usage examples

Legend:

Unmodified
Added
Removed
Modified
  • SOSI

    v9 v10  
    77 * General information on the Norwegian SOSI format in Norwegian[[BR]]
    88 ([http://www.kartverket.no/Standarder/SOSI/SOSI-standarden-del-1/])
     9 * Github repository of the OpenFYBA-library wich is required for the OGR-SOSI-driver[[BR]]
     10 ([https://github.com/kartverket/fyba])
    911 * Initial discussion about the integration if a driver for the Norwegian SOSI format[[BR]]
    1012 ([http://trac.osgeo.org/gdal/ticket/3638])
    1113 * Updates on the activities of the National Mapping Authority of Norway (Statens kartverk) on that topic (in Norwegian)[[BR]]
    1214 ([http://labs.kartverket.no/sos/])
     15
    1316
    1417
     
    3437=== Download and build GDAL ===
    3538
    36 For the time being, convenient access to the SOSI driver is provided by a GDAL version hosted on the git repository of the National Mapping Authority of Norway (Statens Kartverk):
    37 [https://github.com/kartverket/gdal]
    38 
    3939{{{
    40 git clone https://github.com/kartverket/gdal gdal_sosi
    41 cd gdal_sosi/gdal
     40svn checkout https://svn.osgeo.org/gdal/trunk/gdal gdal
     41cd gdal
    4242#Recreate the configure script with SOSI support
    4343sh autogen.sh
     
    5858The OpenFYBA library - where the SOSI-driver is build on - consists of three parts: GM.lib, UT.lib, and FYBA.lib.
    5959
    60 Download GDAL source code from [http://trac.osgeo.org/gdal/wiki/DownloadSource] for GDAL version 1.9.2 or later.
     60Download GDAL source code from [http://trac.osgeo.org/gdal/wiki/DownloadSource] for GDAL version 1.9.2 or later (plugin-option available since revision 26547).
    6161
    62 Uncommend lines regarding SOSI-support in GDALs nmake.opt and set path to where you have your lib-files and include folder for OpenFYBA e.g.:
     62Uncomment lines regarding SOSI-support in GDALs nmake.opt and set path to where you have your lib-files and include folder for OpenFYBA e.g.:
     63If "SOSI_PLUGIN = YES" is uncommented SOSI-support is built as a plugin and the plugin-.dll deployed in the gdalplugin directory.
    6364
    6465{{{
    6566# Uncomment for SOSI support
    6667SOSI_ENABLED = YES
     68SOSI_PLUGIN = YES
    6769SOSI_INC_DIR = -IC:/fyba/include
    6870SOSI_LIBS = C:/fyba/Lib/GM.lib C:/fyba/Lib/UT.lib C:/fyba/Lib/FYBA.lib
     
    7476[https://bitbucket.org/kartverket/fyba/src/e0a53133586261258e9333ce314ba1df0a1fb63e/releases?at=releases]
    7577
    76 == Testing and using the SOSI driver ==
     78== Testing the SOSI driver ==
    7779
    7880To test if the driver has been loaded, execute the following (look for "SOSI" in the results):
     
    9193}}}
    9294
     95== Usage examples ==
     96
     97Convert layers of all SOSI-files in the current directory to shape-format:
     98{{{
     99dir=$(pwd)
     100for s in $(ls ${dir}/*.sos)
     101do
     102        name=$(echo $s | cut -f1 -d'.')
     103        layers=$(ogrinfo $s)
     104        if [ $(echo $layers | grep points | wc -l) -eq 1 ] ; then
     105                ogr2ogr ${name}_pnt.shp $s points
     106        fi
     107
     108        if [ $(echo $layers | grep lines | wc -l) -eq 1 ] ; then
     109                ogr2ogr ${name}_lin.shp $s lines
     110        fi
     111
     112        if [ $(echo $layers | grep polygons | wc -l) -eq 1 ] ; then
     113                ogr2ogr ${name}_pol.shp $s polygons
     114        fi
     115done
     116}}}
    93117Note:
    94118When accessing a SOSI file, the SOSI driver writes out indices into a subfolder within the same directory where your SOSI files (.sos) are stored. Therefore you have to have write access to the directory containing your SOSI files.