GM_FindNearestFeatures by World Bounds
Mike,
I am using the GM_FindNearestFeatures to find all features for a given world bound. I call GM_FindNearestFeatures with the following parameters:
GM_FindNearestFeatures
( aPixelSearchPt = NULL
, aLayerList = NULL
, aLayerCount = 0
, aFindFlags = 15
, aWorldBounds = myBounds
, aPixelRect = NULL
, aNearestFeatures = pFeaturesFound
, aMaxFeatures = 10
, &totalFound
, aMaxDistPixels = 0);
where myBounds is
myBounds.MaxX = 1502591.69960373
myBounds.MaxY = 168499.379247473
myBounds.MinX = 1502545.99909224
myBounds.MinY = 168452.291824168
My result is as follows:
totalFound = 3
//Result 1
pFeaturesFound[0].mPos.X = 1501891.87878376
pFeaturesFound[0].mPox.Y = 168749.634374269
//Result 2
pFeaturesFound[1].mPos.X = 1502117.00423401
pFeaturesFound[1].mPox.Y = 169010.338020676
//Result 3
pFeaturesFound[2].mPos.X = 1500877.2517545
pFeaturesFound[2].mPox.Y = 205614.817479635
I’m having a hard time understanding the above results. None of the above points reside in my search region. Can you please explain? Am I doing something wrong?
Thanks,
Rebecca
I am using the GM_FindNearestFeatures to find all features for a given world bound. I call GM_FindNearestFeatures with the following parameters:
GM_FindNearestFeatures
( aPixelSearchPt = NULL
, aLayerList = NULL
, aLayerCount = 0
, aFindFlags = 15
, aWorldBounds = myBounds
, aPixelRect = NULL
, aNearestFeatures = pFeaturesFound
, aMaxFeatures = 10
, &totalFound
, aMaxDistPixels = 0);
where myBounds is
myBounds.MaxX = 1502591.69960373
myBounds.MaxY = 168499.379247473
myBounds.MinX = 1502545.99909224
myBounds.MinY = 168452.291824168
My result is as follows:
totalFound = 3
//Result 1
pFeaturesFound[0].mPos.X = 1501891.87878376
pFeaturesFound[0].mPox.Y = 168749.634374269
//Result 2
pFeaturesFound[1].mPos.X = 1502117.00423401
pFeaturesFound[1].mPox.Y = 169010.338020676
//Result 3
pFeaturesFound[2].mPos.X = 1500877.2517545
pFeaturesFound[2].mPox.Y = 205614.817479635
I’m having a hard time understanding the above results. None of the above points reside in my search region. Can you please explain? Am I doing something wrong?
Thanks,
Rebecca
Comments
-
Never mind.
I realized what I was doing wrong right after I did the post.
When getting the point feature (by GM_GetPointFeature), I was assuming that all returned results from GM_FindNearestFeatures would be points, forgetting that I call GM_FindNearestFeatures to search for everything. Therefore when I was calling GM_GetPointFeature when I should have been calling GM_GetLineFeature. After I corrected my mistake, things look as I would have expected.
thanks.
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website