ThinkGeo.com    |     Documentation    |     Premium Support

Rendering Nautical Charts in s57 format

Similar to the OP, I can add a reference to the file in a different folder ok, but the map appears blank.


Also, if I click and drag the mouse across the blank map, the form closes and causes an error in "void Main()".


Is this because it isn't ready for VS2010?



Paul, 
  
 I think the problem is that S57FeatureLayer rely on FdoExtension, however FdoExtension doesn’t support x64 operating system so far, but we have already put it to our working system, that means our engineers are working on that, if we update it to support x64, I will let you know ASAP. 
  
 Thanks 
 James

 James,


I  think you are right - I was trying this  on a 64 bit system.


I'll give it a try on a 32 bit.


Thanks



Paul,


Thanks for your post and feedback.
 
I hope we can get the FDO supported in the x64 versions, which definitely make it flexible to use. Let us know your testing result on the x86 machines if you want.
 
Any more questions please feel free to let me know.
 
Thanks.
 
Yale

Was FDO ever fixed so it works with x64? I am running Windows 7 64 bit with ThinkGeo Desktop 4.5.0.0 and Visual Studio 2010. I have: 
  
 1) Referenced the DLL FdoExtension and can see it in the references. 
 2) Copied the Folder MapSuiteFdoExtensionx86 from C:\Program Files (x86)\ThinkGeo\Map Suite Desktop Full Edition 4.5\Developer Reference\System32 to “C:\WINDOWS\system32” 
  
 but when I run the "LoadGeoDatabaseFeatureLayer" sample application I get: 
  
 "You should get Fdo dependencies from [Install-Path]\Developer Reference\System32, and put MapSuiteFdoExtensionx86 folder to System32 folder." & vbCrLf & "" & vbCrLf & "Could not find MapSuiteFdoExtension.dll assembly." 
  
 Thanks, 
  
 Dave

David,


Could you take a try to copy the folder to the folder “C:\Windows\SysWOW64” instead of “C:\Windows\System32”? Hope that can fix your sample application exception.
 
The FDO library can be run in x64 bit OS unless your application is built against x86 mode, we have not get the x64 bit FDO library supported yet.
 
Any more questions please feel free to let me know.
 
Thanks.
 
Yale

Thanks - moving that folder gets me further. 



I changed: 

Dim worldLayer As New PersonalGeoDatabaseFeatureLayer("..\..\SampleData\Data\JORWD6gdb.mdb", Nothing, Nothing, "Mains") 

to 

Dim s57Source As New S57FeatureLayer("X:\CDR Maps\ENC\South China Sea\EA200003\ENC_ROOT\EA200003.000", "ID","","","Geom") 



I still can't see my layer yet - when the map does a refresh I see:


"A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll"


I am presuming that is because I have no idea what the idColumnName or geometryColumnName is in the S57 file that I have. I presume I need to look at FeatureSource to find all the column names & pick which one is the one I need. Or dig up my other S57 reader and see if that gives me column names.


 



Yale, 
  
 We have support FDO x64 because I have upgraded FDO library from 3.4 to 3.5. 
  
 David, 
  
 Do you find a way to get those information, please let me know if you still not find. 
  
 Thanks, 
 James

Actually I managed to get the S57 layer into your LoadGeoDatabaseFeatureLayer sample by changing some lines of code once I had the FDO library sorted out in Windows 7 64 bit. But I copy & paste the exact same code into my own application and it doesn’t work at all - keeps throwing up: 
 A first chance exception of type ‘System.Reflection.TargetInvocationException’ occurred in mscorlib.dll 
 So, I am still working my way through the cause of that. 
 Realistically I am wondering about the usefulness of the S57 layer anyway - it just consists of very simple points, lines & areas. To get it looking anything like an ENC or a paper chart would probably be a massive undertaking, although I did it several years ago in MapInfo.

David,


Take a look at the following post which is related with the same issue, hope it helps.
gis.thinkgeo.com/Support/Dis...fault.aspx
 
Any more questions please feel free to let me know.
 
Thanks.
 
Yale

I don’t think it is the same issue - I tried adding the VB code equivalent though: 
  
         Process.GetCurrentProcess.ProcessorAffinity = CType(1, System.IntPtr) 
  
 but still get the same error. As I mentioned, exactly the same code works if I use your (modified) How Do I sample on the same computer, so I doubt it is a processor setting. I still haven’t figured it out, but I am leaning away from S57 now because the presentation isn’t really suitable anyway without a huge amount of work.

