[gdal-dev] GDAL/OGR 3.4.1 not reading S57 correctly

dthorne at pivotmaritime.com dthorne at pivotmaritime.com
Thu Jan 27 16:55:49 PST 2022


The S57 file we used to test with each language and it is read correctly in C# & python, our c++ project is the problem. The S57 is the one generated in "\gdal-3.4.1\autotest\ogr\data\s57" when we built gdal. But [ here is a link ]( https://drive.google.com/file/d/1AGCHEQMWHvs6IJgDW45KJvK6gm-r_cpH/view?usp=sharing ) to that s57 folder.

The specific s57 file we used was "1B5X02NE.000" which in reference to the first image I linked should have 13 layers. 
Thanks in advance for the help! 

Daniel



-----Original Message-----
From: "kusala nine" <kusala9 at googlemail.com>
Sent: Friday, January 28, 2022 7:04am
To: "Momtchil Momtchev" <momtchil at momtchev.com>
Cc: dthorne at pivotmaritime.com, gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] GDAL/OGR 3.4.1 not reading S57 correctly


I’m an S57 expert. Send me the data - I’ll take a look, there’s a lot of leeway with S57 and sometimes it trips up GDAL. I had issues with AML data before which is similar…
Jonathan. 


Sent from my iPhone

On 27 Jan 2022, at 10:44, Momtchil Momtchev <momtchil at momtchev.com> wrote:



 
    Your code looks OK, can you send me the file too?
 
On 27/01/2022 03:34, [ dthorne at pivotmaritime.com ]( mailto:dthorne at pivotmaritime.com ) wrote:
Here is the C++ code we have written to read the test s57 file. 
[ https://pastebin.com/seXrkgmB ]( https://pastebin.com/seXrkgmB )
  
 We feel that it is some setup stuff we have missed but can't find any clear information. For example we hadn't seen GDAL_DATA environment variables mentioned in any of the documentation we've tried following until Even mentioned it. Are there any other setup stuff we need to do? [ 
 ]( https://pastebin.com/seXrkgmB )


-----Original Message-----
 From: "Momtchil Momtchev" [ <momtchil at momtchev.com> ]( mailto:momtchil at momtchev.com )
 Sent: Wednesday, January 26, 2022 9:21pm
 To: [ dthorne at pivotmaritime.com ]( mailto:dthorne at pivotmaritime.com ), [ gdal-dev at lists.osgeo.org ]( mailto:gdal-dev at lists.osgeo.org )
 Subject: Re: [gdal-dev] GDAL/OGR 3.4.1 not reading S57 correctly



 
Can you post your C++ code? Generally, you have more chances of getting an answer for this type of question on [ https://gis.stackexchange.com/ ]( https://gis.stackexchange.com/ )
 
On 24/01/2022 06:36, [ dthorne at pivotmaritime.com ]( mailto:dthorne at pivotmaritime.com ) wrote:
Hi, So I am trying to get a test C++ project built to read S57 files using the gdal/ogr C++ library. I have previously used the C# library that is on there NuGet manager which states v2.4.4 and that seems to read the s57 without issues. Also tried python and that seems to read it with no issues. However, I am having a problem with the C++ test project. Having built the C++ library into the .lib and .dll files I have included them into a blank project and implemented the functions to read the s57 file, however it is only reporting 5 layers.These 5 layers are the same no matter the s57 file. And 4 out of those 5 layers are not actually layers.Using the autotest generated s57 file as a unit test to cross check, there is supposed to be 13 layers. 
 Note: I had feedback from Even indicating the setup environment is probably wrong. And to set up the GDAL_DATA environment variable, so we've made an environment variable referencing the gdal/data folder and that hasn't fixed the problem, but I think it's on the right track as Even said they could reproduce the problem if not setup correctly.
Has anyone had success reading s57 files with a C++ 3.4.1. project that could possibly help get this going?

 Link to reference Image: [ https://imgur.com/a/KwmqZSe ]( https://imgur.com/a/KwmqZSe )
Regards,Daniel

_______________________________________________ gdal-dev mailing list [ gdal-dev at lists.osgeo.org ]( mailto:gdal-dev at lists.osgeo.org ) [ https://lists.osgeo.org/mailman/listinfo/gdal-dev ]( https://lists.osgeo.org/mailman/listinfo/gdal-dev )
-- Momtchil Momtchev [ <momtchil at momtchev.com> ]( mailto:momtchil at momtchev.com )
-- Momtchil Momtchev [ <momtchil at momtchev.com> ]( mailto:momtchil at momtchev.com )_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220128/020f2f1b/attachment-0001.html>


More information about the gdal-dev mailing list