GM_CalcAreaElevStats
Hello,
I try to find statistics for an area, what I try mainly is to find the min and max elevations within the area.
This is ho I tried to do it:
GM_AreaElevStats_t* elevStats = NULL;
_theError = GM_CalcAreaElevStats(_theLayerHandleList, 0, elevStats, gmAreaPoints, areaPoints.size(), 0.0, 0.0, NULL);
The problem is that it gives me an gm_error code 2, which means invalid paramater.
I have tried also the simple layer instead of the layer list and also I have tried that the points that are in the area be in native projection and in another try they were in geographic projection. I keep getting error 2 invalid parameter and I don't know what is not right in the parameters list.
Thank you,
Dana
I try to find statistics for an area, what I try mainly is to find the min and max elevations within the area.
This is ho I tried to do it:
GM_AreaElevStats_t* elevStats = NULL;
_theError = GM_CalcAreaElevStats(_theLayerHandleList, 0, elevStats, gmAreaPoints, areaPoints.size(), 0.0, 0.0, NULL);
The problem is that it gives me an gm_error code 2, which means invalid paramater.
I have tried also the simple layer instead of the layer list and also I have tried that the points that are in the area be in native projection and in another try they were in geographic projection. I keep getting error 2 invalid parameter and I don't know what is not right in the parameters list.
Thank you,
Dana
Comments
-
Dana,
You are passing in the statistics buffer incorrectly. You need to allocate it on the stack (or somewhere) and pass in the address of it. You are just passing in a NULL pointer now. Try the following:
GM_AreaElevStats_t elevStats;
memset( &elevStats, 0, sizeof elevStats );
_theError = GM_CalcAreaElevStat( NULL, 0, &elevStats, gmAreaPoints, areaPoints.size(), 0.0, 0.0, NULL);
I would also be interested in what the gmAreaPoints and areaPoints refer to, but I'll assume those are ok for now.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website