Click or drag to resize

DataQueryQueryPoi Method (BoundingBox, PoiType, String, CancellationToken)

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Gets all the Points of Interest of a given type that lie underneath the given BoundingBox, with the ability to filter on a POI's name.

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public static Poi[] QueryPoi(
	BoundingBox bbox,
	PoiType[] type,
	string nameSubstring,
	CancellationToken token
)

Parameters

bbox
Type: Telogis.GeoBaseBoundingBox
The area to search.
type
Type: Telogis.GeoBasePoiType
The type of POIs to look for.
nameSubstring
Type: SystemString
The query will only return POI objects that have names containing this substring. If set to null POI objects will not be filtered by name.
token
Type: Telogis.GeoBase.ConcurrencyCancellationToken
A CancellationToken that can be used to cancel the query early, causing a DataQueryCanceledException to be thrown.

Return Value

Type: Poi
An array of Poi objects.
Remarks
To show only a certain type of POI on a map, consider using a PoiRenderer object. A PoiRenderer object will draw only POI objects of a specified type (or types) on a map.
Examples
C#
// This BoundingBox covers NE Los Angeles
BoundingBox bbox = new BoundingBox(new LatLon(34, -117), new LatLon(35, -118));

// This query looks only for POIs with type PetrolStation. The null parameter
// tells GeoBase not to filter on the POI name.
Poi[] pois = DataQuery.QueryPoi(bbox, new PoiType[] { PoiType.PetrolStation }, null);
foreach (Poi poi in pois) {
    Console.WriteLine("Name: " + poi.Name + "\nPhone: " + poi.Phone + "\n");
}
See Also