# Encountering issue with nautical charts layer

**URL:** <https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481>\
**Category:** WPF\
**Created:** [March 22, 2019, 10:38am UTC](https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481 "2019-03-22T10:38:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kev\_French](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kev_french/32/24951_2.png) [@Kev\_French](https://community.thinkgeo.com/u/Kev_French)\
**Post date:** [March 22, 2019, 10:38am UTC](https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481/1 "2019-03-22T10:38:45Z")

</div>

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;

```auto
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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [March 25, 2019, 12:23am UTC](https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481/2 "2019-03-25T00:23:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kev\_French](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kev_french/32/24951_2.png) [@Kev\_French](https://community.thinkgeo.com/u/Kev_French)\
**Post date:** [March 25, 2019, 9:40am UTC](https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481/3 "2019-03-25T09:40:56Z")

</div>

Hi Ethan,

Thanks for responding. As I mentioned I’m using your [NauticalChartsViewerSample-ForWpf](https://github.com/ThinkGeo/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](https://www.charts.noaa.gov/ENCs/ENCs.shtml), I’ve attached a couple of the files I’ve been using.

[US5NY1DM.zip](https://community.thinkgeo.com/uploads/default/original/3X/d/6/d609cea9054c992f2d178d9464c47c6f5322cb25.zip) (474.5 KB)  
[US3FL28M.zip](https://community.thinkgeo.com/uploads/default/original/3X/e/b/ebf03f66c641429a03f5c0684f356e4ed9815e3c.zip) (687.1 KB)

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

Cheers  
Kev

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [March 26, 2019, 8:19am UTC](https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481/4 "2019-03-26T08:19:01Z")

</div>

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](https://map.MapUnit) = GeographyUnit.Meter;  
[//map.ZoomLevelSet](https://map.ZoomLevelSet) = ThinkGeoCloudMapsOverlay.GetZoomLevelSet();  
//ThinkGeoCloudMapsOverlay baseOverlay = new ThinkGeoCloudMapsOverlay();  
[//map.Overlays.Add](https://map.Overlays.Add)(ThinkGeoCloudMapsOverlayName, baseOverlay);

2. Comment the projection line  
Go into function HandleLoadChartMessage and comment the projection:  
[//layer.FeatureSource.Projection](https://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](https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.NauticalCharts/11.0.0-beta008)

Please let us know if it works.

Regards,

Ethan

---

<div class="post-metadata">

**Author:** ![Kev\_French](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kev_french/32/24951_2.png) [@Kev\_French](https://community.thinkgeo.com/u/Kev_French)\
**Post date:** [March 26, 2019, 9:13am UTC](https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481/5 "2019-03-26T09:13:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [March 27, 2019, 6:54am UTC](https://community.thinkgeo.com/t/encountering-issue-with-nautical-charts-layer/9481/6 "2019-03-27T06:54:08Z")

</div>

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
