MapPoint Forums

MapForums

Community of MapPoint and Bing Maps Users and Developers




Queryshape not returning all records

This is a discussion on Queryshape not returning all records within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have drawn squares over a map and am using them to query the number of datapoints and draw a ...


Go Back   MapPoint Forums > Map Forums > MapPoint Desktop Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-27-2008
NickH
Yellow Belt
 
Join Date: Jun 2008
Location: Bromsgrove, UK
Posts: 21
Queryshape not returning all records

I have drawn squares over a map and am using them to query the number of datapoints and draw a route using those points. I have saved the file and re-use it.
I have noticed that some datapoints near the left hand edge of the square are not selected as being within the square although visually, they clearly are (by 1/4 mile or so) . If I move the shape fractionally and then move it back to where it was and then query the shape again the datapoints ARE found to be within the shape.
Can anyone explain this?
Mappoint 2004 Europe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-07-2008
NickH
Yellow Belt
 
Join Date: Jun 2008
Location: Bromsgrove, UK
Posts: 21
Re: Queryshape not returning all records

Further investigation shows that the problem is more complicated. It is not just near one border. The area that queryshape is looking at does not exactly match the shape. Sometimes it will return pushpins that are apparently outside the shape as well as sometimes missing those that appear to be within the shape.

The shape moving may be a red herring as this does not always change the results that queryshape returns.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-08-2008
NickH
Yellow Belt
 
Join Date: Jun 2008
Location: Bromsgrove, UK
Posts: 21
Re: Queryshape not returning all records

I can confirm that moving a shape does cause the number of records returned by QueryShape to change (and become correct). Here are the key code snippets
objShape.Select()
objRecords = objDataSet.QueryShape(objShape)
lngTotalRecs = 0
objRecords.MoveFirst()
Do While Not objRecords.EOF
lngTotalRecs += 1
objRecords.MoveNext()
Loop
MsgBox("Number of records in shape: " & lngTotalRecs) ' Get e.g. 69 here
' Then I execute this code
SavedLoc = objShape.Location
objShape.Location = Mp.GetLocation(90, 0)
objShape.Location = SavedLoc
and re-run the above
objShape.Select()
objRecords = objDataSet.QueryShape(objShape)
lngTotalRecs = 0
objRecords.MoveFirst()
Do While Not objRecords.EOF
lngTotalRecs += 1
objRecords.MoveNext()
Loop
MsgBox("Number of records in shape: " & lngTotalRecs) ' Get e.g now 74
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
queryshape, records, returning


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
QueryShape or QueryPolygon NOT IN tfmiltz MapPoint Desktop Discussion 1 01-31-2008 08:03 AM
QueryShape recordset returning empty tfmiltz MapPoint Desktop Discussion 7 01-31-2008 06:38 AM
Unmatched Records pop-up: Sort potential records jempie MapPoint Desktop Discussion 0 10-12-2006 06:07 AM
problems with queryshape chas MapPoint Desktop Discussion 1 09-08-2006 01:52 PM
QueryShape problem Please help Anonymous MapPoint Desktop Discussion 2 03-13-2003 08:57 AM


All times are GMT -5. The time now is 03:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.0 RC3
MP2K Magazine
Visitor Map



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70