Reading & rendering S57 file

Topics: SharpMap Project
Jul 25, 2009 at 12:24 PM

Sharpmap can read almost any file except S57. When reading S57 file using sharpmap:

            SharpMap.Layers.VectorLayer layer = new SharpMap.Layers.VectorLayer ("OgrSample");
            layer.DataSource = new SharpMap.Data.Providers.Ogr("***.000");

This is the only possibility to read S57 file but when this layer is assigned to map it gives "null reference error". I think all other files have just one layer but s57 have multiple layers so it is unable to read that format.

Please help in this regard if there is any method to read s57 file and how to render it using Sharpmap. I m using Change Set 55102 and have successfully compiled it.



Jul 25, 2009 at 7:04 PM

Hi Johnitsme, I have rebuilt the GDAL / OGR provider against FWTools 2.4.2 the installation method has changed slightly see 

Get latest and try again (note you may have to clear the bin directory of your app in order to make sure the correct dlls are referenced)

Frank Warmerdam says S57 files can be read with this version, He also advised we should move away from FWTools and to OSGeo4W so expect some changes there.

hth jd

Jul 27, 2009 at 4:11 AM

I am facing the same problem as above...

I am not getting any idea how to build sharpmap "map" object for s57 ... all othr vectors formats (MapInfo, shapefiles) suppported by ogr has different data-source files for different layes of the map ... but s57 has mulitple layers for one enc file .. how to extract different layers from s57 can be extracted.. plz guide on this issue.. anyone who has worked on rendering of s57 using sharpmap will hv an idea how to go about doing this...

Jul 27, 2009 at 3:21 PM
Edited Jul 27, 2009 at 3:31 PM

Hi johndiss, can u plz tell me which version or change set of Sharpmap u r using. As I have already mentioned I m using change set 55102. Should I use another change set or just use another ver of FWTools with same change set as u have mentioned in ur post. can u plz further explain or share info regarding S57 rendering using sharpmap.



Jul 27, 2009 at 6:19 PM

Hi johnitsme the changes were made at rev sharpmap 57193 you will also need to upgrade FWTools to 2.4.2 you will not be able to just update fwtools. I have still never tried to use s57 however the author of FWTools assures me it works with s57 hth jd