Click or drag to resize

DataQueryQueryPolygonsAtPoint 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 that encapsulate the given LatLon. This method can be used to find polygons (such as golf courses, parks, airports, political/geographical entities and bodies of water) at a given location. See example.

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.86.0.0
Syntax
public static Polygon[] QueryPolygonsAtPoint(
	LatLon loc,
	string tableName
)

Parameters

loc
Type: Telogis.GeoBaseLatLon
A LatLon location to query.
tableName
Type: SystemString
The name of the polygon table to query (this specifies the PolygonType to return).

Return Value

Type: Polygon
An array of Polygons matching the specified type.
Remarks

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
Examples
C#
// 
// 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");
Console.WriteLine("There is " + gcs.Length + " golf course at the location " + loc.ToString());

// 
// Get all polygons at the given location...
// 
gcs = DataQuery.QueryPolygonsAtPoint(loc, "all");
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:

There is 1 golf course at the location 33.919432,-118.311809
There are a total of 3 polygons at the location 33.919432,-118.311809
1) Chester L Washington Golf Course
2) Los Angeles
3) California
See Also