ThinkGeo.com    |     Documentation    |     Premium Support

Rendering Nautical Charts in s57 format

I was looking at Kevin post at: gis.thinkgeo.com/Support/Dis...fault.aspx


I was trying to use the sample on vbnet 2008 but the method s57FeatureLayer is not present on ver. 3.0 of the mapsuite windows control. I tried some work arounds but the map is not rendering.


The bottom line is, do you guys have a sample on how to show a nauctical chart in s57 format (file extension .000) using ver 3.0 of mapwindow on vs2008?  That would simplify things.


Thanks and Regards,



Cesar, 
  
 Thanks for your post and welcome you to ThinkGeo MapSuite Discussion forum. 
  
 You may need to FdoExtension.dll as well as MapSuiteCore.dll in Developer Reference\Spatial Extensions\Fdo Extension folder. 
  
 We do support s57 file loading, while it seems up to now, we cannot fully support its file, some information cannot be read out. While we have no way to control it, it totally depends on the FDO provided by OGC. Hope the later versions can enhance it. 
  
 Any more questions just feel free to let us know. 
  
 Thanks. 
  
 Yale 


Do you guys have a simple working vbnet sample I can try out?


I downloaded a free map file in s57 format from NOAAs website with coastal nautical charts.  I been trying to make a proof of concept with your map suite control showing maps in s57 format to explore the possibility to request the acquisition of Map suite to develop maritime traffic control applications.


 


 



Cesar, 
  
 Thanks for your input. 
  
 The code should be exactly the same with code in following post with only some minor changes in the constrcutor by passing some parameters, which depends on the concrete data. 
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6383/afv/topic/Default.aspx 
  
 If you want, you could send us the s57 file, we may try it out. 
  
 Thanks. 
  
 Yale 


Hi Yale.


As stated in the first post the sample code at line 15, where it says: Dim MarineChartLayer As S57FeatureLayer = New S57FeatureLayer("C:\Sample ThinkGEO Apps\ExtendingMapSuite_FDOSamples\FDO Samples\SampleData\IHO S-57 (ENC)\GB4X0000.000", Nothing, Nothing, "Area")


the S57FeatureLayer  call is not available in map suite, unles it is another class in other piece of code that its not in the sample.  I am using vs2008 and the last downloadable trial version of mapsuite.


The Electronic nautical charts in s57 format I tried are in charts.noaa.gov/ENCs/ENCs.shtml


I have attached the file also.



2079-US4CN22M.zip (493 KB)

Cesar,


1. Reference the DLL FdoExtension, other wise you could not see the S57FeatureLayer class.

2. Copy the Folder MapSuiteFdoExtensionx86 from C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 3.0\Developer Reference\System32 to “C:\WINDOWS\system32”



Private Sub ShowHideLayer_Load(ByVal sender As Object, ByVal e As EventArgs)
winformsMap1.MapUnit = GeographyUnit.DecimalDegree
winformsMap1.BackgroundOverlay.BackgroundBrush = New GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)

Dim fileName As String = "C:\Post7521\US4CN22M\US4CN22M\US4CN22M.000"
Dim s57FeatureLayer As S57FeatureLayer = New S57FeatureLayer(fileName, "FID", "OGRSchema", "Area")
s57FeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1
            s57FeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20

Dim staticOverlay As New LayerOverlay()
staticOverlay.Layers.Add("WorldLayer", s57FeatureLayer)
winformsMap1.Overlays.Add("WorldOverlay", staticOverlay)

winformsMap1.CurrentExtent = New RectangleShape(-139.2, 92.4, 120.9, -93.2)

s57FeatureLayer.Open()
winformsMap1.CurrentExtent = s57FeatureLayer.GetBoundingBox()
s57FeatureLayer.Close()

winformsMap1.Refresh()
End Sub

Any more questions just feel free to let me know.


Thanks.


Yale

 



Yale. 
  
 I tried referencing the DLL FdoExtension doing the instructions you provide, but I could not get it referenced.  I am running VS2008 on windows7. 
  
 Is there an additional step on windows7?  I dont even get to see the dll files in vs2008 browse tab for referencing dlls but physically the file is there and my user has admin rights on PC and system files. 
  
 I could referenced the file from the browse window on vs2008 directly at the location C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 3.0\Developer Reference\System32 but the mapwindows does not render the map and it shows blank. 
  
 Any hints to get this working? 
  
 Thank you for your time.

Cesar,


Thanks for your input and questions.


We have a quick start guide showing how to create a map step by step, could you have a try following its guide to see the map can be shown correctly?

gis.thinkgeo.com/Support/Dis...fault.aspx


Of course, this quick start sample only shows data in Decmail Degree shape file. The only difference of the S57 file is to reference steps I mentioned in previous posts.


Any more questions just feel free to let me know.


Thanks.


Yale

 



I tried.  It runs but the map does not show.  There are no flagged errors and no map either. 
 have you tried running this sample on windows7 environment?  maybe on xp works but so far on win7 I have not been able to run it.

Cesar, 
  
 Thanks for your feedback. 
  
 Just make sure you tried the Quick Start guide and the map does not show?  Which product have you installed on your machine? And did you do any uninstall before? 
  
 There is a available sample attached in the Quick Start page, did you have a try to run it after change the reference of the two DLLs needed (MapSuiteCore.dll and DesktopEdition.dll)? 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 


I’m having the same problem - I can’t use the S57FeatureLayer class as it isn’t referenced yet, but I can’t add a reference to FdoExtension.dll because VS doesn’t show it in the dialog box. 
 Did you find a solution? 
  
 I’m using C# in VS2010 on Windows 7. 
  
 Thanks

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.