Click or drag to resize

DataQueryFindNearestLines Method (LatLon, String)

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Finds the nearest Line (such as a stream or railway line) 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 Line[] FindNearestLines(
	LatLon location,
	string tableName
)

Parameters

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

Return Value

Type: Line
The nearest Lines. There may be more than one if the query point touches one or more Line objects. An empty array is returned if there are no results.
Remarks
Map features are stored in named tables. See QueryLines(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

Line canal = DataQuery.FindNearestLines(myLoc, "canals")[0];
// ^^ get the nearest canal

...

// if we have a map, we can center it on the midpoint of the canal...
int idx = canal.Points.Length / 2;
myMap.Center(canal.Points[idx]);
See Also