StkCityDatabase Class |
Namespace: AGI.Foundation.Stk
The StkCityDatabase type exposes the following members.
Name | Description | |
---|---|---|
StkCityDatabase | Initializes a new instance. |
Name | Description | |
---|---|---|
LastUpdateDate |
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.
| |
Version |
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.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetCentralBodies |
Gets the central bodies in the database.
| |
GetCityTypes |
Gets the types of cities in the database.
| |
GetCountries |
Gets the countries in the database.
| |
GetEntries |
Gets all of the entries in the database.
| |
GetEntries(StkCityDatabaseQuery) |
Gets all of the entries in the database matching a specified query.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
CreatePlatforms | Overloaded.
Creates a platform for each city entry in the supplied database.
(Defined by StkCityDatabaseExtensions.) | |
CreatePlatforms(StkCityDatabaseQuery) | Overloaded.
Creates platforms representing the cities in the database that match the input query.
(Defined by StkCityDatabaseExtensions.) |
The following example shows how to query the city database for cities matching certain criteria:
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); }