From GXT to Raster/Grid

profnimrodprofnimrod Global Mapper UserPosts: 2
edited February 2013 in Vector Data
Hi Forum

I'm just trying out the C# SDK to see if it has what I need. What I am trying to do is take a GXT file containing satellite EIRP data, and convert it to a Grid/Raster array of some kind with interpolation (which I will then re-contour with different levels).

So far I have imported the GXT and created an array that contains the contours contained in the file.

To be honest I haven't the fainest idea of how to now proceed. I'm pretty sure my custom format doesn't fit whatever is needed for me to convert to raster using the GeoCore SDK. So please any tips or code snippets on how to do this would be gratefully received.

Also, I'd like to be able to take grid data and generate an array of closed contours. I have already written a method to do this in c# and it works just fine, but I'm hoping GeoCore will contain a similar method that will run much faster than my method that was thrown together in a few days.

Kind regards, Kurt

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2013
    Kurt,

    Are you using the Global Mapper SDK or the GeoCore SDK (a different Blue Marble product)? Assuming you are using the Global Mapper SDK and you have a layer with your contour lines in it, you can use the GM_GenerateElevationGrid function to create an elevation grid from the contour layer. You can then export that to any raster format using GM_ExportRaster or a gridded elevation file (like a DEM) using GM_ExportElevation.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
  • profnimrodprofnimrod Global Mapper User Posts: 2
    edited February 2013
    Thanks Mike

    I am indeed using the Global Mapper SDK as you assumed. How do I create "a layer with your contour lines in it"? Bear in mind I'm not using any for the UI features, this is to all be in code only.

    Glad to hear that once I achieve this first 'import' step, it looks like just what I need is available via GM_GenerateElevationGrid and GM_ExportRaster.

    Kind regards, Kurt
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2013
    Kurt,

    It sounds like you already have your contour lines decoded somehow into a memory structure, so to turn those into a SDK layer use the GM_CreateCustomVectorLayer function to create a new layer, then GM_AddLineToVectorLayer to add the lines to the new layer. Make sure to add an ELEVATION attribute to each line with the contour height.

    Once you have that layer you can then grid it and export.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
Sign In or Register to comment.