Skip to content

DiGi.GIS.PostgreSQL.Classes

Jakub Ziolkowski edited this page Oct 14, 2026 · 8 revisions

DiGi.GIS.PostgreSQL.Classes Namespace

Classes

AdministrativeAreal2D Class

Represents a 2D administrative area within the Polish territorial division hierarchy (country, voivodeship, county, municipality).

An instance is one polygon part of a unit, not the whole unit. BDOT10k stores a unit whose territory is disconnected as several features, and each becomes its own instance, so a multi-part county yields several instances sharing a Code - each with its own Id and its own private country/voivodeship ancestor chain. Treat Id as the identity and Code as descriptive; see AdministrativeAreal2DPostgreSQLConverter for the full storage model.

public class AdministrativeAreal2D : DiGi.GIS.PostgreSQL.Classes.Areal2D<DiGi.GIS.Classes.AdministrativeAreal2D>

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.GIS.PostgreSQL.Classes.TableSerializableObject<DiGi.GIS.Classes.AdministrativeAreal2D> → DiGi.GIS.PostgreSQL.Classes.ReferencedObject<DiGi.GIS.Classes.AdministrativeAreal2D> → DiGi.GIS.PostgreSQL.Classes.Areal2D<DiGi.GIS.Classes.AdministrativeAreal2D> → AdministrativeAreal2D

Constructors

AdministrativeAreal2D() Constructor

Initializes a new instance of the AdministrativeAreal2D class.

public AdministrativeAreal2D();

AdministrativeAreal2D(AdministrativeAreal2D) Constructor

Initializes a new instance of the AdministrativeAreal2D class by copying data from another AdministrativeAreal2D instance.

public AdministrativeAreal2D(DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D? administrativeAreal2D);

Parameters

administrativeAreal2D AdministrativeAreal2D

The AdministrativeAreal2D instance to copy data from.

AdministrativeAreal2D(JsonObject) Constructor

Initializes a new instance of the AdministrativeAreal2D class from a JsonObject.

