Click or drag to resize

StkCityDatabase Class

Provides access to an STK city database.
Inheritance Hierarchy
SystemObject
  AGI.Foundation.StkStkCityDatabase

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

The StkCityDatabase type exposes the following members.

Constructors
  NameDescription
Public methodStkCityDatabase
Initializes a new instance.
Top
Properties
  NameDescription
Public propertyLastUpdateDate
Gets the last update date reported in the Generic Database (.gd) file, or MinValue if the file does not exist or does not contain a LastUpdate field.
Public propertyVersion
Gets the version number reported in the Generic Database (.gd) file, or "Unknown" if the file does not exist or does not contain a Version field.
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 methodGetCentralBodies
Gets the central bodies in the database.
Public methodGetCityTypes
Gets the types of cities in the database.
Public methodGetCountries
Gets the countries in the database.
Public methodGetEntries
Gets all of the entries in the database.
Public methodGetEntries(StkCityDatabaseQuery)
Gets all of the entries in the database matching a specified query.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
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
Extension Methods
  NameDescription
Public Extension MethodCreatePlatformsOverloaded.
Creates a platform for each city entry in the supplied database.
(Defined by StkCityDatabaseExtensions.)
Public Extension MethodCreatePlatforms(StkCityDatabaseQuery)Overloaded.
Creates platforms representing the cities in the database that match the input query.
(Defined by StkCityDatabaseExtensions.)
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