Different behaviour of GM_FindNearestFeatures in 16 and 19 SDK versions

Yann DUPUY
Global Mapper UserTrusted User
in SDK
Hi,
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 ?
Thanks,
Yann
Comments
-
Hello Yann,
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.
Regards,
Mithra -
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
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 639 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 417 Projection Questions
- 829 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 179 Announcement and News
- 922 Bug Report
- 559 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 573 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 241 How I use Global Mapper
- 108 Global Mapper Forum Website