Click or drag to resize

DataQueryFindNearestPolygons Method (LatLon, String, Double, CancellationToken)

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Gets an array of Polygon objects from a given table that are near the given location. Polygons are used to represent features such as lakes, golf courses, parking lots and forests.

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public static Polygon[] FindNearestPolygons(
	LatLon location,
	string tableName,
	double simplificationLevel,
	CancellationToken token
)

Parameters

location
Type: Telogis.GeoBaseLatLon
Polygon objects nearest to this location will be returned.
tableName
Type: SystemString
The name of the table to query. See CustomTable for a list of predefined tables.
simplificationLevel
Type: SystemDouble
Level used to simplify results, given as meters per pixel.
token
Type: Telogis.GeoBase.ConcurrencyCancellationToken
A CancellationToken that can be used to cancel the query, causing a DataQueryCanceledException to be thrown.

Return Value

Type: Polygon
The nearest Polygons. There may be more than one if the query point touches one or more Polygon objects. An empty array is returned if there are no results.
Remarks

See CustomTable for a list of predefined tables.

Examples
C#
// 
// This example will use a GPS unit to find the current location,
// and then perform a DataQuery to find the nearest hospital to our
// current location...
// 

SerialPort myPort = new SerialPort(); // create the GPS's serial port
myPort.PortName = "COM1"; // configure the serial port
myPort.BaudRate = 9600;

IGps myGps = new NMEAGps(myPort); // create GPS unit
myGps.PowerUp(); // power up the GPS, ready for use

LatLon myLoc = myGps.Position.location; // get the current location

CancellationToken token = new CancellationToken();

// then get the nearest hospital, as a polygon...
Polygon hospital = DataQuery.FindNearestPolygons(myLoc, "hospitals", 5, token)[0];
See Also