ThinkGeo.com    |     Blog    |     Wiki    |     Support

GeoTiffRasterLayer crashing when using WrappingMode

I’m trying to use WrappingMode.WrapDateLine with a GeoTiffRasterLayer, but it always crashes with the error:

Exception thrown: 'System.InvalidOperationException' in ThinkGeo.MapSuite.dll

And sometimes:

the input double value is out of range

The geotiff can be downloaded from this link:

https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/raster/NE2_HR_LC_SR_W_DR.zip ~300 mb. It contains a .prj and .tfw file as well;

I threw together a quick app to show the issue:

using System.Windows;
using ThinkGeo.MapSuite;
using ThinkGeo.MapSuite.Drawing;
using ThinkGeo.MapSuite.Layers;
using ThinkGeo.MapSuite.Shapes;
using ThinkGeo.MapSuite.Wpf;

namespace WpfApp2
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            string baseMapPath = @"D:\Downloads\NE2_HR_LC_SR_W_DR\NE2_HR_LC_SR_W_DR.tif";
            var worldOverlay = new LayerOverlay(); //holds the background world/ocean layer
            var worldLayer = new GeoTiffRasterLayer(baseMapPath, @"D:\Downloads\NE2_HR_LC_SR_W_DR\NE2_HR_LC_SR_W_DR.tfw");
            worldOverlay.Layers.Add("worldlayer", worldLayer);
            WpfMap map = new WpfMap();


            map.Overlays.Add(worldOverlay);

            worldOverlay.TransitionEffect = TransitionEffect.Stretch;

            worldLayer.DrawingQuality = DrawingQuality.HighSpeed;
            worldLayer.WrappingMode = WrappingMode.WrapDateline;
            worldLayer.WrappingExtent = worldLayer.GetBoundingBox();
            worldOverlay.TileType = TileType.MultipleTile;
            worldOverlay.RenderMode = RenderMode.GdiPlus;
            worldOverlay.DrawingQuality = DrawingQuality.HighSpeed;
            worldOverlay.WrappingExtent = worldLayer.GetBoundingBox();
            worldOverlay.WrappingMode = WrappingMode.WrapDateline;

            contentc.Content = map;
            map.MapUnit = GeographyUnit.DecimalDegree;
            map.MapResizeMode = MapResizeMode.PreserveScaleAndCenter;
            map.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.LightBlue);
            map.CurrentExtent = worldLayer.GetBoundingBox();
            map.MaximumScale = 99999999;
            map.MapTools.Logo.IsEnabled = false;
        }
    }
}

<Window x:Class="WpfApp2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <ContentControl Name="contentc"></ContentControl>
    </Grid>
</Window>

Hi Dan,

Our developer is downloading this data, but it looks the speed is very slow.

WrappingMode is a little special, I cannot make sure it works well for all data, but I think we will reply you after test and research it.

Regards,

Ethan

Hi Dan,

Our developer download and research the data, it looks our map don’t support this type format, the tag and block offset cannot be parse correct. We think it should be unsupported format for example BigTIFF.

And the strange thing is it looks just the big size tiff is this type, we tried to download smaller tiff file from this page and it render correct.

We won’t add new support for different tiff type for current version, but in our coming ThinkGeo Map version 1 the render logic for tiff will get big changes, many types we don’t supported now should get supported.

Regards,

Ethan

Hi Ethan, thanks for the response. Is there a timeline for the next map version release?

Hi Dan,

I also don’t know the schedule for coming version, please pay attention to our main page or blog, and I think user will receive our email if the new version is release.

Regards,

Ethan