public AdministrativeAreal2D(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Properties

AdministrativeAreal2D.AdministrativeArealType Property

Gets or sets the type of the administrative area (e.g., country, voivodeship, county, municipality).

public DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType AdministrativeArealType { get; set; }

Property Value

AdministrativeArealType

AdministrativeAreal2D.CountryId Property

Gets or sets the ID of the country.

public System.Nullable<int> CountryId { get; set; }

Property Value

System.Nullable<System.Int32>

AdministrativeAreal2D.CountyId Property

Gets or sets the ID of the county.

public System.Nullable<int> CountyId { get; set; }

Property Value

System.Nullable<System.Int32>

AdministrativeAreal2D.Id Property

Gets or sets the ID of the administrative area.

public int Id { get; set; }

Property Value

System.Int32

AdministrativeAreal2D.MunicipalityId Property

Gets or sets the ID of the municipality.

public System.Nullable<int> MunicipalityId { get; set; }

Property Value

System.Nullable<System.Int32>

AdministrativeAreal2D.Name Property

Gets or sets the name of the administrative area.

public string? Name { get; set; }

Property Value

System.String

AdministrativeAreal2D.VoivodeshipId Property

Gets or sets the ID of the voivodeship.

public System.Nullable<int> VoivodeshipId { get; set; }

Property Value

System.Nullable<System.Int32>

AdministrativeAreal2DOccupancyData Class

Represents occupancy data for a 2D administrative area.

public class AdministrativeAreal2DOccupancyData : DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencedObject<DiGi.GIS.Interfaces.IOccupancyData>

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.GIS.PostgreSQL.Classes.TableSerializableObject<DiGi.GIS.Interfaces.IOccupancyData> → DiGi.GIS.PostgreSQL.Classes.ReferencedObject<DiGi.GIS.Interfaces.IOccupancyData> → DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencedObject<DiGi.GIS.Interfaces.IOccupancyData> → AdministrativeAreal2DOccupancyData

Constructors

AdministrativeAreal2DOccupancyData() Constructor

Initializes a new instance of the AdministrativeAreal2DOccupancyData class.

public AdministrativeAreal2DOccupancyData();

AdministrativeAreal2DOccupancyData(AdministrativeAreal2DOccupancyData) Constructor

Initializes a new instance of the AdministrativeAreal2DOccupancyData class by copying data from another AdministrativeAreal2DOccupancyData instance.

public AdministrativeAreal2DOccupancyData(DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DOccupancyData? administrativeAreal2DOccupancyData);

Parameters

administrativeAreal2DOccupancyData AdministrativeAreal2DOccupancyData

The AdministrativeAreal2DOccupancyData instance to copy data from.

AdministrativeAreal2DOccupancyData(JsonObject) Constructor

Initializes a new instance of the AdministrativeAreal2DOccupancyData class from a JsonObject.

public AdministrativeAreal2DOccupancyData(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

AdministrativeAreal2DOccupancyDataPostgreSQLConverter Class

Converter for administrative areal 2D occupancy data used in PostgreSQL database operations.

public class AdministrativeAreal2DOccupancyDataPostgreSQLConverter : DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencedObjectPostgreSQLConverter<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DOccupancyData, DiGi.GIS.Interfaces.IOccupancyData>

Inheritance System.Object → DiGi.PostgreSQL.Classes.PostgreSQLConverter<AdministrativeAreal2DOccupancyData> → DiGi.GIS.PostgreSQL.Classes.ReferencedObjectPostgreSQLConverter<AdministrativeAreal2DOccupancyData,DiGi.GIS.Interfaces.IOccupancyData> → DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencedObjectPostgreSQLConverter<AdministrativeAreal2DOccupancyData,DiGi.GIS.Interfaces.IOccupancyData> → AdministrativeAreal2DOccupancyDataPostgreSQLConverter

Constructors

AdministrativeAreal2DOccupancyDataPostgreSQLConverter(ConnectionData) Constructor

Initializes a new instance of the AdministrativeAreal2DOccupancyDataPostgreSQLConverter class.

public AdministrativeAreal2DOccupancyDataPostgreSQLConverter(DiGi.PostgreSQL.Classes.ConnectionData? connectionData);

Parameters

connectionData DiGi.PostgreSQL.Classes.ConnectionData

The connection data for the PostgreSQL database.

Properties

AdministrativeAreal2DOccupancyDataPostgreSQLConverter.TableName Property

Gets the name of the table associated with administrative areal 2D occupancy data.

public override string TableName { get; }

Property Value

System.String

AdministrativeAreal2DPostgreSQLConverter Class

Provides functionality to convert and manage AdministrativeAreal2D entities within a PostgreSQL database, implementing the IGISPostgreSQLConverter<TTableObject> interface.

A code is not a key. The table is loaded from BDOT10k, which stores an administrative unit whose territory is disconnected as one OT_ADJA_A feature per polygon part, and every feature becomes its own row. 18 of Poland's 380 counties are multi-part, so type_id = 2 holds 406 rows for 380 codes, up to four rows sharing one code. The row count for a code always equals the feature count in that code's source package - none of this is a re-import artifact, and the extra rows carry real territory (for code 2412 the largest polygon is only 52% of the county), so they must never be deduplicated away.

Every part carries its own ancestor chain.type_id = 0 and type_id = 1 also hold 406 rows each - one country and one voivodeship per county part - so country_id and voivodeship_id on a county row point into that county's own private chain and differ between two rows of the same county. A county row's own county_id is null; its identity is id.

Consequences for callers. Resolve by id wherever possible. GetIdByCodeAsync(NpgsqlConnection, string, Nullable<AdministrativeArealType>, int, CancellationToken) collapses a code to the lowest matching row and reports nothing; GetIdsByCodeAsync(NpgsqlConnection, string, Nullable<int>, Nullable<AdministrativeArealType>, int, CancellationToken) returns every part and is the one to use when ambiguity matters. Any new LIMIT or FirstOrDefault over this table needs an explicit ORDER BY - without one the row returned changes with the query plan, a vacuum or heap ordering, which is exactly how building models came to be filed under one part while its siblings read back empty.

Full analysis: https://github.com/DiGi-Organization/DiGi.GIS.PostgreSQL/issues/1

public class AdministrativeAreal2DPostgreSQLConverter : DiGi.PostgreSQL.Classes.PostgreSQLConverter<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLConverter<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLObject, DiGi.Core.Interfaces.IObject, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLObject

Inheritance System.Object → DiGi.PostgreSQL.Classes.PostgreSQLConverter<AdministrativeAreal2D> → AdministrativeAreal2DPostgreSQLConverter

Implements DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLConverter<AdministrativeAreal2D>, IGISPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLObject, DiGi.Core.Interfaces.IObject, IGISPostgreSQLObject

Constructors

AdministrativeAreal2DPostgreSQLConverter(ConnectionData) Constructor

Initializes a new instance of the AdministrativeAreal2DPostgreSQLConverter class.

public AdministrativeAreal2DPostgreSQLConverter(DiGi.PostgreSQL.Classes.ConnectionData? connectionData);

Parameters

connectionData DiGi.PostgreSQL.Classes.ConnectionData

The DiGi.PostgreSQL.Classes.ConnectionData containing the connection settings required to establish a connection to the PostgreSQL database.

Methods

AdministrativeAreal2DPostgreSQLConverter.ClearAsync(int, CancellationToken) Method

Asynchronously clears all data from the administrative areal 2D table in the PostgreSQL database.

public System.Threading.Tasks.Task<bool> ClearAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result contains true if the table was cleared successfully; otherwise, false.

AdministrativeAreal2DPostgreSQLConverter.CreateTableAsync(int, CancellationToken) Method

Asynchronously creates the PostgreSQL table for administrative areal 2D data and performs an analysis on the created table.

public System.Threading.Tasks.Task<bool> CreateTableAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The time interval, in seconds, to wait for the command to complete before timing out.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result contains true if the table was created successfully; otherwise, false.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DByCodeAsync(string, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves an administrative areal 2D based on the specified code and optional type.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D?> GetAdministrativeAreal2DByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The unique string code of the administrative areal 2D.

administrativeArealType System.Nullable<AdministrativeArealType>

The optional AdministrativeArealType used to filter the search results.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2D>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2D if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DByIdAsync(int, int, CancellationToken) Method

Asynchronously retrieves an administrative areal 2D based on the specified identifier.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D?> GetAdministrativeAreal2DByIdAsync(int id, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The unique integer identifier of the administrative areal 2D.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2D>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2D if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DByIdAsync(NpgsqlConnection, int, int, CancellationToken) Method

Asynchronously retrieves an administrative areal 2D by its unique identifier.

public static System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D?> GetAdministrativeAreal2DByIdAsync(Npgsql.NpgsqlConnection? npgsqlConnection, int id, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

id System.Int32

The unique identifier of the administrative areal 2D to retrieve.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2D>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2D if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferenceByCodeAsync(string, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a reference to an administrative areal 2D based on the provided code and optional type.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference?> GetAdministrativeAreal2DReferenceByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The unique code of the administrative areal 2D.

administrativeArealType System.Nullable<AdministrativeArealType>

The optional AdministrativeArealType used to filter the search results.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2DReference>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2DReference if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferenceByIdAsync(int, int, CancellationToken) Method

Asynchronously retrieves an AdministrativeAreal2DReference by its unique identifier.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference?> GetAdministrativeAreal2DReferenceByIdAsync(int id, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The unique identifier of the administrative areal 2D reference to retrieve.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2DReference>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2DReference if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferenceByIdAsync(NpgsqlConnection, int, int, CancellationToken) Method

Asynchronously retrieves an administrative areal 2D reference by its unique identifier.

public static System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference?> GetAdministrativeAreal2DReferenceByIdAsync(Npgsql.NpgsqlConnection? npgsqlConnection, int id, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

id System.Int32

The unique identifier of the administrative areal 2D reference to retrieve.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2DReference>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2DReference if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathAsync(AdministrativeAreal2DReference, int, CancellationToken) Method

Asynchronously retrieves the administrative areal 2D reference path for the specified administrative areal 2D reference.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath?> GetAdministrativeAreal2DReferencePathAsync(DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference administrativeAreal2DReference, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DReference AdministrativeAreal2DReference

The administrative areal 2D reference used to retrieve the corresponding path.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2DReferencePath>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2DReferencePath if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathAsync(int, int, CancellationToken) Method

Asynchronously retrieves an administrative areal 2D reference path by its unique identifier.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath?> GetAdministrativeAreal2DReferencePathAsync(int id, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The unique identifier of the administrative areal 2D reference path.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2DReferencePath>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2DReferencePath if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathAsync(NpgsqlConnection, AdministrativeAreal2DReference, int, CancellationToken) Method

Asynchronously retrieves the reference path for the specified administrative areal 2D reference.

public static System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath?> GetAdministrativeAreal2DReferencePathAsync(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference administrativeAreal2DReference, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

administrativeAreal2DReference AdministrativeAreal2DReference

The AdministrativeAreal2DReference for which the reference path is retrieved.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2DReferencePath>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2DReferencePath if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathAsync(NpgsqlConnection, int, int, CancellationToken) Method

Asynchronously retrieves the reference path for the specified administrative areal 2D identifier.

public static System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath?> GetAdministrativeAreal2DReferencePathAsync(Npgsql.NpgsqlConnection? npgsqlConnection, int id, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

id System.Int32

The unique identifier of the administrative areal 2D entity.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<AdministrativeAreal2DReferencePath>
A task that represents the asynchronous operation. The task result contains the AdministrativeAreal2DReferencePath if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathsAsync(NpgsqlConnection, IEnumerable<AdministrativeAreal2DReference>, int, CancellationToken) Method

Asynchronously retrieves a list of reference paths for the specified collection of administrative areal 2D references.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath>?> GetAdministrativeAreal2DReferencePathsAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference> administrativeAreal2DReferences, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

administrativeAreal2DReferences System.Collections.Generic.IEnumerable<AdministrativeAreal2DReference>

The collection of AdministrativeAreal2DReference objects for which paths are retrieved.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReferencePath>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReferencePath objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathsAsync(IEnumerable<AdministrativeAreal2DReference>, int, CancellationToken) Method

Asynchronously retrieves a list of reference paths for the specified collection of administrative areal 2D references.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath>?> GetAdministrativeAreal2DReferencePathsAsync(System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference> administrativeAreal2DReferences, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DReferences System.Collections.Generic.IEnumerable<AdministrativeAreal2DReference>

The collection of AdministrativeAreal2DReference objects for which paths are retrieved.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReferencePath>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReferencePath objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathsByNameAsync(NpgsqlConnection, string, int, CancellationToken) Method

Searches for administrative area reference paths by name (case-insensitive and diacritic-insensitive) and returns a list of reference paths.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath>?> GetAdministrativeAreal2DReferencePathsByNameAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string text, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

Existing Npgsql connection.

text System.String

The text to search for within the name column.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

Cancellation token.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReferencePath>>
A list of AdministrativeAreal2DReferencePath objects matching the search criteria.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencePathsByNameAsync(string, int, CancellationToken) Method

Searches for administrative area reference paths by name (case-insensitive and diacritic-insensitive) and returns a list of reference paths.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath>?> GetAdministrativeAreal2DReferencePathsByNameAsync(string text, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

text System.String

The text to search for within the name column.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

Cancellation token.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReferencePath>>
A list of AdministrativeAreal2DReferencePath objects matching the search criteria.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByAdministrativeArealTypeAsync(AdministrativeArealType, Nullable<int>, bool, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references based on the specified administrative areal type, an optional parent identifier, and a uniqueness flag.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByAdministrativeArealTypeAsync(DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, System.Nullable<int> parentId=null, bool uniqueCode=false, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeArealType AdministrativeArealType

The AdministrativeArealType that defines the category of administrative areals to be retrieved.

parentId System.Nullable<System.Int32>

The optional integer identifier of the parent administrative areal used to filter for child elements.

uniqueCode System.Boolean

A boolean value indicating whether the retrieval should be filtered by unique codes.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByAdministrativeArealTypeAsync(NpgsqlConnection, AdministrativeArealType, IEnumerable<int>, bool, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references based on the specified administrative area type and parent identifiers.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByAdministrativeArealTypeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, System.Collections.Generic.IEnumerable<int> parentIds, bool uniqueCode=false, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

administrativeArealType AdministrativeArealType

The target AdministrativeArealType of the references to be retrieved.

parentIds System.Collections.Generic.IEnumerable<System.Int32>

A collection of integer identifiers for the parent administrative areas.

uniqueCode System.Boolean

A boolean value indicating whether a unique code should be used during retrieval.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByAdministrativeArealTypeAsync(NpgsqlConnection, AdministrativeArealType, Nullable<int>, bool, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references filtered by the specified administrative areal type and optionally by a parent identifier.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByAdministrativeArealTypeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, System.Nullable<int> parentId=null, bool uniqueCode=false, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

administrativeArealType AdministrativeArealType

The AdministrativeArealType that filters the administrative areal references.

parentId System.Nullable<System.Int32>

The optional unique identifier of the parent administrative area.

uniqueCode System.Boolean

A value indicating whether to filter by a unique code.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.List<> of references if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByCodeAsync(NpgsqlConnection, string, AdministrativeArealType, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references based on the specified code and administrative areal type.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByCodeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string code, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

code System.String

The identification code used to search for the administrative areal 2D references.

administrativeArealType AdministrativeArealType

The type of administrative areal to filter by.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if found; otherwise, null or an empty list.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByCodeAsync(NpgsqlConnection, string, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references based on the specified code.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByCodeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string code, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

code System.String

The identification code used to search for the administrative areal 2D references.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if found; otherwise, null or an empty list.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByCodeAsync(string, AdministrativeArealType, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references based on the specified code and administrative areal type.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByCodeAsync(string code, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The string code used to identify the administrative areals.

administrativeArealType AdministrativeArealType

The AdministrativeArealType specifying the category of the administrative areal.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if matches are found; otherwise, null or an empty list.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByCodeAsync(string, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references associated with the specified code.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByCodeAsync(string code, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The string code used to identify the administrative areals.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if found; otherwise, null or an empty list.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByIdsAsync(NpgsqlConnection, IEnumerable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references from the database based on the provided identifiers.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByIdsAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<int> ids, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

ids System.Collections.Generic.IEnumerable<System.Int32>

A collection of integer identifiers for the records to be retrieved.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if successful; otherwise, null if the connection is null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByIdsAsync(IEnumerable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references associated with the specified identifiers using the internal connection data.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByIdsAsync(System.Collections.Generic.IEnumerable<int> ids, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

ids System.Collections.Generic.IEnumerable<System.Int32>

The collection of integer identifiers used to retrieve the administrative areal 2D references.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if matches are found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByNameAsync(NpgsqlConnection, string, int, CancellationToken) Method

Searches for administrative areas by name (case-insensitive and diacritic-insensitive) and returns a list of references.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByNameAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string text, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

Existing Npgsql connection.

text System.String

The text to search for within the name column.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

Cancellation token.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A list of AdministrativeAreal2DReference objects matching the search criteria.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByNameAsync(string, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references that match the specified search text (case-insensitive and diacritic-insensitive) using the internal connection data.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByNameAsync(string text, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

text System.String

The search string used to filter administrative areal 2D references by their name.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if matches are found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByParentCodeAsync(NpgsqlConnection, string, AdministrativeArealType, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references belonging to a parent identified by the specified parent code, filtered by the target administrative areal type.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByParentCodeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string parentCode, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> parentType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

parentCode System.String

The identification code of the parent administrative areal.

administrativeArealType AdministrativeArealType

The target child AdministrativeArealType to filter the results by.

parentType System.Nullable<AdministrativeArealType>

An optional parent AdministrativeArealType used to filter the parent administrative area.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if found; otherwise, null or an empty list.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DReferencesByParentCodeAsync(string, AdministrativeArealType, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D references belonging to a parent identified by the specified parent code, filtered by the target administrative areal type.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference>?> GetAdministrativeAreal2DReferencesByParentCodeAsync(string parentCode, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> parentType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

parentCode System.String

The identification code of the parent administrative areal.

administrativeArealType AdministrativeArealType

The target child AdministrativeArealType to filter the results by.

parentType System.Nullable<AdministrativeArealType>

An optional parent AdministrativeArealType used to filter the parent administrative area.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2DReference>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2DReference objects if matches are found; otherwise, null or an empty list.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByAdministrativeArealType(AdministrativeArealType, Nullable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects filtered by the specified administrative areal type and an optional parent identifier.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByAdministrativeArealType(DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, System.Nullable<int> parentId=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeArealType AdministrativeArealType

The AdministrativeArealType used to filter the administrative areal objects.

parentId System.Nullable<System.Int32>

The optional unique identifier of the parent administrative areal object.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByAdministrativeArealType(NpgsqlConnection, AdministrativeArealType, Nullable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D entities based on the specified administrative areal type and an optional parent identifier.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByAdministrativeArealType(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, System.Nullable<int> parentId=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

administrativeArealType AdministrativeArealType

The AdministrativeArealType of the entities to be retrieved.

parentId System.Nullable<System.Int32>

The optional unique identifier of the parent administrative areal entity.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.List<> of matching entities, or null if the connection is null or no valid entities are found based on the provided criteria.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByAdministrativeArealTypeAsync(AdministrativeArealType, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects filtered by the specified administrative areal type.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByAdministrativeArealTypeAsync(DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeArealType AdministrativeArealType

The AdministrativeArealType used to filter the administrative areal objects.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects if successful; otherwise, null or an empty list.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByBoundingBox2DAsync(BoundingBox2D, AdministrativeArealType, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects that fall within the area defined by the specified bounding box and match the provided administrative areal type.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByBoundingBox2DAsync(DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

boundingBox2D DiGi.Geometry.Planar.Classes.BoundingBox2D

The DiGi.Geometry.Planar.Classes.BoundingBox2D defining the search area. If this value is null, the method returns null.

administrativeArealType AdministrativeArealType

The AdministrativeArealType used to filter the administrative areal objects.

tolerance System.Double

A double value representing the distance tolerance used for the search operation.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the bounding box is null or the administrative areal type is undefined.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByBoundingBox2DAsync(BoundingBox2D, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects that fall within the area defined by the specified bounding box.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByBoundingBox2DAsync(DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

boundingBox2D DiGi.Geometry.Planar.Classes.BoundingBox2D

The DiGi.Geometry.Planar.Classes.BoundingBox2D defining the search area. If this value is null, an empty list may be returned.

tolerance System.Double

A double value representing the distance tolerance used for the search operation.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the retrieval fails.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByBoundingBox2DAsync(BoundingBox2D, IEnumerable<AdministrativeArealType>, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects that fall within the area defined by the specified bounding box and match any of the provided administrative areal types.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByBoundingBox2DAsync(DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>? administrativeArealTypes, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

boundingBox2D DiGi.Geometry.Planar.Classes.BoundingBox2D

The DiGi.Geometry.Planar.Classes.BoundingBox2D defining the search area. If this value is null, the method returns null.

administrativeArealTypes System.Collections.Generic.IEnumerable<AdministrativeArealType>

A collection of AdministrativeArealType values used to filter the administrative areal objects.

tolerance System.Double

A double value representing the distance tolerance used for the search operation.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the bounding box is null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByBoundingBox2DAsync(NpgsqlConnection, BoundingBox2D, AdministrativeArealType, double, int, CancellationToken) Method

Gets AdministrativeAreal2D for given AdministrativeArealType (not iterative way). It will check all records with given AdministrativeArealType

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByBoundingBox2DAsync(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

NpgsqlConnection

boundingBox2D DiGi.Geometry.Planar.Classes.BoundingBox2D

BoundingBox2D

administrativeArealType AdministrativeArealType

AdministrativeArealType

tolerance System.Double

Tolerance

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
AdministrativeAreal2D list

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByBoundingBox2DAsync(NpgsqlConnection, BoundingBox2D, IEnumerable<AdministrativeArealType>, double, int, CancellationToken) Method

Gets AdministrativeAreal2D for given AdministrativeArealTypes (Iterative way). It will iterate in order through Country, Voivodeship, County, Municipality to reduce number of objects. BoundingBox2D in range Country check, then Voivodeship in this specific Country etc..

An empty level does not end the search. The levels below it are searched against the last level that did answer, because a level can be missing from the source data rather than from the area: m. Poznan (3064) holds no gmina feature in BDOT10k at all, so its 113 subdivisions hang off the county. Stopping at the first empty level returned nothing whatsoever - not even a subdivision - for every query inside a city of 82 075 buildings, which is also how Building2DPostgreSQLConverter came back empty there. See https://github.com/DiGi-Organization/DiGi.GIS.PostgreSQL/issues/15.

The narrowing still assumes a unit sits inside its ancestor, which holds for this data with rare exceptions: the settlement layer (OT_ADMS_A) and the division layer (OT_ADJA_A) are digitised independently, so a handful of settlements fall marginally outside their own municipality.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByBoundingBox2DAsync(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>? administrativeArealTypes, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

NpgsqlConnection

boundingBox2D DiGi.Geometry.Planar.Classes.BoundingBox2D

BoundingBox2D

administrativeArealTypes System.Collections.Generic.IEnumerable<AdministrativeArealType>

AdministrativeArealTypes

tolerance System.Double

Tolerance

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
AdministrativeAreal2D list

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByCircle2DAsync(Circle2D, AdministrativeArealType, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects that fall within the area defined by the specified circle and match the given administrative areal type.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByCircle2DAsync(DiGi.Geometry.Planar.Classes.Circle2D? circle2D, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

circle2D DiGi.Geometry.Planar.Classes.Circle2D

The DiGi.Geometry.Planar.Classes.Circle2D defining the search area. If this value is null, an empty list is returned.

administrativeArealType AdministrativeArealType

The AdministrativeArealType used to filter the administrative areal objects.

tolerance System.Double

A double value representing the distance tolerance added to the circle's radius for the search operation.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the retrieval fails.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByCircle2DAsync(Circle2D, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects that fall within the area defined by the specified circle.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByCircle2DAsync(DiGi.Geometry.Planar.Classes.Circle2D? circle2D, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

circle2D DiGi.Geometry.Planar.Classes.Circle2D

The DiGi.Geometry.Planar.Classes.Circle2D defining the search area. If this value is null, an empty list is returned.

tolerance System.Double

A double value representing the distance tolerance added to the circle's radius for the search operation.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the retrieval fails.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByCircle2DAsync(Circle2D, IEnumerable<AdministrativeArealType>, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects that fall within the area defined by the specified circle and match any of the provided administrative areal types.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByCircle2DAsync(DiGi.Geometry.Planar.Classes.Circle2D? circle2D, System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>? administrativeArealTypes, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

circle2D DiGi.Geometry.Planar.Classes.Circle2D

The DiGi.Geometry.Planar.Classes.Circle2D defining the search area. If this value is null, an empty list is returned.

administrativeArealTypes System.Collections.Generic.IEnumerable<AdministrativeArealType>

A collection of AdministrativeArealType values used to filter the administrative areal objects.

tolerance System.Double

A double value representing the distance tolerance added to the circle's radius for the search operation.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the retrieval fails.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByCodeAsync(NpgsqlConnection, string, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects from the database based on the specified code and optional type.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByCodeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

code System.String

The string code used to identify the administrative areal 2D objects.

administrativeArealType System.Nullable<AdministrativeArealType>

The optional AdministrativeArealType used to filter the results by a specific type.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.List<> of AdministrativeAreal2D objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByCodeAsync(string, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects based on the specified code and an optional administrative areal type.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The string representation of the code used to filter the administrative areal records.

administrativeArealType System.Nullable<AdministrativeArealType>

An optional AdministrativeArealType used to further refine the search results.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to monitor for cancellation requests.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the database connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByCodesAsync(IEnumerable<string>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects based on the provided collection of codes.

If the codes collection is null or empty, all records from the table are retrieved.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByCodesAsync(System.Collections.Generic.IEnumerable<string>? codes=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

codes System.Collections.Generic.IEnumerable<System.String>

An optional collection of strings representing the codes used to filter the results.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects, or null if the database connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByIdsAsync(NpgsqlConnection, IEnumerable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D objects from the database based on the provided identifiers.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByIdsAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<int> ids, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

ids System.Collections.Generic.IEnumerable<System.Int32>

An System.Collections.Generic.IEnumerable<> of integer identifiers for the administrative areal 2D objects to retrieve.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.List<> of AdministrativeAreal2D objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByIdsAsync(IEnumerable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areas based on the provided identifiers.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByIdsAsync(System.Collections.Generic.IEnumerable<int>? ids=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

ids System.Collections.Generic.IEnumerable<System.Int32>

An optional collection of integer identifiers used to filter the results. If this parameter is null or empty, no ID filtering is applied and the whole table is read.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects if successful; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByPoint2DAsync(Point2D, AdministrativeArealType, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areas of a specific type that contain or are near the specified 2D point within the given tolerance.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByPoint2DAsync(DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

point2D DiGi.Geometry.Planar.Classes.Point2D

The 2D point used to search for administrative areas. If this value is null, the method returns null.

administrativeArealType AdministrativeArealType

The type of administrative area to retrieve. If this value is Undefined, the method returns null.

tolerance System.Double

The distance tolerance used for the spatial query. The default value is DiGi.Core.Constants.Tolerance.MacroDistance.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of matching AdministrativeAreal2D objects, or null if the provided point is null or the administrative area type is undefined.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByPoint2DAsync(Point2D, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areas that contain or are near the specified 2D point within the given tolerance.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByPoint2DAsync(DiGi.Geometry.Planar.Classes.Point2D? point2D, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

point2D DiGi.Geometry.Planar.Classes.Point2D

The 2D point used to search for administrative areas. If this value is null, the method returns null.

tolerance System.Double

The distance tolerance used for the spatial query. The default value is DiGi.Core.Constants.Tolerance.MacroDistance.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of matching AdministrativeAreal2D objects, or null if the provided point is null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByPoint2DAsync(Point2D, IEnumerable<AdministrativeArealType>, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areas that contain or are near the specified 2D point, filtered by the provided administrative area types and within the given tolerance.

Levels are searched from Country downwards, each narrowed to the children of the last level that answered. An empty level does not end the search - see GetAdministrativeAreal2DsByBoundingBox2DAsync(NpgsqlConnection, BoundingBox2D, IEnumerable<AdministrativeArealType>, double, int, CancellationToken) for why m. Poznan makes that necessary.

public System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByPoint2DAsync(DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>? administrativeArealTypes, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

point2D DiGi.Geometry.Planar.Classes.Point2D

The 2D point used to search for administrative areas. If this value is null, the method returns null.

administrativeArealTypes System.Collections.Generic.IEnumerable<AdministrativeArealType>

An optional collection of administrative area types to filter the results.

tolerance System.Double

The distance tolerance used for the spatial query. The default value is DiGi.Core.Constants.Tolerance.MacroDistance.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of matching AdministrativeAreal2D objects, or null if the provided point is null.

AdministrativeAreal2DPostgreSQLConverter.GetAdministrativeAreal2DsByPoint2DAsync(NpgsqlConnection, Point2D, AdministrativeArealType, double, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D records from the database that encompass or are within a specified tolerance of the provided 2D point.

public static System.Threading.Tasks.Task<System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>?> GetAdministrativeAreal2DsByPoint2DAsync(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

point2D DiGi.Geometry.Planar.Classes.Point2D

The DiGi.Geometry.Planar.Classes.Point2D coordinates used to filter the administrative areals.

administrativeArealType AdministrativeArealType

The AdministrativeArealType specifying the category of administrative areal to retrieve.

tolerance System.Double

The double value representing the distance tolerance applied to the bounding box check. Defaults to DiGi.Core.Constants.Tolerance.MacroDistance.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to monitor for cancellation requests.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<AdministrativeAreal2D>>
A task that represents the asynchronous operation. The task result contains a list of AdministrativeAreal2D objects if found; otherwise, an empty list or null.

AdministrativeAreal2DPostgreSQLConverter.GetBoundingBox2DAsync(int, CancellationToken) Method

Asynchronously calculates the overall 2D bounding box enclosing country administrative areal entities in the PostgreSQL database.

public System.Threading.Tasks.Task<DiGi.Geometry.Planar.Classes.BoundingBox2D?> GetBoundingBox2DAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<DiGi.Geometry.Planar.Classes.BoundingBox2D>
A task that represents the asynchronous operation. The task result contains the calculated DiGi.Geometry.Planar.Classes.BoundingBox2D enclosing the country administrative areals, or null if no valid geometries exist or connection is null.

AdministrativeAreal2DPostgreSQLConverter.GetBoundingBox2DAsync(NpgsqlConnection, int, CancellationToken) Method

Asynchronously calculates the overall 2D bounding box enclosing country administrative areal entities in the PostgreSQL database.

public static System.Threading.Tasks.Task<DiGi.Geometry.Planar.Classes.BoundingBox2D?> GetBoundingBox2DAsync(Npgsql.NpgsqlConnection? npgsqlConnection, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<DiGi.Geometry.Planar.Classes.BoundingBox2D>
A task that represents the asynchronous operation. The task result contains the calculated DiGi.Geometry.Planar.Classes.BoundingBox2D enclosing the country administrative areals, or null if no valid geometries exist or connection is null.

AdministrativeAreal2DPostgreSQLConverter.GetCodesAsync(int, CancellationToken) Method

Asynchronously retrieves all codes of administrative areal 2D entities from the database.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<string>?> GetCodesAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.String>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of strings representing the codes, or null if the database connection cannot be established.

AdministrativeAreal2DPostgreSQLConverter.GetCountAsync(int, CancellationToken) Method

Asynchronously retrieves the total count of administrative areal 2D entities from the database.

public System.Threading.Tasks.Task<long> GetCountAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The timeout in seconds applied to the count command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total count as a System.Int64; returns -1 if the database connection cannot be established.

AdministrativeAreal2DPostgreSQLConverter.GetCountAsync(NpgsqlConnection, int, CancellationToken) Method

Asynchronously retrieves the total number of administrative areal 2D records from the database.

public static System.Threading.Tasks.Task<long> GetCountAsync(Npgsql.NpgsqlConnection? npgsqlConnection, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

commandTimeout System.Int32

The timeout in seconds applied to the count command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the operation.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total number of records, or -1 if the connection is null.

AdministrativeAreal2DPostgreSQLConverter.GetCountyIdsByBoundingBox2DAsync(BoundingBox2D, double, int, CancellationToken) Method

Asynchronously retrieves the identifiers of every county polygon part a spatial query over the given bounding box has to read, including parts lying outside the box.

See GetCountyIdsByBoundingBox2DAsync(NpgsqlConnection, BoundingBox2D, double, int, CancellationToken) for why the parts overlapping the box are not the whole answer.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetCountyIdsByBoundingBox2DAsync(DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

boundingBox2D DiGi.Geometry.Planar.Classes.BoundingBox2D

The DiGi.Geometry.Planar.Classes.BoundingBox2D defining the spatial area to search; may be null.

tolerance System.Double

The double value the bounding box is expanded by on every side.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains the identifiers of every county part to read, an empty set when no county overlaps the box, or null when the bounding box is null or the connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.GetCountyIdsByBoundingBox2DAsync(NpgsqlConnection, BoundingBox2D, double, int, CancellationToken) Method

Asynchronously retrieves the identifiers of every county polygon part a spatial query over the given bounding box has to read, including parts lying outside the box.

A county code is not a key - a county whose territory is disconnected is stored as one row per polygon part - and a building is filed under one of those parts, not necessarily the part whose polygon covers it. Deriving the partition list from the parts overlapping the box alone therefore leaves out the partition the buildings are actually in, and the read comes back empty with no error at all. The result is widened to every part sharing a code with an overlapping part, which is the SiblingCountyGroups(this IEnumerable<AdministrativeAreal2DReference>) rule expressed in SQL.

Widening is safe: it only adds partitions to prune to, and the bounding box predicate on the rows themselves still decides what comes back. Prune by this rather than by the county_id carried by the subdivisions in the box - that column names one part.

See https://github.com/DiGi-Organization/DiGi.GIS.PostgreSQL/issues/64.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetCountyIdsByBoundingBox2DAsync(Npgsql.NpgsqlConnection? npgsqlConnection, DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

boundingBox2D DiGi.Geometry.Planar.Classes.BoundingBox2D

The DiGi.Geometry.Planar.Classes.BoundingBox2D defining the spatial area to search; may be null.

tolerance System.Double

The double value the bounding box is expanded by on every side.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains the identifiers of every county part to read, an empty set when no county overlaps the box, or null when the connection or the bounding box is null.

AdministrativeAreal2DPostgreSQLConverter.GetCountyIdsWithNestedSubdivisionsAsync(double, int, CancellationToken) Method

Asynchronously retrieves the identifiers of every county polygon part whose subdivision layer nests. See GetCountyIdsWithNestedSubdivisionsAsync(NpgsqlConnection, double, int, CancellationToken).

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetCountyIdsWithNestedSubdivisionsAsync(double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

tolerance System.Double

The distance a container's box is expanded by on every side before the inner box is tested against it.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains the identifiers of the county parts to scope to, an empty set when no subdivision nests anywhere, or null when the connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.GetCountyIdsWithNestedSubdivisionsAsync(NpgsqlConnection, double, int, CancellationToken) Method

Asynchronously retrieves the identifiers of every county polygon part whose subdivision layer nests - where a subdivision lies inside another subdivision of the same municipality, as a city holds its districts and their neighbourhoods.

Decided on the stored bounding boxes: a subdivision counts as nested when its box lies within the strictly larger box of a sibling, expanded by tolerance. A box inside a box does not prove a polygon inside a polygon, so this over-approximates - which is what a scope wants: every county that might hold a nesting is named, at the cost of the odd county that only looks like one from its boxes. It is not a membership test; ContainerIds(this IReadOnlyDictionary<int,PolygonalFace2D>, double) decides nesting on the polygons themselves.

Widened to every part sharing a code with a part named, the GetCountyIdsByBoundingBox2DAsync(NpgsqlConnection, BoundingBox2D, double, int, CancellationToken) rule: a subdivision's county_id names one part, and the buildings it holds may be filed under a sibling. See DiGi.GIS.PostgreSQL#77.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetCountyIdsWithNestedSubdivisionsAsync(Npgsql.NpgsqlConnection? npgsqlConnection, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

tolerance System.Double

The distance a container's box is expanded by on every side before the inner box is tested against it.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains the identifiers of the county parts to scope to, an empty set when no subdivision nests anywhere, or null when the connection is null.

AdministrativeAreal2DPostgreSQLConverter.GetEstimatedCountAsync(bool, int, CancellationToken) Method

Asynchronously retrieves an estimated count of the administrative areal 2D entities from the database.

public System.Threading.Tasks.Task<System.Nullable<long>> GetEstimatedCountAsync(bool analyze=false, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

analyze System.Boolean

A boolean value indicating whether to analyze the table before retrieving the estimate.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Nullable<System.Int64>>
A task that represents the asynchronous operation. The task result contains the estimated count as a nullable System.Int64, -1 when the table exists but has not been analysed, or null if the table does not exist or connection cannot be established.

AdministrativeAreal2DPostgreSQLConverter.GetEstimatedCountAsync(NpgsqlConnection, bool, int, CancellationToken) Method

Asynchronously retrieves an estimated count of the administrative areal 2D records from the database.

public static System.Threading.Tasks.Task<System.Nullable<long>> GetEstimatedCountAsync(Npgsql.NpgsqlConnection? npgsqlConnection, bool analyze=false, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

analyze System.Boolean

A boolean value indicating whether to perform a table analysis before retrieving the count.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the operation.

Returns

System.Threading.Tasks.Task<System.Nullable<System.Int64>>
A task that represents the asynchronous operation. The task result contains the estimated number of records, -1 when the table exists but has not been analysed, or null if the table does not exist or connection is null.

AdministrativeAreal2DPostgreSQLConverter.GetIdByCodeAsync(NpgsqlConnection, string, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves the identifier of an administrative areal based on its code and optional type.

public static System.Threading.Tasks.Task<System.Nullable<int>> GetIdByCodeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string? code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

code System.String

The string code identifying the administrative areal.

administrativeArealType System.Nullable<AdministrativeArealType>

The optional AdministrativeArealType to filter the search.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the operation.

Returns

System.Threading.Tasks.Task<System.Nullable<System.Int32>>
A task that represents the asynchronous operation. The task result contains the identifier of the administrative areal if found; otherwise, null.

Remarks

A code can match several rows - a multi-part county holds one row per polygon part - and this method collapses them to the lowest identifier. Callers that need to know a code was ambiguous, or that need every part, must use GetIdsByCodeAsync(NpgsqlConnection, string, Nullable<int>, Nullable<AdministrativeArealType>, int, CancellationToken) instead.

AdministrativeAreal2DPostgreSQLConverter.GetIdByCodeAsync(string, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves the identifier of an administrative areal 2D entity based on the specified code and type.

public System.Threading.Tasks.Task<System.Nullable<int>> GetIdByCodeAsync(string? code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The identification code of the administrative areal entity.

administrativeArealType System.Nullable<AdministrativeArealType>

The type of the administrative areal entity.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Nullable<System.Int32>>
A task that represents the asynchronous operation. The task result contains the identifier as an System.Int32 if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetIdsAsync(AdministrativeArealType, int, CancellationToken) Method

Asynchronously retrieves a set of identifiers for administrative areal entities of the specified type from the database.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetIdsAsync(DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeArealType AdministrativeArealType

The type of administrative areal used to filter the results.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects to signal that the asynchronous operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task representing the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of integers containing the IDs, or null if the database connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.GetIdsAsync(int, CancellationToken) Method

Asynchronously retrieves all identifiers for administrative areal 2D entities from the database.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetIdsAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task representing the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of integers containing the IDs, or null if the database connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.GetIdsByCodeAsync(NpgsqlConnection, string, Nullable<int>, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a set of identifiers for administrative areals that match the specified code and optional criteria.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetIdsByCodeAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string? code, System.Nullable<int> limit=null, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

code System.String

The string code used to filter the administrative areals.

limit System.Nullable<System.Int32>

An optional integer specifying the maximum number of identifiers to retrieve.

administrativeArealType System.Nullable<AdministrativeArealType>

An optional AdministrativeArealType used to further filter the results by type.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of integers representing the IDs if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetIdsByCodeAsync(string, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves every administrative areal 2D identifier matching the specified code and type.

A county code matches one row per polygon part of a multi-part county, so this returns several identifiers for such a county. Use it wherever an ambiguous code has to be detected or every part has to be visited, rather than GetIdByCodeAsync(string, Nullable<AdministrativeArealType>, int, CancellationToken), which silently collapses the match to the lowest identifier.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> GetIdsByCodeAsync(string? code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The identification code of the administrative areal entity.

administrativeArealType System.Nullable<AdministrativeArealType>

The type of the administrative areal entity.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains the matching identifiers, an empty set when the code matches nothing, or null when the connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.GetIdsByCodesAsync(NpgsqlConnection, IEnumerable<string>, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a mapping of administrative area codes to sets of identifiers matching those codes and administrative area type.

public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string,System.Collections.Generic.HashSet<int>>?> GetIdsByCodesAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<string>? codes, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

codes System.Collections.Generic.IEnumerable<System.String>

A collection of code strings to query.

administrativeArealType System.Nullable<AdministrativeArealType>

The optional AdministrativeArealType used to filter the records.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.HashSet<System.Int32>>>
A task that represents the asynchronous operation. The task result contains a dictionary mapping code strings to sets of integer identifiers if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetIdsByCodesAsync(IEnumerable<string>, Nullable<AdministrativeArealType>, int, CancellationToken) Method

Asynchronously retrieves a mapping of administrative area codes to sets of identifiers matching those codes and administrative area type.

public System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string,System.Collections.Generic.HashSet<int>>?> GetIdsByCodesAsync(System.Collections.Generic.IEnumerable<string>? codes, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

codes System.Collections.Generic.IEnumerable<System.String>

A collection of code strings to query.

administrativeArealType System.Nullable<AdministrativeArealType>

The optional AdministrativeArealType used to filter the records.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.HashSet<System.Int32>>>
A task that represents the asynchronous operation. The task result contains a dictionary mapping code strings to sets of integer identifiers if found; otherwise, null.

AdministrativeAreal2DPostgreSQLConverter.GetSubCodesAsync(NpgsqlConnection, string, int, CancellationToken) Method

Asynchronously retrieves a collection of sub-codes that start with the specified code prefix from the database, excluding the exact code match.

public static System.Threading.Tasks.Task<System.Collections.Generic.HashSet<string>?> GetSubCodesAsync(Npgsql.NpgsqlConnection? npgsqlConnection, string? code, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

code System.String

The parent code or prefix used to filter and identify the associated sub-codes.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.String>>
A task representing the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of strings containing the matching sub-codes, or null if the connection is null.

AdministrativeAreal2DPostgreSQLConverter.GetSubCodesAsync(string, int, CancellationToken) Method

Asynchronously retrieves a collection of sub-codes that start with the specified code prefix from the database, excluding the exact code match.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<string>?> GetSubCodesAsync(string? code, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The parent code or prefix used to filter and identify the associated sub-codes.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.String>>
A task representing the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of strings containing the matching sub-codes, or null if the database connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.RefreshAsync(PostgreSQLAdministrativeAreal2DRefreshOptions, IProgress<long>, int, CancellationToken) Method

Asynchronously refreshes the administrative areal 2D data within the PostgreSQL database.

Every row's parent chain (country_id / voivodeship_id / county_id / municipality_id) is cleared and rebuilt, so a re-run repairs whatever the previous one got wrong. Parents are searched one administrative level at a time, nearest level first, and the walk stops at the first level that yields a match - a row whose own level directly above holds no parent is filed under the nearest ancestor that does. Matching within a level, including its majority-overlap fallback, is UpdateIds(this AdministrativeAreal2D, IEnumerable<AdministrativeAreal2D>, double).

At each level the candidates are first narrowed to the rows the row's own code names (AdministrativeCodeKey(string, AdministrativeArealType)), and geometry only chooses between those - a code names several rows when a unit's territory is disconnected. Geometry alone is not enough: it silently files a row under whichever neighbour's bounding box happens to be the only one holding the sample point.

Real BDOT10k data needs all three. Poznan (3064) has no gmina feature at all, so its subdivisions have no Municipality to match; a handful of settlements sit in a gap between municipality polygons; and before this every one of Poznan's 113 subdivisions was wrong - 87 with a null chain (https://github.com/DiGi-Organization/DiGi.GIS.PostgreSQL/issues/14) and 26 filed under county 3021, along with 10 more rows elsewhere in the country (https://github.com/DiGi-Organization/DiGi.GIS.PostgreSQL/issues/15).

public System.Threading.Tasks.Task<bool> RefreshAsync(DiGi.GIS.PostgreSQL.Classes.PostgreSQLAdministrativeAreal2DRefreshOptions? postgreSQLAdministrativeAreal2DRefreshOptions=null, System.IProgress<long>? progress=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

postgreSQLAdministrativeAreal2DRefreshOptions PostgreSQLAdministrativeAreal2DRefreshOptions

The options used to configure the refresh process. If null, a new instance of PostgreSQLAdministrativeAreal2DRefreshOptions is initialized.

progress System.IProgress<System.Int64>

The provider for reporting the progress of the refresh operation as a long value.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while carrying out the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result contains true if the refresh was successful; otherwise, false.

AdministrativeAreal2DPostgreSQLConverter.RemoveAsync(IEnumerable<int>, int, CancellationToken) Method

Asynchronously removes administrative areal 2D records from the database based on the provided identifiers.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> RemoveAsync(System.Collections.Generic.IEnumerable<int>? ids, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

ids System.Collections.Generic.IEnumerable<System.Int32>

An optional collection of integer identifiers for the records to be removed.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of IDs that were successfully deleted, or null if the input was null or a database connection could not be established.

AdministrativeAreal2DPostgreSQLConverter.UpdateAsync(IEnumerable<AdministrativeAreal2D>, int, CancellationToken) Method

Asynchronously updates a collection of administrative areal 2D records in the PostgreSQL database.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> UpdateAsync(System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2D>? administrativeAreal2Ds, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2Ds System.Collections.Generic.IEnumerable<AdministrativeAreal2D>

The collection of AdministrativeAreal2D objects to be updated. This value can be null.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of integers representing the IDs of the records that were processed, or null if the update process failed or the input was null.

AdministrativeAreal2DReference Class

Represents a reference to a 2D administrative area within the Polish territorial division hierarchy (country, voivodeship, county, municipality).

Id is the identity; CountryId, VoivodeshipId, CountyId and MunicipalityId are the parent chain and are never self-references. On a county-type reference CountyId is therefore null - to key building data by county, pass Id.

A reference identifies one polygon part: a multi-part county returns several references sharing a Code, each with a different Id and a different parent chain. Enumerating counties yields 406 references for 380 codes. See AdministrativeAreal2DPostgreSQLConverter for why.

public class AdministrativeAreal2DReference : DiGi.GIS.PostgreSQL.Classes.Areal2DReference

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Areal2DReference → AdministrativeAreal2DReference

Constructors

AdministrativeAreal2DReference() Constructor

Initializes a new instance of the AdministrativeAreal2DReference class.

public AdministrativeAreal2DReference();

AdministrativeAreal2DReference(AdministrativeAreal2DReference) Constructor

Initializes a new instance of the AdministrativeAreal2DReference class by copying data from another AdministrativeAreal2DReference instance.

public AdministrativeAreal2DReference(DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference? administrativeAreal2DReference);

Parameters

administrativeAreal2DReference AdministrativeAreal2DReference

The AdministrativeAreal2DReference instance to copy data from.

AdministrativeAreal2DReference(JsonObject) Constructor

Initializes a new instance of the AdministrativeAreal2DReference class from a JsonObject.

public AdministrativeAreal2DReference(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Properties

AdministrativeAreal2DReference.AdministrativeArealType Property

Gets or sets the type of the administrative area (e.g., country, voivodeship, county, municipality).

public DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType AdministrativeArealType { get; set; }

Property Value

AdministrativeArealType

AdministrativeAreal2DReference.Code Property

Gets or sets the code of the administrative area.

public string? Code { get; set; }

Property Value

System.String

AdministrativeAreal2DReference.CountryId Property

Gets or sets the ID of the country.

public System.Nullable<int> CountryId { get; set; }

Property Value

System.Nullable<System.Int32>

AdministrativeAreal2DReference.Id Property

Gets or sets the ID of the administrative area.

public int Id { get; set; }

Property Value

System.Int32

AdministrativeAreal2DReference.MunicipalityId Property

Gets or sets the ID of the municipality.

public System.Nullable<int> MunicipalityId { get; set; }

Property Value

System.Nullable<System.Int32>

AdministrativeAreal2DReference.Name Property

Gets or sets the name of the administrative area.

public string? Name { get; set; }

Property Value

System.String

AdministrativeAreal2DReference.VoivodeshipId Property

Gets or sets the ID of the voivodeship.

public System.Nullable<int> VoivodeshipId { get; set; }

Property Value

System.Nullable<System.Int32>

Methods

AdministrativeAreal2DReference.GetIds() Method

Gets a list of ids in the record including own Id (in order: CountryId, VoivodeshipId, CountyId, MunicipalityId, Id). Null values are skipped.

public System.Collections.Generic.List<int> GetIds();

Returns

System.Collections.Generic.List<System.Int32>
A list of integer IDs representing the territorial hierarchy.

AdministrativeAreal2DReferencedObject<TUniqueObject> Class

Abstract base class for referenced objects associated with 2D administrative areas, providing identification properties.

public abstract class AdministrativeAreal2DReferencedObject<TUniqueObject> : DiGi.GIS.PostgreSQL.Classes.ReferencedObject<TUniqueObject>
    where TUniqueObject : DiGi.Core.Interfaces.IUniqueObject

Type parameters

TUniqueObject

The type of the unique object this referenced object points to.

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.GIS.PostgreSQL.Classes.TableSerializableObject<TUniqueObject> → DiGi.GIS.PostgreSQL.Classes.ReferencedObject<TUniqueObject> → AdministrativeAreal2DReferencedObject<TUniqueObject>

Derived
↳ AdministrativeAreal2DOccupancyData
↳ TypologyModel

Constructors

AdministrativeAreal2DReferencedObject() Constructor

Initializes a new instance of the AdministrativeAreal2DReferencedObject class.

public AdministrativeAreal2DReferencedObject();

AdministrativeAreal2DReferencedObject(AdministrativeAreal2DReferencedObject<TUniqueObject>) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencedObject class by copying data from another AdministrativeAreal2DReferencedObject instance.

public AdministrativeAreal2DReferencedObject(DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencedObject<TUniqueObject>? administrativeAreal2DReferencedObject);

Parameters

administrativeAreal2DReferencedObject DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencedObject<TUniqueObject>

The AdministrativeAreal2DReferencedObject instance to copy data from.

AdministrativeAreal2DReferencedObject(JsonObject) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencedObject class from a JsonObject.

public AdministrativeAreal2DReferencedObject(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Properties

AdministrativeAreal2DReferencedObject<TUniqueObject>.Id Property

Gets or sets the ID of the administrative area.

public int Id { get; set; }

Property Value

System.Int32

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject> Class

Provides an abstract base implementation for a PostgreSQL converter specifically designed for administrative areal 2D referenced objects.

public abstract class AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject> : DiGi.GIS.PostgreSQL.Classes.ReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject, TUniqueObject>
    where TAdministrativeAreal2DReferencedObject : DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencedObject<TUniqueObject>
    where TUniqueObject : DiGi.Core.Interfaces.IUniqueObject

Type parameters

TAdministrativeAreal2DReferencedObject

The type of the administrative areal 2D referenced object.

TUniqueObject

The type of the unique object used for identification, which must implement the DiGi.Core.Interfaces.IUniqueObject interface.

Inheritance System.Object → DiGi.PostgreSQL.Classes.PostgreSQLConverter<TAdministrativeAreal2DReferencedObject> → DiGi.GIS.PostgreSQL.Classes.ReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject> → AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>

Derived
↳ AdministrativeAreal2DOccupancyDataPostgreSQLConverter
↳ TypologyModelPostgreSQLConverter

Constructors

AdministrativeAreal2DReferencedObjectPostgreSQLConverter(ConnectionData) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject> class.

public AdministrativeAreal2DReferencedObjectPostgreSQLConverter(DiGi.PostgreSQL.Classes.ConnectionData? connectionData);

Parameters

connectionData DiGi.PostgreSQL.Classes.ConnectionData

The DiGi.PostgreSQL.Classes.ConnectionData containing the connection settings required to establish a connection to the PostgreSQL database. This value can be null.

Methods

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.Create(int, string, string, JsonObject, Nullable<DateTime>) Method

Creates a new instance of a <seeref name="TAdministrativeAreal2DReferencedObject" />.

protected abstract TAdministrativeAreal2DReferencedObject Create(int id, string? uniqueId, string? reference, System.Text.Json.Nodes.JsonObject? @object, System.Nullable<System.DateTime> createdAt);

Parameters

id System.Int32

The integer identifier for the object.

uniqueId System.String

The optional unique string identifier for the object.

reference System.String

The optional reference string associated with the object.

object System.Text.Json.Nodes.JsonObject

The optional System.Text.Json.Nodes.JsonObject containing additional data for the object.

createdAt System.Nullable<System.DateTime>

The optional System.DateTime indicating when the object was created.

Returns

TAdministrativeAreal2DReferencedObject
A new instance of <seeref name="TAdministrativeAreal2DReferencedObject" />.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.Create(NpgsqlDataReader) Method

Creates an instance of <seeref name="TAdministrativeAreal2DReferencedObject" /> using the data provided by the Npgsql.NpgsqlDataReader.

protected override TAdministrativeAreal2DReferencedObject Create(Npgsql.NpgsqlDataReader npgsqlDataReader);

Parameters

npgsqlDataReader Npgsql.NpgsqlDataReader

The Npgsql.NpgsqlDataReader used to read the record from the database.

Returns

TAdministrativeAreal2DReferencedObject
An instance of <seeref name="TAdministrativeAreal2DReferencedObject" /> populated with data from the reader.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetCountAsync(int, CancellationToken) Method

Asynchronously retrieves the total count of records.

public System.Threading.Tasks.Task<long> GetCountAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The timeout in seconds applied to the count command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total record count as a long integer.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetCountAsync(NpgsqlConnection, int, CancellationToken) Method

Asynchronously retrieves the total count of records from the database.

public static System.Threading.Tasks.Task<long> GetCountAsync(Npgsql.NpgsqlConnection? npgsqlConnection, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection instance used to execute the command.

commandTimeout System.Int32

The timeout in seconds applied to the count command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total count as a long integer.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetEstimatedCountAsync(bool, int, CancellationToken) Method

Asynchronously gets an estimated row count.

public System.Threading.Tasks.Task<System.Nullable<long>> GetEstimatedCountAsync(bool analyze=false, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

analyze System.Boolean

A boolean indicating whether to run VACUUM ANALYZE before fetching the count.

commandTimeout System.Int32

The timeout in seconds applied to every command executed. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to monitor for cancellation requests.

Returns

System.Threading.Tasks.Task<System.Nullable<System.Int64>>
A task that represents the asynchronous operation. The task result contains the estimated number of rows as a nullable long, -1 when the table exists but has not been analysed, or null if an error occurs or the table does not exist.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetEstimatedCountAsync(NpgsqlConnection, bool, int, CancellationToken) Method

Asynchronously retrieves an estimated count of records from the database.

public System.Threading.Tasks.Task<System.Nullable<long>> GetEstimatedCountAsync(Npgsql.NpgsqlConnection? npgsqlConnection, bool analyze=false, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection instance used to execute the command.

analyze System.Boolean

A boolean value indicating whether to perform an ANALYZE operation to update statistics before retrieving the estimate.

commandTimeout System.Int32

The timeout in seconds applied to every command executed. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<System.Nullable<System.Int64>>
A task that represents the asynchronous operation. The task result contains the estimated number of records as a nullable long, -1 when the table exists but has not been analysed, or null if the table does not exist or connection is null.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetItemByIdAsync(int, int, CancellationToken) Method

Asynchronously retrieves a <seeref name="TAdministrativeAreal2DReferencedObject" /> by its unique identifier.

public System.Threading.Tasks.Task<TAdministrativeAreal2DReferencedObject?> GetItemByIdAsync(int id, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The integer identifier of the item to retrieve.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe for cancellation requests.

Returns

System.Threading.Tasks.Task<TAdministrativeAreal2DReferencedObject>
A task that represents the asynchronous operation. The task result contains the <seeref name="TAdministrativeAreal2DReferencedObject" /> if found; otherwise, null.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetItemByReferenceAsync(string, int, CancellationToken) Method

Asynchronously retrieves an item of type <seeref name="TAdministrativeAreal2DReferencedObject" /> using the specified reference.

A reference can hold several rows, one per stored object, so this returns the most recently stored of them. Use GetItemsByReferenceAsync(string, Nullable<long>, int, CancellationToken) when the whole set is wanted.

public System.Threading.Tasks.Task<TAdministrativeAreal2DReferencedObject?> GetItemByReferenceAsync(string reference, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The string reference used to locate the object.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<TAdministrativeAreal2DReferencedObject>
A task that represents the asynchronous operation. The task result contains the <seeref name="TAdministrativeAreal2DReferencedObject" /> if an item with the specified reference is found; otherwise, null.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetItemsByIdsAsync(NpgsqlConnection, IEnumerable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D referenced objects based on the provided identifiers.

public System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>?> GetItemsByIdsAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<int>? ids, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the database.

ids System.Collections.Generic.IEnumerable<System.Int32>

A collection of integers representing the unique identifiers of the objects to retrieve.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

A token to observe for cancellation requests.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>>
A task that represents the asynchronous operation. The task result contains a list of <seeref name="TAdministrativeAreal2DReferencedObject" /> matching the provided identifiers, or null if the connection or the collection of identifiers is null.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetItemsByIdsAsync(IEnumerable<int>, int, CancellationToken) Method

Asynchronously retrieves a list of administrative areal 2D referenced objects based on the specified identifiers.

public System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>?> GetItemsByIdsAsync(System.Collections.Generic.IEnumerable<int>? ids, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

ids System.Collections.Generic.IEnumerable<System.Int32>

A collection of System.Int32 representing the unique identifiers of the items to retrieve. This parameter can be null.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.List<> of matching objects, or null if no items are found or the provided identifiers collection is null.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetItemsByReferenceAsync(string, Nullable<long>, int, CancellationToken) Method

Asynchronously retrieves a list of items that match the specified reference.

public System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>?> GetItemsByReferenceAsync(string reference, System.Nullable<long> limit=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The string reference used to identify the items.

limit System.Nullable<System.Int64>

An optional long integer specifying the maximum number of items to return.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe for cancellation requests.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>>
A task that represents the asynchronous operation. The task result contains a list of TAdministrativeAreal2DReferencedObject objects, or null if no items are found.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetItemsByReferencesAsync(NpgsqlConnection, IEnumerable<string>, Nullable<long>, int, CancellationToken) Method

Asynchronously retrieves items of type TAdministrativeAreal2DReferencedObject based on the provided references.

public System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>?> GetItemsByReferencesAsync(Npgsql.NpgsqlConnection? npgsqlConnection, System.Collections.Generic.IEnumerable<string>? references, System.Nullable<long> limit=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The PostgreSQL connection to use for the query.

references System.Collections.Generic.IEnumerable<System.String>

A collection of strings representing the references used to identify the items to retrieve.

limit System.Nullable<System.Int64>

An optional maximum number of items to retrieve. If null, no limit is applied.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>>
A task that represents the asynchronous operation. The task result contains a list of matching TAdministrativeAreal2DReferencedObject items, or null if the connection or references are null.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.GetItemsByReferencesAsync(IEnumerable<string>, Nullable<long>, int, CancellationToken) Method

Asynchronously retrieves a list of items that match the specified references.

public System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>?> GetItemsByReferencesAsync(System.Collections.Generic.IEnumerable<string>? references, System.Nullable<long> limit=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

references System.Collections.Generic.IEnumerable<System.String>

An optional collection of strings representing the references of the objects to retrieve.

limit System.Nullable<System.Int64>

An optional long integer specifying the maximum number of items to be returned.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<TAdministrativeAreal2DReferencedObject>>
A task that represents the asynchronous operation. The task result contains a list of <seeref name="TAdministrativeAreal2DReferencedObject" /> objects, or null if no matching items are found or the references collection is null.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.RemoveByUniqueIdsAsync(IEnumerable<string>, string, int, CancellationToken) Method

Deletes single stored objects from the set held for one administrative area, naming each of them by its own unique identifier.

An area can hold several rows in this table - one per stored object - so this is the delete half of updating a single object: read the set with GetItemsByReferenceAsync(string, Nullable<long>, int, CancellationToken), pick the one to change, remove it here, then write the replacement.

unique_id already identifies the row on its own - the table declares it UNIQUE. The reference is required as well and is matched as a guard, so a unique identifier belonging to a different area cannot silently take out that area's object.

It removes data and has no undo - read AI Guidelines/Coding - GIS Administrative Data.md before calling it.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> RemoveByUniqueIdsAsync(System.Collections.Generic.IEnumerable<string>? uniqueIds, string reference, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

uniqueIds System.Collections.Generic.IEnumerable<System.String>

The unique identifiers of the stored objects to delete.

reference System.String

The reference of the administrative area the objects belong to.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains the identifiers of the rows actually deleted, which is how many of the unique identifiers were really there.

AdministrativeAreal2DReferencedObjectPostgreSQLConverter<TAdministrativeAreal2DReferencedObject,TUniqueObject>.UpdateAsync(IEnumerable<TAdministrativeAreal2DReferencedObject>, int) Method

Asynchronously updates the specified collection of administrative areal 2D referenced objects.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<int>?> UpdateAsync(System.Collections.Generic.IEnumerable<TAdministrativeAreal2DReferencedObject>? administrativeAreal2DReferencedObjects, int commandTimeout=30);

Parameters

administrativeAreal2DReferencedObjects System.Collections.Generic.IEnumerable<TAdministrativeAreal2DReferencedObject>

The collection of <seeref name="TAdministrativeAreal2DReferencedObject" /> objects to be updated.

commandTimeout System.Int32

The timeout in seconds for the execution of the batch. A value of 0 disables the timeout.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<System.Int32>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of integers representing the IDs of the updated objects, or null if no objects were updated.

AdministrativeAreal2DReferencePath Class

Represents a collection of administrative 2D area references indexed by their administrative area type.

public class AdministrativeAreal2DReferencePath : DiGi.Core.Classes.SerializableObject, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLSerializableObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → AdministrativeAreal2DReferencePath

Implements IGISPostgreSQLSerializableObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject

Constructors

AdministrativeAreal2DReferencePath() Constructor

Initializes a new instance of the AdministrativeAreal2DReferencePath class.

public AdministrativeAreal2DReferencePath();

AdministrativeAreal2DReferencePath(AdministrativeAreal2DReferencePath) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencePath class by copying data from another AdministrativeAreal2DReferencePath instance.

public AdministrativeAreal2DReferencePath(DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReferencePath? administrativeAreal2DReferencePath);

Parameters

administrativeAreal2DReferencePath AdministrativeAreal2DReferencePath

The AdministrativeAreal2DReferencePath instance to copy data from.

AdministrativeAreal2DReferencePath(IEnumerable<AdministrativeAreal2DReference>) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencePath class from a collection of administrative 2D area references.

public AdministrativeAreal2DReferencePath(System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference> administrativeAreal2DReferences);

Parameters

administrativeAreal2DReferences System.Collections.Generic.IEnumerable<AdministrativeAreal2DReference>

The collection of administrative 2D area references to add.

AdministrativeAreal2DReferencePath(JsonObject) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencePath class from a JsonObject.

public AdministrativeAreal2DReferencePath(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Fields

AdministrativeAreal2DReferencePath.dictionary Field

Gets or sets the dictionary of administrative 2D area references indexed by type.

private readonly Dictionary<AdministrativeArealType,AdministrativeAreal2DReference> dictionary;

Field Value

System.Collections.Generic.Dictionary<AdministrativeArealType,AdministrativeAreal2DReference>

Properties

AdministrativeAreal2DReferencePath.AdministrativeAreal2DReferences Property

Gets or sets the list of administrative 2D area references, serialized in enum order.

public System.Collections.Generic.List<DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference> AdministrativeAreal2DReferences { get; set; }

Property Value

System.Collections.Generic.List<AdministrativeAreal2DReference>

AdministrativeAreal2DReferencePath.this[AdministrativeArealType] Property

Gets the administrative 2D area reference for the specified administrative area type.

public DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference? this[DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType] { get; }

Parameters

administrativeArealType AdministrativeArealType

The administrative area type to look up.

Property Value

AdministrativeAreal2DReference

Methods

AdministrativeAreal2DReferencePath.Add(AdministrativeAreal2DReference) Method

Adds an administrative 2D area reference to the collection.

public bool Add(DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DReference? administrativeAreal2DReference);

Parameters

administrativeAreal2DReference AdministrativeAreal2DReference

The administrative 2D area reference to add.

Returns

System.Boolean
True if the reference was added successfully; otherwise, false.

AdministrativeAreal2DReferencePath.Remove(AdministrativeArealType) Method

Removes the administrative 2D area reference for the specified administrative area type.

public bool Remove(DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType);

Parameters

administrativeArealType AdministrativeArealType

The administrative area type to remove.

Returns

System.Boolean
True if the reference was removed successfully; otherwise, false.

Areal2D<TAreal2D> Class

Abstract generic class for 2D area entities with bounding box and code information.

public abstract class Areal2D<TAreal2D> : DiGi.GIS.PostgreSQL.Classes.ReferencedObject<TAreal2D>
    where TAreal2D : DiGi.GIS.Classes.Areal2D

Type parameters

TAreal2D

The type of the underlying GIS 2D area object.

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.GIS.PostgreSQL.Classes.TableSerializableObject<TAreal2D> → DiGi.GIS.PostgreSQL.Classes.ReferencedObject<TAreal2D> → Areal2D<TAreal2D>

Derived
↳ AdministrativeAreal2D
↳ Building2D

Constructors

Areal2D() Constructor

Initializes a new instance of the Areal2D class.

public Areal2D();

Areal2D(Areal2D<TAreal2D>) Constructor

Initializes a new instance of the Areal2D class by copying data from another Areal2D instance.

public Areal2D(DiGi.GIS.PostgreSQL.Classes.Areal2D<TAreal2D>? areal2D);

Parameters

areal2D DiGi.GIS.PostgreSQL.Classes.Areal2D<TAreal2D>

The Areal2D instance to copy data from.

Areal2D(JsonObject) Constructor

Initializes a new instance of the Areal2D class from a JsonObject.

public Areal2D(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Properties

Areal2D<TAreal2D>.BoundingBox2D Property

Gets or sets the bounding box of the 2D area.

public DiGi.Geometry.Planar.Classes.BoundingBox2D? BoundingBox2D { get; set; }

Property Value

DiGi.Geometry.Planar.Classes.BoundingBox2D

Areal2D<TAreal2D>.Code Property

Gets or sets the code of the 2D area.

public string? Code { get; set; }

Property Value

System.String

Areal2DReference Class

Abstract base class for 2D area references, providing serialization and common properties for area-based data.

public abstract class Areal2DReference : DiGi.Core.Classes.SerializableObject

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Areal2DReference

Derived
↳ AdministrativeAreal2DReference
↳ Building2DCentroid
↳ Building2DReference
↳ OrtoDatasReference

Constructors

Areal2DReference() Constructor

Initializes a new instance of the Areal2DReference class.

public Areal2DReference();

Areal2DReference(Areal2DReference) Constructor

Initializes a new instance of the Areal2DReference class by copying data from another Areal2DReference instance.

public Areal2DReference(DiGi.GIS.PostgreSQL.Classes.Areal2DReference? areal2DReference);

Parameters

areal2DReference Areal2DReference

The Areal2DReference instance to copy data from.

Areal2DReference(JsonObject) Constructor

Initializes a new instance of the Areal2DReference class from a JsonObject.

public Areal2DReference(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Properties

Areal2DReference.CountyId Property

Gets or sets the county ID associated with this item.

This is the identifier of an administrative_areal_2d row, which is one polygon part of a county rather than the whole county - a multi-part county has several such identifiers. It is the parent county, so it is null on a reference that already is a county.

public System.Nullable<int> CountyId { get; set; }

Property Value

System.Nullable<System.Int32>

Areal2DReference.Reference Property

Gets or sets the reference string associated with this item.

Not globally unique: the same building reference is stored once per county row it was imported under, so it is unique only in combination with CountyId. Roughly 86 000 building_2d rows are duplicated this way across sibling parts of multi-part counties.

public string? Reference { get; set; }

Property Value

System.String

Building Class

Represents a building database row envelope that references a DiGi.CityGML.Classes.Building object, extending Building2DReferencedObject<TUniqueObject> with bounding box, level of detail, and construction year information.

public class Building : DiGi.GIS.PostgreSQL.Classes.Building2DReferencedObject<DiGi.CityGML.Classes.Building>

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.GIS.PostgreSQL.Classes.TableSerializableObject<DiGi.CityGML.Classes.Building> → DiGi.GIS.PostgreSQL.Classes.ReferencedObject<DiGi.CityGML.Classes.Building> → DiGi.GIS.PostgreSQL.Classes.Building2DReferencedObject<DiGi.CityGML.Classes.Building> → Building

Constructors

Building() Constructor

Initializes a new instance of the Building class.

public Building();

Building(Building) Constructor

Initializes a new instance of the Building class by copying data from another Building instance.

public Building(DiGi.GIS.PostgreSQL.Classes.Building? building);

Parameters

building Building

The Building instance to copy data from.

Building(JsonObject) Constructor

Initializes a new instance of the Building class from a System.Text.Json.Nodes.JsonObject.

public Building(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the serialized data.

Properties

Building.BoundingBox3D Property

Gets or sets the 3D bounding box of the building.

public DiGi.Geometry.Spatial.Classes.BoundingBox3D? BoundingBox3D { get; set; }

Property Value

DiGi.Geometry.Spatial.Classes.BoundingBox3D

Building.LOD Property

Gets or sets the CityGML level of detail of the building.

public System.Nullable<DiGi.CityGML.Enums.LOD> LOD { get; set; }

Property Value

System.Nullable<DiGi.CityGML.Enums.LOD>

Building.Year Property

Gets or sets the construction year of the building.

public System.Nullable<short> Year { get; set; }

Property Value

System.Nullable<System.Int16>

Building2D Class

Represents a 2D building entity with county and subdivision identification.

public class Building2D : DiGi.GIS.PostgreSQL.Classes.Areal2D<DiGi.GIS.Classes.Building2D>

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.GIS.PostgreSQL.Classes.TableSerializableObject<DiGi.GIS.Classes.Building2D> → DiGi.GIS.PostgreSQL.Classes.ReferencedObject<DiGi.GIS.Classes.Building2D> → DiGi.GIS.PostgreSQL.Classes.Areal2D<DiGi.GIS.Classes.Building2D> → Building2D

Constructors

Building2D() Constructor

Initializes a new instance of the Building2D class.

public Building2D();

Building2D(Building2D) Constructor

Initializes a new instance of the Building2D class by copying data from another Building2D instance.

public Building2D(DiGi.GIS.PostgreSQL.Classes.Building2D? building2D);

Parameters

building2D Building2D

The Building2D instance to copy data from.

Building2D(JsonObject) Constructor

Initializes a new instance of the Building2D class from a JsonObject.

public Building2D(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Properties

Building2D.CountyId Property

Gets or sets the ID of the county associated with this building.

public System.Nullable<int> CountyId { get; set; }

Property Value

System.Nullable<System.Int32>

Building2D.Id Property

Gets or sets the unique ID of the building.

public long Id { get; set; }

Property Value

System.Int64

Building2D.SubdivisionId Property

Gets or sets the ID of the subdivision to which this building belongs.

public System.Nullable<int> SubdivisionId { get; set; }

Property Value

System.Nullable<System.Int32>

Building2DCentroid Class

Represents the bounding-box centre (centroid) of a 2D building, keyed by its reference and county partition, for fast 2D dot rendering without loading the full geometry.

Reference is unique only in combination with CountyId - a building reference is stored once per county part it was imported under, so the county identifier must travel with the reference for any caller-side join. Row order on the wire is not contractual.

public class Building2DCentroid : DiGi.GIS.PostgreSQL.Classes.Areal2DReference

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Areal2DReference → Building2DCentroid

Constructors

Building2DCentroid() Constructor

Initializes a new instance of the Building2DCentroid class.

public Building2DCentroid();

Building2DCentroid(Building2DCentroid) Constructor

Initializes a new instance of the Building2DCentroid class by copying data from another Building2DCentroid instance.

public Building2DCentroid(DiGi.GIS.PostgreSQL.Classes.Building2DCentroid? building2DCentroid);

Parameters

building2DCentroid Building2DCentroid

The Building2DCentroid instance to copy data from.

Building2DCentroid(JsonObject) Constructor

Initializes a new instance of the Building2DCentroid class from a JsonObject.

public Building2DCentroid(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Properties

Building2DCentroid.X Property

Gets or sets the X coordinate of the centroid.

public double X { get; set; }

Property Value

System.Double

Building2DCentroid.Y Property

Gets or sets the Y coordinate of the centroid.

public double Y { get; set; }

Property Value

System.Double

Building2DCountyPartMismatchResult Class

Reports how many 2D buildings held by one polygon part of a multi-part county lie outside that part.

A county code names one administrative_areal_2d row per polygon part, and a building is filed under one of them. This counts, for one part, the rows whose stored bounding box does not even touch the bounding box of the part holding them - a building that cannot be inside the part it is filed under, decided without deserializing a single geometry.

The figure is a lower bound: a building sitting inside the part's bounding box but outside its polygon is not counted, because settling that needs the polygon. Nothing counted here is a false alarm, which is what makes it usable as the before and after measurement of a repair.

public class Building2DCountyPartMismatchResult : DiGi.Core.Classes.SerializableResult, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLSerializableObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.Core.Classes.SerializableResult → Building2DCountyPartMismatchResult

Implements IGISPostgreSQLSerializableObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject

Constructors

Building2DCountyPartMismatchResult(Building2DCountyPartMismatchResult) Constructor

Initializes a new instance of the Building2DCountyPartMismatchResult class by copying an existing one.

public Building2DCountyPartMismatchResult(DiGi.GIS.PostgreSQL.Classes.Building2DCountyPartMismatchResult? building2DCountyPartMismatchResult);

Parameters

building2DCountyPartMismatchResult Building2DCountyPartMismatchResult

The Building2DCountyPartMismatchResult instance to copy.

Building2DCountyPartMismatchResult(string, int, IEnumerable<int>, long, long) Constructor

Initializes a new instance of the Building2DCountyPartMismatchResult class.

public Building2DCountyPartMismatchResult(string? code, int countyId, System.Collections.Generic.IEnumerable<int>? countyIds, long count, long countOutsideBoundingBox);

Parameters

code System.String

The county code the part belongs to.

countyId System.Int32

The identifier of the county polygon part holding the buildings.

countyIds System.Collections.Generic.IEnumerable<System.Int32>

Every polygon part identifier the code holds, the part itself included.

count System.Int64

The number of buildings held by the part.

countOutsideBoundingBox System.Int64

The number of those buildings whose bounding box does not intersect the bounding box of the part holding them.

Building2DCountyPartMismatchResult(JsonObject) Constructor

Initializes a new instance of the Building2DCountyPartMismatchResult class from a System.Text.Json.Nodes.JsonObject.

public Building2DCountyPartMismatchResult(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing the serialized data.

Properties

Building2DCountyPartMismatchResult.Code Property

Gets the county code the part belongs to.

public string? Code { get; }

Property Value

System.String

Building2DCountyPartMismatchResult.Count Property

Gets the number of buildings held by the part.

public long Count { get; }

Property Value

System.Int64

Building2DCountyPartMismatchResult.CountOutsideBoundingBox Property

Gets the number of buildings held by the part whose bounding box does not intersect the bounding box of that part.

public long CountOutsideBoundingBox { get; }

Property Value

System.Int64

Building2DCountyPartMismatchResult.CountyId Property

Gets the identifier of the county polygon part holding the buildings.

public int CountyId { get; }

Property Value

System.Int32

Building2DCountyPartMismatchResult.CountyIds Property

Gets every polygon part identifier the code holds, the part itself included.

public System.Collections.Generic.List<int>? CountyIds { get; }

Property Value

System.Collections.Generic.List<System.Int32>

Building2DOccupancyData Class

Represents occupancy data associated with a 2D building.

public class Building2DOccupancyData : DiGi.GIS.PostgreSQL.Classes.Building2DReferencedObject<DiGi.GIS.Interfaces.IOccupancyData>

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.GIS.PostgreSQL.Classes.TableSerializableObject<DiGi.GIS.Interfaces.IOccupancyData> → DiGi.GIS.PostgreSQL.Classes.ReferencedObject<DiGi.GIS.Interfaces.IOccupancyData> → DiGi.GIS.PostgreSQL.Classes.Building2DReferencedObject<DiGi.GIS.Interfaces.IOccupancyData> → Building2DOccupancyData

Constructors

Building2DOccupancyData() Constructor

Initializes a new instance of the Building2DOccupancyData class.

public Building2DOccupancyData();

Building2DOccupancyData(Building2DOccupancyData) Constructor

Initializes a new instance of the Building2DOccupancyData class by copying data from another Building2DOccupancyData instance.

public Building2DOccupancyData(DiGi.GIS.PostgreSQL.Classes.Building2DOccupancyData? building2DOccupancyData);

Parameters

building2DOccupancyData Building2DOccupancyData

The Building2DOccupancyData instance to copy data from.

Building2DOccupancyData(JsonObject) Constructor

Initializes a new instance of the Building2DOccupancyData class from a JsonObject.

public Building2DOccupancyData(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JsonObject containing the serialized data.

Building2DOccupancyDataPostgreSQLConverter Class

Provides functionality to convert building 2D occupancy data for PostgreSQL database operations.

public class Building2DOccupancyDataPostgreSQLConverter : DiGi.GIS.PostgreSQL.Classes.Building2DReferencedObjectPostgreSQLConverter<DiGi.GIS.PostgreSQL.Classes.Building2DOccupancyData, DiGi.GIS.Interfaces.IOccupancyData>

Inheritance System.Object → DiGi.PostgreSQL.Classes.PostgreSQLConverter<Building2DOccupancyData> → DiGi.GIS.PostgreSQL.Classes.ReferencedObjectPostgreSQLConverter<Building2DOccupancyData,DiGi.GIS.Interfaces.IOccupancyData> → DiGi.GIS.PostgreSQL.Classes.Building2DReferencedObjectPostgreSQLConverter<Building2DOccupancyData,DiGi.GIS.Interfaces.IOccupancyData> → Building2DOccupancyDataPostgreSQLConverter

Constructors

Building2DOccupancyDataPostgreSQLConverter(ConnectionData) Constructor

Initializes a new instance of the Building2DOccupancyDataPostgreSQLConverter class.

public Building2DOccupancyDataPostgreSQLConverter(DiGi.PostgreSQL.Classes.ConnectionData? connectionData);

Parameters

connectionData DiGi.PostgreSQL.Classes.ConnectionData

The connection data used to connect to the PostgreSQL database.

Properties

Building2DOccupancyDataPostgreSQLConverter.TableName Property

Gets the name of the table in the PostgreSQL database where building 2D occupancy data is stored.

public override string TableName { get; }

Property Value

System.String

Building2DPostgreSQLConverter Class

Provides functionality for converting and managing Building2D entities within a PostgreSQL database, implementing the IGISPostgreSQLConverter<TTableObject> interface.

county_id is a polygon part, not a county. It points at an administrative_areal_2d row, and a county whose territory is disconnected has one such row per part - so the buildings of a single county can be spread over several county_id values, and querying one part never returns the whole county. See AdministrativeAreal2DPostgreSQLConverter for the storage model.

reference assures row uniqueness. Each building reference uniquely identifies a Building2D record in the database. county_id can be used to scope queries to a specific partition for performance optimization (partition pruning), but is not required for uniqueness. Lookups keyed on reference alone or using fallback search by reference are safe and reliable.

public class Building2DPostgreSQLConverter : DiGi.PostgreSQL.Classes.PostgreSQLConverter<DiGi.GIS.PostgreSQL.Classes.Building2D>, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLConverter<DiGi.GIS.PostgreSQL.Classes.Building2D>, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLObject, DiGi.Core.Interfaces.IObject, DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLObject

Inheritance System.Object → DiGi.PostgreSQL.Classes.PostgreSQLConverter<Building2D> → Building2DPostgreSQLConverter

Implements DiGi.GIS.PostgreSQL.Interfaces.IGISPostgreSQLConverter<Building2D>, IGISPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLConverter, DiGi.PostgreSQL.Interfaces.IPostgreSQLObject, DiGi.Core.Interfaces.IObject, IGISPostgreSQLObject

Constructors

Building2DPostgreSQLConverter(ConnectionData) Constructor

Initializes a new instance of the Building2DPostgreSQLConverter class.

public Building2DPostgreSQLConverter(DiGi.PostgreSQL.Classes.ConnectionData? connectionData);

Parameters

connectionData DiGi.PostgreSQL.Classes.ConnectionData

The DiGi.PostgreSQL.Classes.ConnectionData containing the connection settings for the PostgreSQL database, or null.

Methods

Building2DPostgreSQLConverter.CentroidFromBoundingBox(Nullable<double>, Nullable<double>, Nullable<double>, Nullable<double>) Method

Computes the centre of a bounding box: ((min_x + max_x) / 2, (min_y + max_y) / 2.

The single implementation of the centroid arithmetic shared by GetPoint2DsByReferencesAsync(NpgsqlConnection, IEnumerable<string>, Nullable<int>, bool, int, CancellationToken) and GetBuilding2DCentroidsByCountyIdAsync(NpgsqlConnection, int, IEnumerable<int>, int, CancellationToken). A component that is missing or NaN means the row holds no usable bounding box, so no centre is returned for it.

public static DiGi.Geometry.Planar.Classes.Point2D? CentroidFromBoundingBox(System.Nullable<double> minX, System.Nullable<double> minY, System.Nullable<double> maxX, System.Nullable<double> maxY);

Parameters

minX System.Nullable<System.Double>

The minimum X of the bounding box, or null when the column is NULL.

minY System.Nullable<System.Double>

The minimum Y of the bounding box, or null when the column is NULL.

maxX System.Nullable<System.Double>

The maximum X of the bounding box, or null when the column is NULL.

maxY System.Nullable<System.Double>

The maximum Y of the bounding box, or null when the column is NULL.

Returns

DiGi.Geometry.Planar.Classes.Point2D
The centre of the box, or null when any component is missing or NaN.

Building2DPostgreSQLConverter.ClearAsync(int, CancellationToken) Method

Asynchronously clears all data from the specified table and restarts its identity sequence.

public System.Threading.Tasks.Task<bool> ClearAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Boolean>
A System.Threading.Tasks.Task<> representing the asynchronous operation. The result is a System.Boolean indicating true if the operation succeeded; otherwise, false.

Building2DPostgreSQLConverter.CountAsync(int, IEnumerable<int>, int, CancellationToken) Method

Asynchronously counts the number of 2D buildings for a specified county, with optional filtering by subdivision identifiers.

public System.Threading.Tasks.Task<long> CountAsync(int countyId, System.Collections.Generic.IEnumerable<int>? subdivisionIds=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The integer identifier of the county (Partition Key).

subdivisionIds System.Collections.Generic.IEnumerable<System.Int32>

An optional collection of integers representing the subdivision identifiers to filter the results.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total count as a long integer, or -1 if the connection is null.

Building2DPostgreSQLConverter.CountAsync(NpgsqlConnection, int, IEnumerable<int>, int, CancellationToken) Method

Asynchronously counts the number of 2D buildings for a specified county, with optional filtering by subdivision identifiers.

public static System.Threading.Tasks.Task<long> CountAsync(Npgsql.NpgsqlConnection? npgsqlConnection, int countyId, System.Collections.Generic.IEnumerable<int>? subdivisionIds=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

npgsqlConnection Npgsql.NpgsqlConnection

The Npgsql.NpgsqlConnection used to connect to the PostgreSQL database.

countyId System.Int32

The integer identifier of the county (Partition Key).

subdivisionIds System.Collections.Generic.IEnumerable<System.Int32>

An optional collection of integers representing the subdivision identifiers to filter the results.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total count as a long integer, or -1 if the connection is null.

Building2DPostgreSQLConverter.CountAsync(IEnumerable<int>, int, CancellationToken) Method

Asynchronously counts the number of 2D buildings for a specified administrative areal 2D identifiers.

public System.Threading.Tasks.Task<long> CountAsync(System.Collections.Generic.IEnumerable<int> administrativeAreal2DIds, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DIds System.Collections.Generic.IEnumerable<System.Int32>

A collection of integers representing the administrative areal 2D identifiers to filter by.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Int64>
Number of buidlings in the specified administrative areas.

Building2DPostgreSQLConverter.CreateTableAsync(int, CancellationToken) Method

Asynchronously creates the table in the database.

public System.Threading.Tasks.Task<bool> CreateTableAsync(int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

commandTimeout System.Int32

The time interval, in seconds, to wait for the command to complete before timing out. The default value is 30 seconds.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the table was successfully created.

Building2DPostgreSQLConverter.GetBuilding2DByIdAsync(long, Nullable<int>, int, CancellationToken) Method

Asynchronously retrieves a Building2D instance by its unique identifier and an optional county identifier.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.Building2D?> GetBuilding2DByIdAsync(long id, System.Nullable<int> countyId, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int64

The long unique identifier of the building to retrieve.

countyId System.Nullable<System.Int32>

The optional integer identifier of the county used to scope the search.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Building2D>
A task that represents the asynchronous operation. The task result contains the Building2D instance if found; otherwise, null.

Building2DPostgreSQLConverter.GetBuilding2DByPoint2DAsync(Point2D, double, int, CancellationToken) Method

Asynchronously retrieves a Building2D located at or near the specified 2D point within a given tolerance.

The subdivisions covering the point are tried first, then every county polygon part the point can be filed under - not only the part whose polygon covers it. A county whose territory is disconnected is stored as one row per part and its buildings can sit under a sibling part, so resolving the covering part alone answers nothing at all in those counties.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.Building2D?> GetBuilding2DByPoint2DAsync(DiGi.Geometry.Planar.Classes.Point2D? point2D, double tolerance=0.001, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

point2D DiGi.Geometry.Planar.Classes.Point2D

The DiGi.Geometry.Planar.Classes.Point2D coordinate to search for. This value can be null.

tolerance System.Double

The System.Double distance tolerance used to determine if a building is associated with the given point. Defaults to DiGi.Core.Constants.Tolerance.MacroDistance.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<Building2D>
A task that represents the asynchronous operation. The task result contains the Building2D found at the specified location, or null if no building is found within the tolerance or if the provided point is null.

Building2DPostgreSQLConverter.GetBuilding2DByReferenceAsync(string, Nullable<int>, bool, int, CancellationToken) Method

Asynchronously retrieves a Building2D instance based on the specified reference string and an optional county identifier.

public System.Threading.Tasks.Task<DiGi.GIS.PostgreSQL.Classes.Building2D?> GetBuilding2DByReferenceAsync(string reference, System.Nullable<int> countyId, bool fallbackByReference=false, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The System.String reference used to identify the building.

countyId System.Nullable<System.Int32>

The optional nullable integer identifier for the county.

fallbackByReference System.Boolean

A boolean value indicating whether to perform a fallback search by reference alone if the building is not found in the specified county.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout.

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task<Building2D>
A task that represents the asynchronous operation. The task result contains the Building2D instance if found; otherwise, null.

Building2DPostgreSQLConverter.GetBuilding2DCentroidsByAdministrativeAreal2DIdsAsync(IEnumerable<int>, int, CancellationToken) Method

Asynchronously retrieves the bounding-box centres of the buildings associated with the specified administrative areal 2D identifiers, each keyed by its reference and county partition.

Resolution is identical to GetBuilding2DReferencesByAdministrativeAreal2DIdsAsync(IEnumerable<int>, int, CancellationToken): an identifier above the subdivision level goes through Subdivision children, not geometry, so one with no subdivisions yields an empty list, which does not mean the area holds no buildings; a Subdivision identifier goes through its polygon instead, because the subdivision layer is nested and subdivision_id membership cannot name the buildings of a district (issue #75). Only the bounding-box columns are read on either path - the JSONB object column is never touched - which makes this the fast path for 2D dot rendering of a whole area.

public System.Threading.Tasks.Task<System.Collections.Generic.List<

Clone this wiki locally