DataQueryFindNearestLines Method (LatLon, String) |
Namespace: Telogis.GeoBase
// // 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]);