Click or drag to resize

Data Query Concept

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release

Using the DataQuery class users are able to identify spatial features that lie within a given area (defined by a BoundingBox) or that are near a specific point (defined by a LatLon). Data queries can return information about the following spatial data types:

  • Polygons (many-sided features such as lakes, airports or golf courses). Polygons are represented by Polygon objects, which have a number of different PolygonTypes.
  • Points of interest (such as restaurants, gas stations or hospitals). Points of interest are represented by Poi objects, which have a number of different PoiTypes. Poi objects provide detailed information about a point of interest such as restaurant types or telephone numbers.
  • Streets. These are represented by Street objects, which have a number of different StreetTypes. Each street is made up of one or more StreetLink objects, each of which represent a portion of the street between two choice points or points where a feature of the street changes (such as a different post code.) Street Links provide information about street sections such as post codes, speed limits, tolls, the existence of traffic signals, and so on.
  • Multi-lines (non-street features which are drawn as several lines on a map; such as rivers, political borders or railway lines). Multi-lines are represented by MultiLine objects, which are made up of Line objects.
  • Lines (portions of a multi-line feature or non-street features that are drawn as a single line on a map). Lines are represented by Line objects.
  • Point features (a map feature that is represented by a point; typically a city or town). Point features are represented by PointFeature objects.
Tip Tip

It is possible to define your own spatial data type using the CustomTable and CustomColumn classes.

Tutorial

DataQuery Tutorial

Create a simple application that explores the different types of available queries.

Detailed Explanation

Each data type has its own methods, which can be used to perform spatial queries. For example, to find polygons you could use one of the following methods: FindNearestPolygons(LatLon, String), QueryPolygons(BoundingBox, String), QueryPolygonsAtPoint(LatLon, String).

In some cases it is possible to request that only features of a given type be returned. For example: The user could use the mouse to specify an area on a map, and then use the DataQuery class to request all the freeways inside that area by passing the appropriate StreetType to the query method.

The following code snippet demonstrates how a data query can be used to obtain meta information about a given location. A similar procedure is used by some performance car manufacturers to deactivate speed limiters when the vehicle's current location is at a "race_track" or "circuit" polygon.

C#
// This is the location (in Los Angeles, USA) that we'll use for the data query
LatLon loc = new LatLon(33.919432,-118.31181); 

// Get all polygons at the given location...
Polygon[] polys = DataQuery.QueryPolygonsAtPoint(loc, "all");

Console.WriteLine("There are a total of " + polys.Length + " polygons at the location " + loc.ToString());
int counter = 1;
foreach (Polygon p in polys) { Console.WriteLine("\t" + (counter++) + ") " + p.Name); }
// Output: 
// 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
Related Classes

See the Predefined Query Tables topic for information on the predefined columns which can be queried for various feature types.

Further Information
Next Topic