Click or drag to resize

StkCityDatabaseQuery Class

A query to be run against a StkCityDatabase.
Inheritance Hierarchy
SystemObject
  AGI.Foundation.StkStkCityDatabaseQuery

Namespace:  AGI.Foundation.Stk
Assembly:  AGI.Foundation.Models (in AGI.Foundation.Models.dll) Version: 24.1.418.0 (24.1.418.0)
Syntax
public class StkCityDatabaseQuery

The StkCityDatabaseQuery type exposes the following members.

Constructors
  NameDescription
Public methodStkCityDatabaseQuery
Initializes a new instance of the StkCityDatabaseQuery class
Top
Properties
  NameDescription
Public propertyCentralBodyName
Gets or sets a regular expression that the CentralBodyName must match in order to be included in the query.
Public propertyCityName
Gets or sets a regular expression that the CityName must match in order to be included in the query.
Public propertyCountryName
Gets or sets a regular expression that the CountryName must match in order to be included in the query.
Public propertyMaximumLatitude
Gets or sets the maximum value of Latitude in radians that is allowed in order for the entry to be included in the query.
Public propertyMaximumLongitude
Gets or sets the maximum value of Longitude in radians that is allowed in order for the entry to be included in the query.
Public propertyMinimumLatitude
Gets or sets the minimum value of Latitude in radians that is allowed in order for the entry to be included in the query.
Public propertyMinimumLongitude
Gets or sets the minimum value of Longitude in radians that is allowed in order for the entry to be included in the query.
Public propertyProvinceName
Gets or sets a regular expression that the ProvinceName must match in order to be included in the query.
Public propertyTypeOfCity
Gets or sets a value that the TypeOfCity must match in order to be included in the query.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodMatches
Determines if an entry matches this query.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples

The following example shows how to query the city database for cities matching certain criteria:

C#
StkCityDatabase db = new StkCityDatabase(dbDirectory, "stkCityDb");

// Create a query object and then populate it with the properties to query on.
// Regular expressions are used to query on strings.
StkCityDatabaseQuery query = new StkCityDatabaseQuery
{
    CityName = new Regex("Philadelphia"),
    // only look in PA, because there's also a New Philadelphia in Ohio
    ProvinceName = new Regex("Pennsylvania"),
};

// Get the database entries matching the query and print out the Longitude and Latitude of each.
foreach (StkCityDatabaseEntry entry in db.GetEntries(query))
{
    Console.WriteLine("{0}: Longitude {1}, Latitude {2}", entry.CityName, entry.Longitude, entry.Latitude);
}
See Also