ThinkGeo.com    |     Documentation    |     Premium Support

Is There any Example of using GDAL Csharp on Mapsuite

Hi,

I try using the Gdal CSharp to on mapsuite. So that it can just retrieve the elevation data from Dted file. It still need the Fdo extension to using GDAL Csharp library?

Regards,

Fathin

Hi Fathin,

MapSuite don’t support GDAL Csharp in currently version, maybe we will support it in future versions, we have a plan to research it and see how to integrate it.

For now please use GDAL via Fdo extension.

Regards,

Ethan

Hi Ethan,

I though it is possible to make a conversion for the dted data using gdal C# so that the mapsuite can get the elevation data to display on map.Fdo extension using C++ right? How to setup Fdo extension? Do you have any latest example using Fdo extesion?

Regards,

Fathin

Hi Fathin,

Here is the data format we supported: http://wiki.thinkgeo.com/wiki/map_suite_data_format_guide

You can see the GDAL layer is mainly work for raster layer, so the package should be https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.FdoRaster/11.0.0-beta008

We don’t have a sample for it, because it looks the GdalRasterLayer don’t need set some special property, you can just instantiates it and then add it to layer overlay.

Regards,

Ethan

Hi Ethan,

I already add reference from the nuget link you share. But when typing GdalRasterLayer the compiler can’t recognize it. It is use the nuget or it have other reference?

Thank you and best regards,

Fathin

Hi Fathin,

I ignore the other package, you can directly add reference to this package: https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.Gdal/11.0.0-beta007

It will add the reference to the fdoraster I mentioned before.

Wish that’s helpful.

Regards,

Ethan

Hi Ethan

I try to read the Dted file but it seem it can’t display it. It just display a tiny black dot.
Did you have any suggestion or idea on how the mapsuite can read the Dted file or other way to make the conversion so that the raster map from mapsuite will generate the lat long then it align with the lat long from Dted to get the point elevation.

private void map_Loaded(object sender, RoutedEventArgs e)
{
    
    wpfMap.MapUnit = GeographyUnit.Meter;
    LayerOverlay myOverlay = new LayerOverlay();
    wpfMap.Overlays.Add(myOverlay);
    myOverlay.Open();

    //C:\Users\User\Desktop\DSI REFERENCE\Map Data\Raster
    GdalRasterLayer fdoRaster = new GdalRasterLayer(@"C:\Users\User\Desktop\DSI REFERENCE\Map Data\Elevation\DTED PEKAN\dted\E103\N03.dt2");

        myOverlay.Layers.Add(fdoRaster);

        wpfMap.CurrentExtent = myOverlay.GetBoundingBox();
    
        wpfMap.Refresh();
    
}

private void mouse_Move(object sender, MouseEventArgs e)
{
    Point point = e.MouseDevice.GetPosition(wpfMap);

    ScreenPointF screenPointF = new ScreenPointF((float)point.X, (float)point.Y);
    PointShape pointShape = ExtentHelper.ToWorldCoordinate(wpfMap.CurrentExtent, screenPointF, (float)wpfMap.ActualWidth, (float)wpfMap.ActualHeight);


    string x = pointShape.X.ToString("f6", CultureInfo.InvariantCulture);
    string y = pointShape.Y.ToString("f6", CultureInfo.InvariantCulture);

    
        //PointShape p = new PointShape(605770.08015, 388756.038425);
       

    textBoxSatu.Text ="Long: " + x + " Lat: " + y;
}

}

Hi Fathin,

Here is a sample with our sample data, it looks we render the DTED correct.

Please try the sample as below.

And I think your problem should because the wpfMap.MapUnit need to be set to DecimalDegree.

9358.zip (753.3 KB)

Regards,

Ethan

Hi Ethan,

Is there a way that i can retrieve the elevation data from the Dted file? Can it layer with raster map?

Thank you and best regards

Hi Fathin,

I tried to find a solution for this target but failed.

It looks we don’t have a solution to get elevation data from DTED file.

But we have a GPX layer which can get elevation data, if you can find a way to convert DTED to GPX, the map should can read it.

If you think we need to enhancement for DTED, you should want to vote for it here: http://helpdesk.thinkgeo.com/EnhancementTracker

Regards,

Ethan

Hi Ethan,

Did i need to post new enhancement topic? I can only vote just once?

Thank you and best regards

Hi Fathin,

You don’t need to create new topic. The vote pages is a standalone system, if a new feature or enhancement is found important for our users, the development team will add it to the develop plan in future.

If this feature is important for you and it’s high priority for you, please try to contact your sales for professional service.

Regards,

Ethan