4

I am trying to convert a SOSI file (Norwegian geodata format) to a shapefile. I have set up gdal, but apparantly there is a lot of things that I dont have support for. When I do a ./configure, this is the result:

  LIBTOOL support:           yes

  LIBZ support:              external
  LIBLZMA support:           no
  GRASS support:             no
  CFITSIO support:           no
  PCRaster support:          internal
  LIBPNG support:            internal
  DDS support:               no
  GTA support:               no
  LIBTIFF support:           internal (BigTIFF=yes)
  LIBGEOTIFF support:        internal
  LIBJPEG support:           internal
  12 bit JPEG:               yes
  12 bit JPEG-in-TIFF:       yes
  LIBGIF support:            internal
  OGDI support:              no
  HDF4 support:              no
  HDF5 support:              no
  NetCDF support:            no
  Kakadu support:            no
  JasPer support:            no
  OpenJPEG support:          no
  ECW support:               no
  MrSID support:             no
  MrSID/MG4 Lidar support:   no
  MSG support:               no
  GRIB support:              yes
  EPSILON support:           no
  WebP support:              no
  cURL support (wms/wcs/...):no
  PostgreSQL support:        no
  MySQL support:             no
  Ingres support:            no
  Xerces-C support:          no
  NAS support:               no
  Expat support:             no
  libxml2 support:           yes
  Google libkml support:     no
  ODBC support:              no
  PGeo support:              no
  FGDB support:              no
  MDB support:               no
  PCIDSK support:            internal
  OCI support:               no
  GEORASTER support:         no
  SDE support:               no
  Rasdaman support:          no
  DODS support:              no
  SQLite support:            no
  PCRE support:              yes
  SpatiaLite support:        no
  DWGdirect support          no
  INFORMIX DataBlade support:no
  GEOS support:              no
  Poppler support:           no
  Podofo support:            no
  OpenCL support:            no
  Armadillo support:         no
  FreeXL support:            no
  SOSI support:              no


  SWIG Bindings:             no

  Statically link PROJ.4:    no
  enable OGR building:       yes
  enable pthread support:    yes
  enable POSIX iconv support:yes
  hide internal symbols:     no

And doing the command results in this:

~/gdal$ ogr2ogr -f "ESRI Shapefile" /media//Geodata/testing/sosi.sos /Documents/test.shp FAILURE: Unable to open datasource `/Documents/test.shp' with the following drivers.

I am fairly inexperienced with this, so I am trying to learn. What is going on here, what am I doing wrong?

2 Answers 2

6

According to the manpage http://trac.osgeo.org/gdal/wiki/SOSI you have to compile the SOSI support yourself.

This is dependent on the operating system (which you have not mentioned) and documented on the page.

If you are on a mac, see also Converting SOSI to ESRI Shape

This page (also available in English) has a link to compiled binaries for Linux and Windows of gdal 1.7.2 at the bottom: http://labs.kartverket.no/sos/

For the Windows version, you might run into some error with libeay32.dll. Deleting the ssleay32.dll solves this problem. Or copy both from a 32-bit version from http://www.gisinternals.com/sdk

4
  • Thank you. I am using Linux. I have compiled the SOSI- support myself, but apparantly I need to add the -DSOSI_ENABLED option. However, I am unsure where to do that. It was at labs.kartverket.no/sos someone said this Commented May 10, 2014 at 13:39
  • Maybe a typo? Looking into the configure file github.com/kartverket/gdal/blob/trunk/gdal/configure, --with-sosi sets SOSI_ENABLED=YES.
    – AndreJ
    Commented May 10, 2014 at 14:05
  • Perhaps. Well, I did follow a guide, and did the with-sosi option. I can try again, maybe it didn't work. Commented May 10, 2014 at 14:29
  • Does you configure ouput SOSI support: yes. After when compiling, you can also try to do a make clean before to no keep "garbage" between compilation with different params due do configure changes.
    – ThomasG77
    Commented Nov 9, 2014 at 17:02
4

One thing that tripped me up when reading SOSI files using GDAL: You need to make sure you have write access to the directories containing the SOSI files. The library creates a temp file in the same directory as the file you are reading from. This is explained in a NOTE on the page http://trac.osgeo.org/gdal/wiki/SOSI

Also, make sure the environment variable is set:
GDAL_DATA

I figured out what was wrong by setting these environment variables:
CPL_DEBUG=ON
CPL_LOG_ERRORS=ON
CPL_LOG=cpl.log
The cpl.log will contain useful error messages that can help you if you are still having problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.