Here is the S57 file imported by modifying your How Do I sample:



Here is the same S57 file imported into another application (Global Mapper):



As you can see, Global Mapper is able to do a lot of processing of the file to S57 'standards' to make it look like a nautical chart (although at this scale it looks very messy!).


I am not sure I will be able to get ThinkGeo to do this, at least not until after more important work is done. I'd be interested if anyone else is working in this area though....... So, for the moment I plan to look at using Google Maps as the background layer (although that has it's own hurdles!)



David, 
  
 I afraid the S57FeatureLayer only half suports S57 file, it can get features from data, but couldn’t get styles, you have to set the style by yourself. 
  
 Do you find the way to use Google Maps as background layer? We provide GoogleOverlay and GoogleMapsLayer to do it at DesktopEdition. 
  
 Sorry for inconvenience. 
  
 Please let me know if you have more questions. 
  
 Thanks, 
 James

Just a quick check - is S57 still supported in 5.5? I just reactivated some code that did work in 4.5 (while not producing very useful results) but now this line: 
  
 Dim myS57FeatureLayer As New S57FeatureLayer(filename, “FID”, “OGRSchema”, “Area”) 
  
 gets an error in the IDE of: 
  
 Error 1 Type ‘S57FeatureLayer’ is not defined. C:\Users\User\Documents\Visual Studio 2010\Projects\MVMControl3\MVMControl3\Form1.vb 1438 38 MVMControl3

David, 
  
 I think probably you missing add reference FdoExtension.dll, you can found it under SpatialExtension folder. 
  
 I have created a sample to test, if doesn’t refer it, it get the similar error with yours. 
  
 Let me know if you still couldn’t fix it after you try my suggestion. 
  
 Thanks, 
 Li Fan

David,



Can I have WPF (C#) sample program, base on data attached?

Hello Ahmad, 
  
 Welcome to Map Suite Forums! 
 I just guess the below codes might be helpful: 
  
            wpfMap1.MapUnit = GeographyUnit.DecimalDegree;

            S57FeatureLayer s57layer = new S57FeatureLayer(string pathFilename, string idColumnName, string featureSchemaName, string featureClassName, string geometryColumnName);
            s57layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
            s57layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            s57layer.Open();
            wpfMap1.CurrentExtent = s57layer.GetBoundingBox();

            wpfMap1.Refresh();
 
 Note: In order to use the S57FeatureLayer class, you need to refer to the "DLL FdoExtension" and do some copies. More details please have a look at 
 thinkgeo.com/forums/MapSuite/tabid/143/aft/10703/Default.aspx 
  
 Hope it helps. 
 Regards, 
 Troy

How to to get the DefaultTextStyle in s57?

Hi Ahmad, 
  
 Actually a new package for dealing with S57 will be available in this week, compared with the old one supported based on FDO, we did much more enhancements to it, such as do spatial query, SQL Statement query, all attributions available etc. but it still missed reading style from S52 file, this functionality will be added in near future. 
  
 Now for the DefaultTextStyle, we need to config them based on the attribution from the S57, just like other data format file. Here are example, maybe you can have a try: 
 wiki.thinkgeo.com/wiki/Map_Suite_MVC_Edition_Labeling_Samples 
  
 Thanks, 
 Johnny

Hi Guys,



In the latest Daily Build (Daily build 9.0.31.0 or later, Map Suite Unmanaged Dependencies 9.0.31.0.msi or later needs to be installed) you now have access to improved support for Nautical
Charts for S-57 and S-52 data. From now until the release next year we will be
incrementally unveiling new features and enhancements via our Daily Development
Builds. You can access the Daily Builds and Code Sample directly from the
ThinkGeo Product Center.



Samples:



1. wiki.thinkgeo.com/wiki/Map_Suite_Wpf_Desktop_Edition_Layers_%26_FeatureSources_Samples#Maritime_S57_FeatureLayer

2. wiki.thinkgeo.com/wiki/Map_Suite_Wpf_Desktop_Edition_Layers_%26_FeatureSources_Samples#ENC_Viewer_for_displaying_S-57_.28.2A.000.29_File



Thanks,

Johnny