Searchinfo and searchinfofactory – Pitney Bowes MapXtreme User Manual
Page 189

Chapter 8: Working with Data
Features and Feature Collections
MapXtreme v7.1
196
Developer Guide
' Set the map view to show search results
MapInfo.Engine.Session.Current.MapFactory(0).SetView(fc.Envelope)
' Set the view of the first map.
' Add results to selection.
MapInfo.Engine.Session.Current.Selections.DefaultSelection.Add(fc)
End Sub
SearchInfo and SearchInfoFactory
The MapInfo.Data.SearchInfo class defines the query used in a search and handles any necessary
post processing of the search results.
The SearchInfoFactory creates SearchInfo objects. SearchInfoFactory contains a number of search
methods that allow you to search using spatial references to your search location or by using
geometries that are drawn on the screen.
The following table describes the SearchInfoFactory search methods.
SearchInfoFactory
Methods
Behavior
SearchAll
Returns all the rows.
SearchNearest
Returns the rows with table geometries that are closest to the given
search point.
SearchWhere
Returns the rows specified by the given where Clause.
SearchWithinDistance
Returns the rows where the table geometry is contained within a
distance of the search point, rectangle or geometry. This method
uses the Geometry.Distance method to determine if an object is in
or out the search area. Previously SearchWithinDistance had
buffered the distance and searched within the buffer, leading to less
accurate results.
SearchWithinFeature
Returns the rows where the table geometry is contained within the
search features's geometry.
SearchWithinGeometry
Returns the rows where the table geometry is contained within the
search geometry.
SearchWithinRect
Returns the rows where the table geometry intersects the given
rectangle.
SearchIntersectsFeature
Returns the rows where the table geometry intersects with the
search features's geometry.