Invalid Layer error for GM_ExportElevation
Mike,
I'm having a problem using an older command line code which uses the SDK to output some elevation grids to match an input polygon shapefile. I've used this code for a while and it has worked fine, but I have not used it in the last year until now. The program reads in elevation layers (my current test case has it reading four FLOATGRID layers) and a single polygon shapefile. When I call GM_ExportElevation I get error number 1, GM_ErrorInvalidLayer returned. It works fine if in place of NULL for the layer list I give it any of the four terrain layers. I have checked the GM_LayerInfo for all of the terrain layers and the vector layer immediately before the call and the layer info for all looks good.
I'm not sure if it has anything to do with it, but this is the first time I've used it since the SDK changeover in the winter-spring of this year. The program is currently working with the Aug 9, 2012 build of the 13.13 version. I would appreciate any help or at least knowing why the InvalidLayer error is returned.
Thanks,
David
I'm having a problem using an older command line code which uses the SDK to output some elevation grids to match an input polygon shapefile. I've used this code for a while and it has worked fine, but I have not used it in the last year until now. The program reads in elevation layers (my current test case has it reading four FLOATGRID layers) and a single polygon shapefile. When I call GM_ExportElevation I get error number 1, GM_ErrorInvalidLayer returned. It works fine if in place of NULL for the layer list I give it any of the four terrain layers. I have checked the GM_LayerInfo for all of the terrain layers and the vector layer immediately before the call and the layer info for all looks good.
I'm not sure if it has anything to do with it, but this is the first time I've used it since the SDK changeover in the winter-spring of this year. The program is currently working with the Aug 9, 2012 build of the 13.13 version. I would appreciate any help or at least knowing why the InvalidLayer error is returned.
Thanks,
David
Comments
-
David,
What language are you calling the SDK from? Are you using GM_ExportElevation (which takes a single layer) or GM_ExportElevationEx which allows you to pass in a list of layers?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Mike,
I'm using C++ and calling the regular GM_ExportElevation function but using NULL for the layer. My documentation says (and it has been working) that using NULL in place of the layer handle allows you to export from all layers. Is that not the way it works now?
Thanks for your help.
David -
David,
That's how it's supposed to work but I took a look and found a bug with the call if you provide NULL (internally it just calls GM_ExportElevationEx and that call was wrong). Try instead calling GM_ExportElevationEx and pass in NULL there with 0 for the layer count and NULL for the extra flags and that should work.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Thanks, Mike. Using GM_ExportElevationEx works fine.
David
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 345 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 637 GM Script Language
- 54 User Scripts
- 114 GPS Features
- 417 Projection Questions
- 826 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 178 Announcement and News
- 913 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 569 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 238 How I use Global Mapper
- 107 Global Mapper Forum Website