Click or drag to resize

DataQueryFindNearestPolygons Method (LatLon, String)

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: (in Version:
public static Polygon[] FindNearestPolygons(
	LatLon location,
	string tableName


Type: Telogis.GeoBaseLatLon
Polygon objects nearest to this location will be returned.
Type: SystemString
The name of the table to query. See CustomTable for a list of predefined tables.

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.

See CustomTable for a list of predefined tables.

// 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

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