DataQueryQueryPolygonsAtPoint Method (LatLon, String, Double, CancellationToken) |
Namespace: Telogis.GeoBase
public static Polygon[] QueryPolygonsAtPoint( LatLon loc, string tableName, double simplificationLevel, CancellationToken token )
Map features are stored in tables, named according to type. Developers with custom data should avoid using the table names in the list below.
Pre-defined polygon query tables |
---|
all |
countries |
states |
counties |
islands |
cities |
airports |
runways |
cemeteries |
hospitals |
industrial |
major_parks |
state_parks |
parks |
shopping |
sports |
universities |
golf_courses |
native |
military |
buildings |
oceans |
bays |
water |
// // Get the golf course (if one exists) at the given location... // LatLon loc = new LatLon(33.919432,-118.31181); // location in Los Angeles, USA Polygon[] gcs = DataQuery.QueryPolygonsAtPoint(loc, "golf_courses", 1); Console.WriteLine("There is " + gcs.Length + " golf course at the location " + loc.ToString()); CancellationToken token = new CancellationToken(); // // Get all polygons at the given location... // gcs = DataQuery.QueryPolygonsAtPoint(loc, "all", 1, token); Console.WriteLine("There are a total of " + gcs.Length + " polygons at the location " + loc.ToString()); int counter = 1; foreach (Polygon p in gcs) { Console.WriteLine("\t" + (counter++) + ") " + p.Name); }
The above code snippet produces the following output: