ThinkGeo.com    |     Documentation    |     Premium Support

Encountering issue with nautical charts layer

Hi

I’m currently evaluating your toolkit, but have run into an issue; when I have a NauticalChart layer in the map I get an exception whenever I zoom beyond a certain level;

The decimal degree longitude value you provided was out of range.
Parameter name: fromPoint.X

Assuming I was doing something wrong, I fired up your NauticalChartViewer sample from Github
and it does exactly the same thing. I’ve tried with the latest 10.x and the 11.x beta packages but
still it happens.

Any help would be appreciated

Hi Kev,

Welcome to ThinkGeo community.

From your exception, I think the problem is your data is meter but you set the map unit equal decimal degree, please double check that.

If you still cannot solve it after check this point, a sample with test data is helpful, so our developer can look into it and see whether it’s your code problem or it’s a bug.

Regards,

Ethan

Hi Ethan,

Thanks for responding. As I mentioned I’m using your NauticalChartsViewerSample-ForWpf from Github (which has the mapunit set to meters). Since I based my code on it in the first place and it has exactly the same issue I think that’s the best sample to use.

I’ve been trying to load ENC files from the NOAA website, I’ve attached a couple of the files I’ve been using.

US5NY1DM.zip (474.5 KB)
US3FL28M.zip (687.1 KB)

Loading either of these into the sample and then zooming in triggers the issue.

Cheers
Kev

Hi Kev,

The mainly problem is from our sample.

Your data is decimal degree, but our sample reproject it to meter. You can make it works follow this simple change:

  1. Open MainViewModel.cs, remove base map “baseOverlay”(It’s meter), and set map unit to decimal degree:
    map.MapUnit = GeographyUnit.DecimalDegree;
    //map.MapUnit = GeographyUnit.Meter;
    //map.ZoomLevelSet = ThinkGeoCloudMapsOverlay.GetZoomLevelSet();
    //ThinkGeoCloudMapsOverlay baseOverlay = new ThinkGeoCloudMapsOverlay();
    //map.Overlays.Add(ThinkGeoCloudMapsOverlayName, baseOverlay);

  2. Comment the projection line
    Go into function HandleLoadChartMessage and comment the projection:
    //layer.FeatureSource.Projection = new Proj4Projection(4326, 3857);

And if you want to make it works for meter, you can just get the latest version of the sample and get the latest package when it get updated in Nuget: https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.NauticalCharts/11.0.0-beta008

Please let us know if it works.

Regards,

Ethan

Thanks Ethan, that worked.

Am I correct in assuming that adding maps with different “base” units is generally supported, providing they’re projected correctly into whatever unit MapUnit is set to?

Cheers

Kev

Hi Kev,

Yes you can reproject them into the same projection(any projection which is supported by map is OK), and then render them into the same map.

But please notice, any reproject operate cannot avoid loss of accuracy.

So if you need to make each layer match the best, find the same projection data source is the best choice. And generally the user wish convert data into 3857 because most base map include Google and Bing is using this projection.

Regards,

Ethan