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
Categories
- 12.5K All Categories
- 5.5K Features Discussion
- 314 Downloading Imagery
- 1.3K Elevation Data
- 377 Georeferencing Imagery Discussion
- 611 GM Script Language
- 50 User Scripts
- 112 GPS Features
- 397 Projection Questions
- 803 Raster Data
- 1.3K Vector Data
- 6.5K Support
- 161 Announcement and News
- 893 Bug Report
- 557 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 542 Other Discussion
- 128 GIS Data Sources
- 26 Global Mapper Showcase
- 229 How I use Global Mapper
- 104 Global Mapper Forum Website