ThinkGeo.com    |     Documentation    |     Premium Support

S57 layer load not working

Hello.
first, I’m learning English now and my English is still not so good.

I’m Test S57 Layer load sample.
But not working.(only view backgroundbrush)
S57StyleFactory is thinkgeo wpf sample code.

Can I get the S57 sample project at MVC Version?
and please check my mistake.

Best regards.

my Test Code.

Index.cshtml

@using ThinkGeo.MapSuite.MvcEdition
@using ThinkGeo.MapSuite.Core

@{Html.ThinkGeo().Map(Model).Render();}

controller.cs

Map __map;

    public ActionResult Index()
    {
        __map = new Map("VMS",
            new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage),
            new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage));

        S57FeatureLayer layer = new S57FeatureLayer(Server.MapPath("~/App_Data/US1HA02M/US1HA02M.000"));
        layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(S57StyleFactory.GetMaritimeStyle());
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        try
        {
            layer.Open();

            LayerOverlay overlay = new LayerOverlay();
            overlay.TileType = TileType.SingleTile;
            overlay.IsBaseOverlay = true;
            overlay.Name = @"BaseMap";
            overlay.Layers.Add(layer);

            __map.CurrentExtent = new RectangleShape(123.84, 39.0, 131.53, 33.4);
            __map.MapTools.ScaleLine.Enabled = false;
            __map.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#d8f4e1"));
            __map.MapUnit = GeographyUnit.DecimalDegree;
            __map.CustomOverlays.Add(overlay);

            layer.Close();
        }
        catch(Exception e)
        {
            Console.WriteLine(e.ToString());
        }

        return View(__map);
    }

Result

Hi Binary,

Please reference the NauticalChartsExtension.dll, then use the NauticalChartsFeatureLayer instead of S57FeatureLayer.

After that, your extent is set incorrect, please use this line:
__map.CurrentExtent = layer.GetBoundingBox();

And you can see it render correct.

Regards,

Don

Hi Binary,

Sorry I cannot understand what’s the exception issue here, could you please copy the exception information and translate it to English?

If that’s related with the dll, I suggest you download the latest 9.0.x.0 dll package, and find the NauticalChartsExtension.dll under this folder: 9.0.x.0DllPackage\Managed Assemblies\Spatial Extensions\NauticalCharts Extension

Then reference this dll in your project.

And if you still met exception please let me know the detail exception information.

Regards,

Don

Hi Don,
Thank you for reply.

We don’t translate english, because visual studio not support other language.
We expired ThinkGeo Assurance license.
We download last dll full package version is 9.0.0.0.
This package not have NauticalChartsExtension.dll.
So, We are downloaded “Daily Eval Developement 9.0.399.0” at NauticalChartsExtension.dll.

Please download this sample project and check my problem.
[enter link description here][1]

Best Regards.

Hi Binary,

I means you can copy the detail exception information, then transfer that to English, so we can know what’s the problem there.

Yes our 9.0.0.0 don’t contains the NauticalChartsExtension.dll, so try 399.0 is OK.

If you met the license issue, please download our product center, then view the status of your MVC edition.

About the license issue, if you are trying eval edition now but your full edition expired, please contact your sales to know how to handle it.

I did small change for your code, it render correct like this:

What you want to do first is build index for the 000 file like this:
NauticalChartsFeatureLayer.BuildIndexFile(@“D:\WMS_SERVER\App_Data\ENC_Chart\KR1F0000.000”);

Wish that’s helpful.

Regards,

Don

Hello Don.

I try to continue testing NauticalChartsFeatureLayer sample using evaluation edition.
I match the version of reference dlls as your advice.
Type initializer exception is not occurred any more, but IIS exception has been occured.

  • Exception screen shot

My system

  1. windows : windows 8.1
  2. IIS : 8.5
  3. .Net framework targets 4.0
  4. IIS Pool : .Net 4.0 Intergrated.

Please reply the reasons and solution.
Thanks.

Best Regards.

Hi Binary,

Please don’t move your project to IIS before you make that works well by your VS debug. Because if you need to put the project into IIS, you need to use our server edition but not for the general edition, and I think for server edition we don’t have eval version. For more information about it, you can contact your sales for detail.

Here, if you still cannot make that shows in your VS environment, please download this package for update all unmanaged dlls: https://ap.thinkgeo.com:5001/sharing/VCxyy8VZJ

Wish that’s helpful.

Regards,

Don

Hello Don.

We have installed unmanaged dlls as you metioned.
NauticalChartsFeatureLayer sample is displayed successfully.
But when drag or scale up and down the map repeatedly, following screen shot is happened.

The result we have searched from event log.

  • Screen shot
    REF : “사용할수 없음” means “can not use”.

Stable operation is enabled, We decide next plan for your product.
Please reply the reason and solution.

Thanks.
Best Regards.

Hi Binary,

Sorry for delay,

This issue is still in progress, any updates I will let you know.

Thanks,
Emil

Hi Binary,

This issue seems caused by the OutOfMemory, and it’s still in progress, but there is 2 workaround for it, you can have a try.

  1. Apply the tile cache to the layer instead of drawing tile on the fly.

    LayerOverlay overlay = new LayerOverlay() { ServerCache = new ServerCache(@“c:\temp\s57”)};

  2. Set TileType property of LayerOverLay to SingleTile.

    LayerOverlay overlay = new LayerOverlay() { TileType = TileType.SingleTile};

Hope it’s helped.

Thanks,
Peter