Click or drag to resize

DataQueryFindNearestPoints Method (LatLon, String)

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Finds the nearest PointFeature (usually a city) to the location given, in the specified table. See CustomTable for a list of predefined tables.

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public static PointFeature[] FindNearestPoints(
	LatLon location,
	string tableName
)

Parameters

location
Type: Telogis.GeoBaseLatLon
The location to query.
tableName
Type: SystemString
The point table to query. See CustomTable for a list of predefined tables.

Return Value

Type: PointFeature
The nearest PointFeatures. There may be more than one if the query point touches one or more points. An empty array is returned if there are no results.
Remarks
Map features are stored in named tables. See QueryPoints(BoundingBox, String)
Examples
C#
// 
// This example will use a GPS unit to find the current location,
// and then perform a DataQuery to find the nearest canal 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

PointFeature mCity = DataQuery.FindNearestPoints(myLoc, "major_cities")[0];
// ^^ get the nearest major city to our current location

...

// if we have a map, we can center it on the city
myMap.Center(mCity.Point);
See Also