OGR: anyone get S57 S-57's to work?

Mar 23, 2007 at 8:36 PM
I'm currently modifying the DemoWebSite to display an S57 layer. It seems to load fine but it when it renders there are empty geometries in GetGeometriesInView() causing a null reference exception.

Anyone have any success with S57's? I've verified that my files render in evdesk.
Mar 26, 2007 at 10:11 PM
I think I have replicated the error; I get an unhandled exception of type 'System.NullReferenceException' occurred in SharpMap.Extensions.dll in OgrProvider.cs on the first line of the following code:

  private SharpMap.Geometries.Geometry ParseOgrGeometry(OGR.Geometry OgrGeometry)
  {
    byte[] wkbBuffer = new byte[OgrGeometry.WkbSize()];
    int i = OgrGeometry.ExportToWkb(wkbBuffer);
    return SharpMap.Converters.WellKnownBinary.GeometryFromWKB.Parse(wkbBuffer);
  }

In order to get it working OGR Datasource working, I had to copy all the .dll files from C:\Program Files\FWTools1.2.2\bin in Debug\bin (project output folder).


George J.
Jul 28, 2009 at 6:19 PM

Hi!

I am getting the same error! If any one solve this or know the reason please reply.

In section on first line ..... the OgrGeometry is null.

 private SharpMap.Geometries.Geometry ParseOgrGeometry(OGR.Geometry OgrGeometry)
{
byte[] wkbBuffer = new byte[OgrGeometry.WkbSize()];
int i = OgrGeometry.ExportToWkb(wkbBuffer);
return SharpMap.Converters.WellKnownBinary.GeometryFromWKB.Parse(wkbBuffer);
}

<input id="gwProxy" type="hidden" /><input id="jsProxy" onclick="jsCall();" type="hidden" />

Coordinator
Jul 29, 2009 at 9:16 AM

Perhaps you should convert the s-57 files to shapefile using ogr2ogr (from FWTools)  hth jd