Different behaviour of GM_FindNearestFeatures in 16 and 19 SDK versions
Yann DUPUY Global Mapper UserTrusted User
I upgraded my software to GlobalMapper 19 SDK and a perfectly working piece of code is now broken.
My call to
GM_Error_t32 status = GM_FindNearestFeatures(&pix, layers, visibleLayerCount, GM_FindFlags_FindAll, 0, 0, foundFeatures, maxSearchedFeatures, &featureCount, maxSearchDistPixels);
now returns a #2 error (Parameter error), and not a #0 error None anymore.
Did something change ?
Did I miss something ?
Will somebody read this message and help me ?
I tried to replicate your error but mine worked just fine.
I would suggest you to make sure that aFoundFeatureCnt, aPixelSearchPt, aNearestFeatures are not null and aMaxFeatures should be a non-zero value. Please let us know if you still face issues with this.
Hi Mithra,Thanks for the reply.The strange thing is that just by changing the GlobalMapper DLL (I have proper license) the code does not work anymore!In my call,GM_Error_t32 status = GM_FindNearestFeatures(&pix, layers, visibleLayerCount, GM_FindFlags_FindAll, 0, 0, foundFeatures, maxSearchedFeatures, &featureCount, maxSearchDistPixels);pix are the coordinates of my point (and they seem correct)layers is an array of two layer handlesvisibleLayerCount=2foundFeatures is an allocated pointer to maxSearchedFeatures(=10) GM_FoundFeatures_tmaxSearchFeatures=10featureCount is an uint32 (uninitiliazed but I should not have to)maxSearchDistPixels =10I can't see anything wrong!Regards,Yann
For the record, I think I found my problem.It seems that for any reason (a change in handling the pixel aspect ratio in the view ?) I need to specify both world and pixel bounds.I don't really have time to search deeper into this, but this allowed me to have my piece of software compatible with GM19 SDK (now that 20 is out!)...Yann
- 12.4K All Categories
- 5.4K Features Discussion
- 314 Downloading Imagery
- 1.3K Elevation Data
- 377 Georeferencing Imagery Discussion
- 603 GM Script Language
- 49 User Scripts
- 112 GPS Features
- 394 Projection Questions
- 800 Raster Data
- 1.3K Vector Data
- 6.5K Support
- 161 Announcement and News
- 890 Bug Report
- 556 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 537 Other Discussion
- 128 GIS Data Sources
- 26 Global Mapper Showcase
- 224 How I use Global Mapper
- 104 Global Mapper Forum Website