org_charp.dll exception, S-57 file

Topics: SharpMap v0.9 / v1.x
Feb 13, 2015 at 11:18 AM
Edited Feb 13, 2015 at 11:21 AM
Visual Studio express 2013

Referanced by NuGet :
Sharpmap 1.1.0
Sharpmap.IU 1.1.0
Sharpmap.Extension 1.1.0

The S-57 file (I:\usmap\DK2KATGN\11\0\DK2KATGN.000) has the following layers

layer 56 C_AGGR
layer 55 M_QUAL
layer 54 M_NSYS
layer 53 M_NPUB
layer 52 M_COVR
layer 51 WRECKS
layer 50 WEDKLP
layer 49 UWTROC
layer 48 TOPMAR
layer 47 TESARE
layer 46 STSLNE
layer 45 SOUNDG
layer 44 SLCONS
layer 43 SBDARE
layer 42 SEAARE
layer 41 RESARE
layer 40 RSCSTA
layer 39 RECTRC
layer 38 RCRTCL
layer 37 RTPBCN
layer 36 PIPSOL
layer 35 PILBOP
layer 34 PILPNT
layer 33 OSPARE
layer 32 OBSTRN
layer 31 NAVLNE
layer 30 MIPARE
layer 29 LIGHTS
layer 28 LNDMRK
layer 27 LNDELV
layer 26 LNDARE
layer 25 LAKARE
layer 24 HRBFAC
layer 23 FOGSIG
layer 22 FSHFAC
layer 21 FERYRT
layer 20 EXEZNE
layer 19 DRGARE
layer 18 DEPCNT
layer 17 DEPARE
layer 16 CTRPNT
layer 15 CONZNE
layer 14 COALNE
layer 13 CTNARE
layer 12 CBLSUB
layer 11 CBLARE
layer 10 BOYSPP
layer 9 BOYSAW
layer 8 BOYLAT
layer 7 BOYCAR
layer 6 BUAARE
layer 5 BUISGL
layer 4 BCNSPP
layer 3 BCNLAT
layer 2 ACHARE
layer 1 ADMARE
layer 0 DSID

If I point to a layer by Layer id (int), there is no problem and the map is shown.

So the referance to the file, anf the S-57 file looks fine.

SharpMap.Layers.VectorLayer xxx = new SharpMap.Layers.VectorLayer("xxx");
xxx.DataSource = new SharpMap.Data.Providers.Ogr("I:\usmap\DK2KATGN\11\0\DK2KATGN.000", 42);

If I point to a layer by layer name (string), I get an exception:

An unhandled exception of type 'System.ApplicationException' occurred in ogr_csharp.dll

Additional information: S57 Driver doesn't support update.

SharpMap.Layers.VectorLayer xxx = new SharpMap.Layers.VectorLayer("xxx");
xxx.DataSource = new SharpMap.Data.Providers.Ogr("I:\usmap\DK2KATGN\11\0\DK2KATGN.000", "SEAARE");

Have looked at this 2 days, and need new input :-)

Hope you are able to help
Jorn
Coordinator
Feb 13, 2015 at 2:24 PM
Does this work:
SharpMap.Layers.VectorLayer xxx = new SharpMap.Layers.VectorLayer("xxx");
xxx.DataSource = new SharpMap.Data.Providers.Ogr("I:\usmap\DK2KATGN\11\0\DK2KATGN.000") { LayerName = "SEAARE" };
Marked as answer by Gyvelvej10 on 2/16/2015 at 4:55 AM
Feb 16, 2015 at 11:55 AM
YES :-)

Thank you so much.

Jorn