Skip to content

DiGi.GIS.WebAPI.Classes

github-actions[bot] edited this page Sep 23, 2026 · 3 revisions

DiGi.GIS.WebAPI.Classes Namespace

Classes

AdministrativeAreal2DController Class

Web API controller for administrative area 2D operations, providing endpoints to retrieve, filter, and update administrative area data.

public class AdministrativeAreal2DController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → AdministrativeAreal2DController

Constructors

AdministrativeAreal2DController(GISWebAPIConfigurationFileWatcher, AdministrativeAreal2DPostgreSQLConverter) Constructor

Initializes a new instance of the AdministrativeAreal2DController class.

public AdministrativeAreal2DController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter administrativeAreal2DPostgreSQLConverter);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The configuration file watcher for the GIS PostgreSQL Web API.

administrativeAreal2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter

The converter used for administrative area 2D PostgreSQL operations.

Methods

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

Gets an administrative area reference by its code and type.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferenceByCodeAsync(string? code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The unique code of the administrative area.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The type of the administrative area.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferenceByIdAsync(int, CancellationToken) Method

Retrieves an administrative area reference by its identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferenceByIdAsync(int id, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The unique identifier of the administrative area reference to retrieve.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencePathByIdAsync(int, CancellationToken) Method

Retrieves the administrative area reference path by its identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferencePathByIdAsync(int id, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The unique identifier of the administrative area reference path to retrieve.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencePathsByNameAsync(string, CancellationToken) Method

Retrieves administrative area reference paths by name.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferencePathsByNameAsync(string text, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

text System.String

The search text used to find matching administrative area reference paths.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencePathsByNameParameterAsync(AdministrativeAreal2DReferencePathsByNameParameter, CancellationToken) Method

Retrieves administrative area reference paths by name parameter.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferencePathsByNameParameterAsync(DiGi.GIS.WebAPI.Classes.AdministrativeAreal2DReferencePathsByNameParameter administrativeAreal2DReferencePathsByNameParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DReferencePathsByNameParameter AdministrativeAreal2DReferencePathsByNameParameter

The parameter containing the search term for querying administrative areas by name.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

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

Retrieves all administrative area references filtered by administrative area type.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferencesByAdministrativeArealTypeAsync(System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Nullable<int> parentId, System.Nullable<bool> uniqueCode, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The administrative area type used to filter the references. Bound as nullable so an omitted parameter can be rejected: a non-nullable binding would silently take DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType.Country, because that is default of the enum while DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType.Undefined is -1.

parentId System.Nullable<System.Int32>

The optional parent identifier used for filtering.

uniqueCode System.Nullable<System.Boolean>

An optional flag indicating whether to filter by unique code.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencesByCodeAsync(string, Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves administrative area references by their code.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferencesByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The unique identifier or code used to retrieve the administrative area references.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

An optional filter specifying the type of administrative area.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencesByIdsAsync(List<int>, CancellationToken) Method

Retrieves administrative area references by a list of identifiers.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferencesByIdsAsync(System.Collections.Generic.List<int> ids, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The list of unique identifiers of the administrative areas to retrieve.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencesByNameParameterAsync(AdministrativeAreal2DReferencesByNameParameter, CancellationToken) Method

Retrieves administrative area references by name parameter.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DReferencesByNameParameterAsync(DiGi.GIS.WebAPI.Classes.AdministrativeAreal2DReferencesByNameParameter administrativeAreal2DReferencesByNameParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DReferencesByNameParameter AdministrativeAreal2DReferencesByNameParameter

The parameter containing the search term for querying administrative area references by name.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetBoundingBox2DAsync(CancellationToken) Method

Asynchronously retrieves the 2D bounding box enclosing country administrative areas.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBoundingBox2DAsync(System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the called method to indicate that the operation should be canceled.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetCodesAsync() Method

Retrieves all available administrative area codes.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCodesAsync();

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetCountAsync(CancellationToken) Method

Retrieves the count of administrative areas.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCountAsync(System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

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

Retrieves the identifier for a given code.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetIdByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The unique code of the administrative area.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The optional type of the administrative area to filter the search.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetIdsByAdministrativeArealTypeAsync(Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves all identifiers for a given administrative area type.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetIdsByAdministrativeArealTypeAsync(System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The administrative area type. Bound as nullable so an omitted parameter can be rejected: a non-nullable binding would silently take DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType.Country, because that is default of the enum while DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType.Undefined is -1.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

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

Retrieves all identifiers for a given code.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetIdsByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The code of the administrative area.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The optional type of the administrative area to filter the search.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetItemByCodeAsync(string, Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves an administrative area item by its code and optional type.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The unique code of the administrative area to retrieve.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The optional type of the administrative area to filter the search.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetItemByIdAsync(int, CancellationToken) Method

Asynchronously retrieves an administrative area item by its unique identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByIdAsync(int id, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The integer identifier of the administrative area item to retrieve.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetItemsByAdministrativeArealTypeAsync(Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves all administrative area items filtered by administrative area type.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByAdministrativeArealTypeAsync(System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The administrative area type used to filter the results. Bound as nullable so an omitted parameter can be rejected: a non-nullable binding would silently take DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType.Country, because that is default of the enum while DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType.Undefined is -1.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetItemsByBoundingBoxAsync(double, double, double, double, Nullable<double>, Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves administrative area items within a specified bounding box.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByBoundingBoxAsync(double x_1, double y_1, double x_2, double y_2, System.Nullable<double> tolerance, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x_1 System.Double

The X-coordinate of the first corner of the bounding box.

y_1 System.Double

The Y-coordinate of the first corner of the bounding box.

x_2 System.Double

The X-coordinate of the second corner of the bounding box.

y_2 System.Double

The Y-coordinate of the second corner of the bounding box.

tolerance System.Nullable<System.Double>

An optional tolerance value for the spatial query. If not provided, a default macro distance is used.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

An optional filter to restrict results to a specific type of administrative area.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetItemsByCircleAsync(double, double, Nullable<double>, Nullable<double>, Nullable<double>, Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves administrative area items within a specified circle.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByCircleAsync(double x, double y, System.Nullable<double> radius, System.Nullable<double> diameter, System.Nullable<double> tolerance, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x System.Double

The X-coordinate of the center point of the search circle.

y System.Double

The Y-coordinate of the center point of the search circle.

radius System.Nullable<System.Double>

The radius of the search circle.

diameter System.Nullable<System.Double>

The diameter of the search circle.

tolerance System.Nullable<System.Double>

The tolerance value for the spatial query.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The type of administrative area to retrieve.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult containing a list of administrative area items if found, or an error response.

AdministrativeAreal2DController.GetItemsByCodeAsync(string, Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves administrative area items filtered by code.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByCodeAsync(string code, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The code used to filter the administrative area items.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The optional type of administrative area to filter by.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult containing a list of matching administrative area items, or an error response if the code is invalid or no items are found.

AdministrativeAreal2DController.GetItemsByCodesAsync(List<string>, CancellationToken) Method

Retrieves administrative area items filtered by multiple codes.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByCodesAsync(System.Collections.Generic.List<string> codes, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The list of codes used to filter the administrative area items.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetItemsByIdsAsync(List<int>, CancellationToken) Method

Retrieves administrative area items filtered by a list of identifiers.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByIdsAsync(System.Collections.Generic.List<int> ids, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The list of identifiers used to retrieve the administrative area items.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetItemsByPointAsync(double, double, Nullable<double>, Nullable<AdministrativeArealType>, CancellationToken) Method

Retrieves administrative area items at or near a specified point.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByPointAsync(double x, double y, System.Nullable<double> tolerance, System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType> administrativeArealType, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x System.Double

The X-coordinate of the search point.

y System.Double

The Y-coordinate of the search point.

tolerance System.Nullable<System.Double>

The optional tolerance distance to use when searching for items near the specified point. If null, a default macro distance is used.

administrativeArealType System.Nullable<DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType>

The optional type filter for the administrative area items to be retrieved.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.GetSubCodesAsync(string, CancellationToken) Method

Retrieves subcodes for a given code.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetSubCodesAsync(string code, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

The administrative area code used to retrieve the associated subcodes.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.UpdateItemAsync(JsonObject, string, CancellationToken) Method

Updates a single administrative area item.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemAsync(System.Text.Json.Nodes.JsonObject? jsonObject, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the data used to update the administrative area item.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DController.UpdateItemsAsync(JsonArray, string, CancellationToken) Method

Updates multiple administrative area items.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the administrative area items to be updated.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

AdministrativeAreal2DReferencePathsByNameParameter Class

Represents a parameter containing text for querying administrative area reference paths.

public class AdministrativeAreal2DReferencePathsByNameParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → AdministrativeAreal2DReferencePathsByNameParameter

Constructors

AdministrativeAreal2DReferencePathsByNameParameter() Constructor

Initializes a new instance of the AdministrativeAreal2DReferencePathsByNameParameter class.

public AdministrativeAreal2DReferencePathsByNameParameter();

AdministrativeAreal2DReferencePathsByNameParameter(string) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencePathsByNameParameter class with the specified text (search phrase).

public AdministrativeAreal2DReferencePathsByNameParameter(string text);

Parameters

text System.String

The text to search for.

AdministrativeAreal2DReferencePathsByNameParameter(JsonObject) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencePathsByNameParameter class using an System.Text.Json.Nodes.JsonObject object.

public AdministrativeAreal2DReferencePathsByNameParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing the parameter values.

Properties

AdministrativeAreal2DReferencePathsByNameParameter.Text Property

Text to search for in the names of the administrative areal 2D reference paths. The search is case-insensitive and matches any path whose name contains the specified text.

public string? Text { get; set; }

Property Value

System.String

AdministrativeAreal2DReferencesByNameParameter Class

Represents a parameter containing text for querying administrative area references.

public class AdministrativeAreal2DReferencesByNameParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → AdministrativeAreal2DReferencesByNameParameter

Constructors

AdministrativeAreal2DReferencesByNameParameter() Constructor

Initializes a new instance of the AdministrativeAreal2DReferencesByNameParameter class.

public AdministrativeAreal2DReferencesByNameParameter();

AdministrativeAreal2DReferencesByNameParameter(string) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencesByNameParameter class with the specified text.

public AdministrativeAreal2DReferencesByNameParameter(string text);

Parameters

text System.String

The text to search for.

AdministrativeAreal2DReferencesByNameParameter(JsonObject) Constructor

Initializes a new instance of the AdministrativeAreal2DReferencesByNameParameter class using a System.Text.Json.Nodes.JsonObject instance.

public AdministrativeAreal2DReferencesByNameParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing the parameter values.

Properties

AdministrativeAreal2DReferencesByNameParameter.Text Property

Gets or sets the text to search for in the names of administrative areal 2D references.

public string? Text { get; set; }

Property Value

System.String

AdministrativeAreal2DsPostTask Class

Provides functionality to asynchronously post a collection of DiGi.GIS.Classes.AdministrativeAreal2D objects to the PostgreSQL database.

public class AdministrativeAreal2DsPostTask : DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.GIS.Classes.AdministrativeAreal2D>

Inheritance System.Object → DiGi.Core.Classes.BackgroundTask → DiGi.Core.Classes.CancelableBackgroundTask → DiGi.Core.Classes.ReportableBackgroundTask<System.Int64> → DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.GIS.Classes.AdministrativeAreal2D> → AdministrativeAreal2DsPostTask

Constructors

AdministrativeAreal2DsPostTask(GISWebAPIManager) Constructor

Initializes a new instance of the AdministrativeAreal2DsPostTask class.

public AdministrativeAreal2DsPostTask(DiGi.GIS.WebAPI.Classes.GISWebAPIManager GISWebAPIManager);

Parameters

GISWebAPIManager GISWebAPIManager

The GIS PostgreSQL Web API manager used to handle database operations.

Building2DController Class

Web API controller for building 2D operations, providing endpoints to retrieve, filter, and update building 2D data.

public class Building2DController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → Building2DController

Constructors

Building2DController(GISWebAPIConfigurationFileWatcher, Building2DPostgreSQLConverter, AdministrativeAreal2DPostgreSQLConverter) Constructor

Initializes a new instance of the Building2DController class.

public Building2DController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter building2DPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter administrativeAreal2DPostgreSQLConverter);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The configuration file watcher for the GIS PostgreSQL Web API.

building2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter

The converter used for Building 2D data operations in PostgreSQL.

administrativeAreal2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter

The converter used to resolve administrative area codes to county identifiers.

Methods

Building2DController.CountAsync(CountByAdministrativeAreal2DIdsParameter, CancellationToken) Method

Asynchronously counts the number of buildings based on the administrative areal 2D identifiers.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> CountAsync(DiGi.GIS.WebAPI.Classes.CountByAdministrativeAreal2DIdsParameter countByAdministrativeAreal2DIdsParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countByAdministrativeAreal2DIdsParameter CountByAdministrativeAreal2DIdsParameter

The parameter object containing the collection of administrative areal 2D identifiers.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetBuilding2DReferenceByIdAsync(long, Nullable<int>, CancellationToken) Method

Asynchronously retrieves a building 2D reference by its unique identifier and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DReferenceByIdAsync(long id, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int64

The unique identifier of the building.

countyId System.Nullable<System.Int32>

An optional integer representing the county identifier used to filter the search.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetBuilding2DReferenceByReferenceAsync(string, Nullable<int>, CancellationToken) Method

Retrieves a building 2D reference by its unique reference code and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DReferenceByReferenceAsync(string reference, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string of the building to retrieve.

countyId System.Nullable<System.Int32>

The optional integer identifier of the county used to filter the search.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetBuilding2DReferencesByAdministrativeAreal2DIdAsync(int, CancellationToken) Method

Retrieves building 2D references filtered by administrative area 2D identifier. Can be used for relatively small number of buildings.

An area above the subdivision level resolves through its Subdivision children (building_2d.subdivision_id membership); a Subdivision resolves through its polygon - the buildings whose bounding-box centre it contains - because the subdivision layer nests (a city, its districts and their neighbourhoods are all subdivisions of one municipality) and subdivision_id files each building under a single container, so membership cannot name a district's buildings (DiGi.GIS.PostgreSQL#75). Parity with point2dsbyadministrativeareal2Did.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DReferencesByAdministrativeAreal2DIdAsync(int administrativeAreal2DId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DId System.Int32

The unique identifier of the administrative area 2D used to filter the building references.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetBuilding2DReferencesByPagingParameterAsync(Building2DReferencesByPagingParameter, CancellationToken) Method

Retrieves a paginated list of building 2D references.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DReferencesByPagingParameterAsync(DiGi.GIS.WebAPI.Classes.Building2DReferencesByPagingParameter building2DReferencesByPagingParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

building2DReferencesByPagingParameter Building2DReferencesByPagingParameter

The parameter containing paging options, including county identifier, cursor, and page size.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning a list of building 2D references.

Building2DController.GetCentroidsByAdministrativeAreal2DIdAsync(int, int, CancellationToken) Method

Retrieves the bounding-box centres of every building of the given administrative area as one compact, columnar document: {"References":[…],"CountyIds":[…],"X":[…],"Y":[…]}, the i-th entry of every array describing the same building, coordinates rounded to 0.01 m.

The same buildings, area resolution and status codes as point2dsbyadministrativeareal2Did (see its remarks), without a _type and four property names per building. That answer relays as 15.9 MB for county 1465 (155 307 buildings), and its client only ever keeps these four values (DiGi.GIS.WebAPI.UI#29). The full endpoint stays for callers that deserialize Building2DCentroid objects.

An area with no buildings answers 200 with four empty arrays; a failed area lookup answers 404. Rows without a reference or a county identifier are left out (ToSystem_JsonObject(this IEnumerable<Building2DCentroid>)).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCentroidsByAdministrativeAreal2DIdAsync(int administrativeAreal2DId, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DId System.Int32

The unique identifier of the administrative area 2D whose buildings are 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.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetCountyPartMismatchesAsync(string, int, CancellationToken) Method

Asynchronously counts, for every polygon part of every multi-part county, the buildings it holds whose bounding box lies outside that part.

A county code names one administrative_areal_2d row per polygon part, and a building filed under the wrong one is unreachable through every read that filters on county_id. A building whose stored box does not intersect the box of the part holding it cannot be inside that part, so what this counts is certainly misfiled - and it costs no geometry.

The count is a lower bound, not a total: a building inside the box of its part but outside the polygon needs the polygon to settle and is not counted. Read it as the number of rows known to be wrong, before and after a repair.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCountyPartMismatchesAsync(string? code=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

code System.String

An optional county code to restrict the measurement to. When omitted every multi-part code is measured.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning one entry per county part holding buildings.

Building2DController.GetItemByIdAsync(long, Nullable<int>, CancellationToken) Method

Retrieves a building 2D item by its identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByIdAsync(long id, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int64

The unique identifier of the building 2D item to retrieve.

countyId System.Nullable<System.Int32>

The optional county identifier associated with the building.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetItemByPointAsync(double, double, Nullable<double>, CancellationToken) Method

Retrieves a building 2D item at or near a specified point.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByPointAsync(double x, double y, System.Nullable<double> tolerance, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x System.Double

The X coordinate of the search point.

y System.Double

The Y coordinate of the search point.

tolerance System.Nullable<System.Double>

The optional tolerance distance in meters to use when searching for the item near the specified point. If not provided, NaN, or non-positive, a default tolerance of 0.5 meters is used.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult containing the building 2D item if found, or an error response.

Building2DController.GetItemByReferenceAsync(string, Nullable<int>, CancellationToken) Method

Asynchronously retrieves a building 2D item by its reference code and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByReferenceAsync(string reference, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string used to locate the building 2D item.

countyId System.Nullable<System.Int32>

The optional identifier of the county associated with the building.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetItemsByBoundingBoxAsync(double, double, double, double, Nullable<double>, CancellationToken) Method

Retrieves building 2D items within a specified bounding box.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByBoundingBoxAsync(double x_1, double y_1, double x_2, double y_2, System.Nullable<double> tolerance, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x_1 System.Double

The X-coordinate of the first corner of the bounding box.

y_1 System.Double

The Y-coordinate of the first corner of the bounding box.

x_2 System.Double

The X-coordinate of the second corner of the bounding box.

y_2 System.Double

The Y-coordinate of the second corner of the bounding box.

tolerance System.Nullable<System.Double>

An optional tolerance value for the spatial query. If not provided or NaN, a default macro distance is used.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetItemsByBuilding2DReferencesAsync(JsonArray, CancellationToken) Method

Retrieves building 2D items by their references.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByBuilding2DReferencesAsync(System.Text.Json.Nodes.JsonArray? jsonArray, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the building 2D references to retrieve.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetItemsByCircleAsync(double, double, Nullable<double>, Nullable<double>, Nullable<double>, CancellationToken) Method

Retrieves building 2D items within a specified circle.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByCircleAsync(double x, double y, System.Nullable<double> radius, System.Nullable<double> diameter, System.Nullable<double> tolerance, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x System.Double

The X-coordinate of the center of the circle.

y System.Double

The Y-coordinate of the center of the circle.

radius System.Nullable<System.Double>

The radius of the search circle.

diameter System.Nullable<System.Double>

The diameter of the search circle.

tolerance System.Nullable<System.Double>

The tolerance value to be applied to the search area.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetItemsByCountyIdAsync(int, CancellationToken) Method

Retrieves building 2D items for a specified county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByCountyIdAsync(int countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The unique identifier of the county.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation. The task result contains the building 2D items as a JSON response, or a 404 status if no items are found.

Building2DController.GetItemsByReferencesAsync(IEnumerable<string>, Nullable<int>, CancellationToken) Method

Asynchronously retrieves building 2D items for each of the provided references and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByReferencesAsync(System.Collections.Generic.IEnumerable<string>? references, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The collection of unique reference strings used to identify the 2D buildings.

countyId System.Nullable<System.Int32>

An optional integer representing the county ID to filter the results.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning a list of building 2D items.

Building2DController.GetPoint2DsByAdministrativeAreal2DIdAsync(int, int, CancellationToken) Method

Retrieves the bounding-box centres of every building of the given administrative area, keyed by reference and county partition, for fast 2D dot rendering.

Area resolution (parity with building2Dreferencesbyadministrativeareal2Did): an area above the subdivision level goes through its Subdivision children, not geometry - one with no subdivisions answers 200 with an empty array, which is not the same as "the area holds no buildings"; it means the resolution found no subdivision to filter by. A Subdivision goes through its polygon instead - the buildings whose bounding-box centre it contains - because the subdivision layer nests and subdivision_id membership cannot name a district's buildings (DiGi.GIS.PostgreSQL#75); for it, an empty array does mean the polygon holds no building centre. A Microsoft.AspNetCore.Http.StatusCodes.Status404NotFound means the area lookup itself failed, not that the area is empty. Rows whose bounding box is NULL are skipped. The JSONB geometry column is never read on either path.

A cold partition can exceed the default timeout (precedent: issue #27) - retry once with a higher commandtimeout before treating a timeout as a defect.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetPoint2DsByAdministrativeAreal2DIdAsync(int administrativeAreal2DId, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DId System.Int32

The unique identifier of the administrative area 2D used to filter the building centroids.

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.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetPoint2DsByReferencesAsync(IEnumerable<string>, Nullable<int>, CancellationToken) Method

Retrieves Point2D coordinates by their references.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetPoint2DsByReferencesAsync(System.Collections.Generic.IEnumerable<string>? references, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

A collection of reference strings used to identify the Point2D objects.

countyId System.Nullable<System.Int32>

The optional identifier for the county associated with the coordinates.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetReferenceDuplicatesAsync(int, int, CancellationToken) Method

Asynchronously retrieves duplicate building references that occur across multiple counties, ordered by collision count descending.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetReferenceDuplicatesAsync(int limit=100, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

limit System.Int32

The maximum number of duplicate references to return. Defaults to 100.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning a list of duplicate building references.

Building2DController.GetReferencesByCountyIdAsync(int, Nullable<int>, int, CancellationToken) Method

Retrieves references of the building2Ds filtered by county Id.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetReferencesByCountyIdAsync(int countyId, System.Nullable<int> subdivisionId=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The unique identifier of the county used to filter the building 2D references.

subdivisionId System.Nullable<System.Int32>

The optional unique identifier of the subdivision used to further filter the building 2D references. When set, the buildings are read by the subdivision's polygon (every container that holds a building answers), not by the stored subdivision_id - the subdivision layer is nested, so a building filed under its neighbourhood is still returned for its district and city.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.GetReferenceUniquenessSummaryAsync(int, CancellationToken) Method

Asynchronously retrieves overall building reference uniqueness metrics across all partitions in the database.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetReferenceUniquenessSummaryAsync(int commandTimeout=600, 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. Defaults to 600 seconds.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning the building reference uniqueness summary.

Building2DController.UpdateItemAsync(JsonObject, string, Nullable<int>, string, CancellationToken) Method

Updates a single building 2D item.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemAsync(System.Text.Json.Nodes.JsonObject? jsonObject, string? code, System.Nullable<int> countyId=null, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the data to update the building 2D item. This value can be null.

code System.String

The code identifying the specific building 2D item to be updated. This value can be null.

countyId System.Nullable<System.Int32>

The optional county identifier associated with the building.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.UpdateItemsAsync(JsonArray, string, string, CancellationToken) Method

Updates multiple building 2D items based on the provided JSON array and identification code.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, string? code, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the building 2D items to be updated.

code System.String

The identification code required for the update operation.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DController.UpdateItemsByCountyIdsAsync(JsonArray, int[], string, string, CancellationToken) Method

Updates multiple building 2D items in the database for the given county rows.

Naming several parts leaves the part of each building to geometry, which is the only thing that can decide it. Passing code as well does not change that answer - it narrows the candidates to the parts of that county before the geometry runs, and it is what the row stores in its own code column.

Without it a building of a multi-part county is resolved against every county whose extent reaches it, which costs one query returning whole county polygons per building rather than one set of polygons per county. That is the difference between minutes and hours over a county of tens of thousands of buildings, so an importer that knows the code should send it.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsByCountyIdsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, int[]? countyIds, string? code=null, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the building 2D items to be updated.

countyIds System.Int32[]

The identifiers of the county rows the buildings belong to. Normally every polygon part of one county.

code System.String

The optional county code the buildings came from. It narrows the geometric decision and is stored on the row; the parts named in countyIds still decide.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

Building2DReferencesByPagingParameter Class

Parameter class containing options for keyset-paginated building 2D reference queries.

public class Building2DReferencesByPagingParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → Building2DReferencesByPagingParameter

Constructors

Building2DReferencesByPagingParameter() Constructor

Initializes a new instance of the Building2DReferencesByPagingParameter class.

public Building2DReferencesByPagingParameter();

Building2DReferencesByPagingParameter(Building2DReferencesByPagingParameter) Constructor

Initializes a new instance of the Building2DReferencesByPagingParameter class by copying properties from another instance.

public Building2DReferencesByPagingParameter(DiGi.GIS.WebAPI.Classes.Building2DReferencesByPagingParameter building2DReferencesByPagingParameter);

Parameters

building2DReferencesByPagingParameter Building2DReferencesByPagingParameter

The parameter instance to copy properties from.

Building2DReferencesByPagingParameter(JsonObject) Constructor

Initializes a new instance of the Building2DReferencesByPagingParameter class using a System.Text.Json.Nodes.JsonObject object.

public Building2DReferencesByPagingParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing data used to initialize the parameter.

Properties

Building2DReferencesByPagingParameter.CountyId Property

Gets or sets the target partition identifier (County ID).

public int CountyId { get; set; }

Property Value

System.Int32

Example

10365

Building2DReferencesByPagingParameter.Cursor Property

Gets or sets the pagination cursor tracking the last processed building reference.

public string? Cursor { get; set; }

Property Value

System.String

Example

BLDG-12345

Building2DReferencesByPagingParameter.PageSize Property

Gets or sets the maximum count of references per page. Defaults to 250.

public int PageSize { get; set; }

Property Value

System.Int32

Example

100

Building2DReferencesByPagingParameter.SubdivisionId Property

Gets or sets the target subdivision identifier (Subdivision ID). Leave null to return references for the whole county.

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

Property Value

System.Nullable<System.Int32>

Example

1035

Building2DsPostTask Class

Provides functionality to handle the asynchronous posting of multiple DiGi.GIS.Classes.Building2D objects to the GIS PostgreSQL database.

public class Building2DsPostTask : DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.GIS.Classes.Building2D>

Inheritance System.Object → DiGi.Core.Classes.BackgroundTask → DiGi.Core.Classes.CancelableBackgroundTask → DiGi.Core.Classes.ReportableBackgroundTask<System.Int64> → DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.GIS.Classes.Building2D> → Building2DsPostTask

Constructors

Building2DsPostTask(GISWebAPIManager) Constructor

Initializes a new instance of the Building2DsPostTask class.

public Building2DsPostTask(DiGi.GIS.WebAPI.Classes.GISWebAPIManager GISWebAPIManager);

Parameters

GISWebAPIManager GISWebAPIManager

The GISWebAPIManager used to manage PostgreSQL GIS operations.

Properties

Building2DsPostTask.Code Property

Gets or sets the code associated with the building 2D post task.

A code does not identify a single county row - a multi-part county holds one row per polygon part - so set CountyId instead wherever the identifier is already known. CountyId takes precedence when both are set.

public string? Code { get; set; }

Property Value

System.String

Building2DsPostTask.CountyId Property

Gets or sets the identifier of the county row the buildings belong to. When set it is used in preference to Code, which leaves the server to choose between the rows of a multi-part county.

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

Property Value

System.Nullable<System.Int32>

Methods

Building2DsPostTask.ExecuteAsync(IEnumerable<Building2D>, int, LongProgressWrapper, CancellationToken) Method

Asynchronously executes the task of posting building 2D objects to the database, keyed by county identifier.

protected System.Threading.Tasks.Task<bool> ExecuteAsync(System.Collections.Generic.IEnumerable<DiGi.GIS.Classes.Building2D>? values, int countyId, DiGi.Core.Classes.LongProgressWrapper? longProgressWrapper, System.Threading.CancellationToken cancellationToken);

Parameters

values System.Collections.Generic.IEnumerable<DiGi.GIS.Classes.Building2D>

The collection of DiGi.GIS.Classes.Building2D instances to post.

countyId System.Int32

The identifier of the county row the buildings belong to.

longProgressWrapper DiGi.Core.Classes.LongProgressWrapper

A DiGi.Core.Classes.LongProgressWrapper tracking the progress of the operation.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result is true if all batches were posted successfully; otherwise, false.

Building2DsPostTask.ExecuteAsync(IEnumerable<Building2D>, string, LongProgressWrapper, CancellationToken) Method

Asynchronously executes the task of posting building 2D objects to the database, keyed by administrative code.

protected System.Threading.Tasks.Task<bool> ExecuteAsync(System.Collections.Generic.IEnumerable<DiGi.GIS.Classes.Building2D>? values, string? code, DiGi.Core.Classes.LongProgressWrapper? longProgressWrapper, System.Threading.CancellationToken cancellationToken);

Parameters

values System.Collections.Generic.IEnumerable<DiGi.GIS.Classes.Building2D>

The collection of DiGi.GIS.Classes.Building2D instances to post.

code System.String

The administrative code associated with the buildings.

longProgressWrapper DiGi.Core.Classes.LongProgressWrapper

A DiGi.Core.Classes.LongProgressWrapper tracking the progress of the operation.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation.

BuildingController Class

Provides API endpoints for managing and updating Building data stored in a PostgreSQL database.

public class BuildingController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → BuildingController

Constructors

BuildingController(GISWebAPIConfigurationFileWatcher, BuildingPostgreSQLConverter, Building2DPostgreSQLConverter, AdministrativeAreal2DPostgreSQLConverter) Constructor

Initializes a new instance of the BuildingController class.

public BuildingController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.BuildingPostgreSQLConverter buildingPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter building2DPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter administrativeAreal2DPostgreSQLConverter);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The configuration file watcher used to monitor changes to the PostgreSQL Web API configuration.

buildingPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.BuildingPostgreSQLConverter

The converter for Building objects when interacting with a PostgreSQL database.

building2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter

The converter for Building2D objects, used to read which county row a reference is already filed under.

administrativeAreal2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter

The converter for administrative areal 2D data when interacting with a PostgreSQL database.

Methods

BuildingController.ContainsByReferencesAsync(List<string>, Nullable<int>, Nullable<bool>, CancellationToken) Method

Asynchronously checks for the existence of a collection of building references, optionally filtered by a county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> ContainsByReferencesAsync(System.Collections.Generic.List<string>? references, System.Nullable<int> countyId, System.Nullable<bool> inverted, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

A list of strings representing the building references to be checked.

countyId System.Nullable<System.Int32>

The optional county identifier used to filter the search.

inverted System.Nullable<System.Boolean>

A boolean indicating whether to return missing references (true) or existing references (false).

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult containing the set of matching reference strings.

BuildingController.GetCountAsync(Nullable<int>, bool, bool, int, CancellationToken) Method

Asynchronously retrieves the count of building records from the database, optionally filtered by a county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCountAsync(System.Nullable<int> countyId, bool estimated=false, bool analyze=false, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Nullable<System.Int32>

The optional integer identifier of the county to filter the count; if null, the count is retrieved across all counties.

estimated System.Boolean

A boolean value indicating whether to read the estimated count from database statistics for faster execution on large partitions. An unanalysed partition returns 204 NoContent.

analyze System.Boolean

A boolean value indicating whether to run an analysis operation before fetching the estimated count to ensure higher accuracy.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult containing the row count as a long integer, 204 NoContent when the partition exists but is unanalysed, or 404 NotFound when the county partition does not exist.

BuildingController.GetItemByLatestCreatedAtAsync(Nullable<int>, CancellationToken) Method

Asynchronously retrieves the building with the latest created date for an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByLatestCreatedAtAsync(System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Nullable<System.Int32>

An optional integer representing the county ID to filter the results.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingController.GetItemByReferenceAsync(string, Nullable<int>, Nullable<double>, Nullable<double>, Nullable<double>, Nullable<double>, CancellationToken) Method

Asynchronously retrieves the single most relevant building for the provided reference and an optional county identifier.

When the X, Y or Z coordinates are provided they are used to break ties between candidates resolved from the reference.

When the reference cannot be resolved and a point is provided, a spatial fallback search limited in X and Y by the maximum distance is performed.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByReferenceAsync(string? reference, System.Nullable<int> countyId, System.Nullable<double> x=null, System.Nullable<double> y=null, System.Nullable<double> z=null, System.Nullable<double> maxDistance=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string used to identify the building.

countyId System.Nullable<System.Int32>

An optional integer representing the county ID to filter the results.

x System.Nullable<System.Double>

The optional X coordinate of the point used to break ties and to locate the building when the reference cannot be resolved.

y System.Nullable<System.Double>

The optional Y coordinate of the point used to break ties and to locate the building when the reference cannot be resolved.

z System.Nullable<System.Double>

The optional Z coordinate of the point used to break ties and to locate the building when the reference cannot be resolved.

maxDistance System.Nullable<System.Double>

The optional distance used to inflate the point in X and Y into the bounding box of the spatial fallback search. Defaults to 1.0 when not provided or invalid.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingController.GetItemsByReferenceAsync(string, Nullable<int>, CancellationToken) Method

Asynchronously retrieves buildings based on a provided reference and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByReferenceAsync(string? reference, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string used to identify the buildings.

countyId System.Nullable<System.Int32>

An optional integer representing the county ID to filter the results.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingController.GetItemsByReferencesAsync(IEnumerable<string>, Nullable<int>, CancellationToken) Method

Asynchronously retrieves the single most relevant building for each of the provided references.

Several rows can share one reference (different level of detail or year); each reference is reduced to one building ranked by level of detail and then by year, matching the behaviour of GetItemByReferenceAsync(string, Nullable<int>, Nullable<double>, Nullable<double>, Nullable<double>, Nullable<double>, CancellationToken) when no coordinates are supplied.

References without a matching building are omitted, so an empty array is a valid response and does not indicate an error.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByReferencesAsync(System.Collections.Generic.IEnumerable<string>? references, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The collection of unique reference strings used to identify the buildings.

countyId System.Nullable<System.Int32>

An optional integer representing the county ID to filter the results.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingController.UpdateItemsAsync(JsonArray, string, string, CancellationToken) Method

Updates multiple building items based on the provided JSON array and identification code.

A county code does not identify a single county row: BDOT10k stores a county whose territory is disconnected as one feature per polygon part, and every part becomes its own row. Every part the code names is passed on, and each building is filed under the part it actually belongs to - see UpdateItemsByCountyIdsAsync(JsonArray, int[], string, CancellationToken) for how that is decided.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, string? code, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the building items to be updated.

code System.String

The identification code required for the update operation.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult representing the result of the update operation.

BuildingController.UpdateItemsByCountyIdsAsync(JsonArray, int[], string, CancellationToken) Method

Updates multiple building items in the database for the given county rows.

The unambiguous counterpart of UpdateItemsAsync(JsonArray, string, string, CancellationToken): it takes county identifiers rather than a code, so the caller states which rows are in play instead of leaving the server to derive them.

A single identifier is taken as stated and every building is filed under it. Several identifiers are the polygon parts of one multi-part county, and each building is then filed under the part it belongs to, decided in two steps:

  1. the part already holding the building's building_2d row, probed lowest part first. That row was filed by geometry when it was imported, and reusing its answer keeps both tables keyed by the same (county_id, reference) pair - a building filed under a part its footprint is not stored in reads back as missing.

  2. geometry, for a building no part holds a 2D row for: the part containing its bounding box, else the nearest part, else the part it overlaps most. Done by the converter, which drops a building it cannot place rather than filing it under a guess - such a building is reported as a rejection, not silently omitted.

The county-part lookup (step 1) not running is answered as a distinct 500 naming it, before any geometry fallback runs, and a transient database failure as 503 with Retry-After - an unreachable database must not look like a decision by geometry.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsByCountyIdsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, int[]? countyIds, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the building items to be updated.

countyIds System.Int32[]

The identifiers of the county rows the buildings belong to. Normally every polygon part of one county.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult representing the result of the update operation.

BuildingDataByFilterGroupParameter Class

Parameter class containing options for building data queries using dynamic hierarchical filters.

public class BuildingDataByFilterGroupParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → BuildingDataByFilterGroupParameter

Constructors

BuildingDataByFilterGroupParameter() Constructor

Initializes a new instance of the BuildingDataByFilterGroupParameter class.

public BuildingDataByFilterGroupParameter();

BuildingDataByFilterGroupParameter(JsonObject) Constructor

Initializes a new instance of the BuildingDataByFilterGroupParameter class using an System.Text.Json.Nodes.JsonObject object.

public BuildingDataByFilterGroupParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing data used to initialize the parameter.

Properties

BuildingDataByFilterGroupParameter.ColumnUniqueIds Property

Gets or sets the optional list of column unique identifiers to project in the result.

public System.Collections.Generic.List<string>? ColumnUniqueIds { get; set; }

Property Value

System.Collections.Generic.List<System.String>

BuildingDataByFilterGroupParameter.FilterGroup Property

Gets or sets the dynamic hierarchical filter group to apply to the database query.

public DiGi.PostgreSQL.Table.Classes.FilterGroup FilterGroup { get; set; }

Property Value

DiGi.PostgreSQL.Table.Classes.FilterGroup

BuildingDataByPagingParameter Class

Parameter class containing options for paged building data queries, in reference (keyset) or physical order.

public class BuildingDataByPagingParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → BuildingDataByPagingParameter

Constructors

BuildingDataByPagingParameter() Constructor

Initializes a new instance of the BuildingDataByPagingParameter class.

public BuildingDataByPagingParameter();

BuildingDataByPagingParameter(JsonObject) Constructor

Initializes a new instance of the BuildingDataByPagingParameter class using an System.Text.Json.Nodes.JsonObject object.

public BuildingDataByPagingParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing data used to initialize the parameter.

Properties

BuildingDataByPagingParameter.ColumnUniqueIds Property

Gets or sets the list of column unique identifiers to project in the result.

public System.Collections.Generic.List<string>? ColumnUniqueIds { get; set; }

Property Value

System.Collections.Generic.List<System.String>

Example

["building_id", "address"]

BuildingDataByPagingParameter.CountyId Property

Gets or sets the target partition identifier (County ID).

public int CountyId { get; set; }

Property Value

System.Int32

Example

10365

BuildingDataByPagingParameter.Cursor Property

Gets or sets where the page continues from; null or omitted starts at the beginning of the county part.

In reference order it is the previous page's last reference, verbatim. In physical order it is the value of the previous response's DiGi-Next-Cursor header - an opaque heap position such as (412,7) - or, after a response that came back in reference order without the header, the last row's reference.

public string? Cursor { get; set; }

Property Value

System.String

Example

30FA023C-190B-87D7-E053-CA2BA8C08B17

BuildingDataByPagingParameter.PageSize Property

Gets or sets the maximum count of rows per page. Defaults to 250.

Capped because a building data row carries every derived column of a building, so a page is far heavier than its row count suggests. Ask for more pages rather than a bigger one.

public int PageSize { get; set; }

Property Value

System.Int32

Example

100

BuildingDataByPagingParameter.PhysicalOrder Property

Gets or sets a value indicating whether the part is read in physical (heap) order rather than by reference. Defaults to false, the reference order this endpoint has always answered.

Physical order reads the part sequentially instead of one random heap read per row. Measured on production: 368-654 s for a cold 155 307-row part in reference order, against about 15 s per 100 000 rows read sequentially (DiGi.GIS.WebAPI.UI#29). Use it to read a whole part when row order does not matter. The next cursor then arrives in the DiGi-Next-Cursor response header, and the endpoint falls back to reference order where physical order is unavailable (see the action's remarks).

public bool PhysicalOrder { get; set; }

Property Value

System.Boolean

Example

true

BuildingDataByReferencesParameter Class

Represents a parameter containing references for querying building data.

public class BuildingDataByReferencesParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → BuildingDataByReferencesParameter

Constructors

BuildingDataByReferencesParameter() Constructor

Initializes a new instance of the BuildingDataByReferencesParameter class.

public BuildingDataByReferencesParameter();

BuildingDataByReferencesParameter(BuildingDataByReferencesParameter) Constructor

Initializes a new instance of the BuildingDataByReferencesParameter class using an existing BuildingDataByReferencesParameter object.

public BuildingDataByReferencesParameter(DiGi.GIS.WebAPI.Classes.BuildingDataByReferencesParameter buildingDataByReferencesParameter);

Parameters

buildingDataByReferencesParameter BuildingDataByReferencesParameter

The parameter object to copy data from.

BuildingDataByReferencesParameter(JsonObject) Constructor

Initializes a new instance of the BuildingDataByReferencesParameter class using a JSON object.

public BuildingDataByReferencesParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing parameter data.

Properties

BuildingDataByReferencesParameter.ColumnUniqueIds Property

Gets or sets the unique identifiers of the columns (Column.UniqueId). All columns will be returned if the collection is null or empty. Required if performance is a concern and the column unique identifiers are available; otherwise, the column unique identifiers will be determined by the building data PostgreSQL converter.

public System.Collections.Generic.IEnumerable<string> ColumnUniqueIds { get; set; }

Property Value

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

BuildingDataByReferencesParameter.CountyId Property

Gets or sets the county identifier. Required if performance is a concern and the county identifier is available; otherwise, the county identifier will be determined by the building data PostgreSQL converter.

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

Property Value

System.Nullable<System.Int32>

BuildingDataByReferencesParameter.References Property

Gets or sets the references for the building data parameter.

public System.Collections.Generic.IEnumerable<string> References { get; set; }

Property Value

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

BuildingDataBySubdivisionIdsParameter Class

Represents a parameter containing subdivision ids for querying building data.

public class BuildingDataBySubdivisionIdsParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → BuildingDataBySubdivisionIdsParameter

Constructors

BuildingDataBySubdivisionIdsParameter() Constructor

Initializes a new instance of the BuildingDataBySubdivisionIdsParameter class.

public BuildingDataBySubdivisionIdsParameter();

BuildingDataBySubdivisionIdsParameter(BuildingDataBySubdivisionIdsParameter) Constructor

Initializes a new instance of the BuildingDataBySubdivisionIdsParameter class using an existing BuildingDataBySubdivisionIdsParameter object.

public BuildingDataBySubdivisionIdsParameter(DiGi.GIS.WebAPI.Classes.BuildingDataBySubdivisionIdsParameter buildingDataBySubdivisionIdsParameter);

Parameters

buildingDataBySubdivisionIdsParameter BuildingDataBySubdivisionIdsParameter

The parameter object to copy data from.

BuildingDataBySubdivisionIdsParameter(JsonObject) Constructor

Initializes a new instance of the BuildingDataBySubdivisionIdsParameter class using a JSON object.

public BuildingDataBySubdivisionIdsParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing parameter data.

Properties

BuildingDataBySubdivisionIdsParameter.ColumnUniqueIds Property

Gets or sets the unique identifiers of the columns (Column.UniqueId). All columns will be returned if the collection is null or empty. Required if performance is a concern and the column unique identifiers are available; otherwise, the column unique identifiers will be determined by the building data PostgreSQL converter.

public System.Collections.Generic.IEnumerable<string> ColumnUniqueIds { get; set; }

Property Value

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

BuildingDataBySubdivisionIdsParameter.SubdivisionIds Property

Gets or sets the subdivision ids for the building data

public System.Collections.Generic.IEnumerable<int> SubdivisionIds { get; set; }

Property Value

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

BuildingDataController Class

Controller responsible for handling API requests related to building data retrieved from a PostgreSQL database.

public class BuildingDataController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → BuildingDataController

Constructors

BuildingDataController(GISWebAPIConfigurationFileWatcher, BuildingDataPostgreSQLConverter, Building2DPostgreSQLConverter, AdministrativeAreal2DPostgreSQLConverter) Constructor

Initializes a new instance of the BuildingDataController class.

Both converters and the configuration watcher are taken on the one constructor, because the coverage read compares two tables that sit in different databases and write operations require authorization. A second constructor is not an option: a controller with more than one public constructor fails activation and answers 500 on every one of its endpoints.

public BuildingDataController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.BuildingDataPostgreSQLConverter buildingDataPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter building2DPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter administrativeAreal2DPostgreSQLConverter);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The GISWebAPIConfigurationFileWatcher used to verify authorization and permissions for write operations.

buildingDataPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.BuildingDataPostgreSQLConverter

The DiGi.GIS.PostgreSQL.Classes.BuildingDataPostgreSQLConverter used to handle building data operations and database conversions.

building2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter

The DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter used to read the buildings a county holds, which is the other half of the coverage comparison.

administrativeAreal2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter

The DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter used to widen a row no named part holds to every part of the named county.

Fields

BuildingDataController.referenceCount_Maximum Field

The largest number of references one request may ask for.

The whole collection travels into a single statement, so an unbounded list is an unbounded statement. A caller with more than this to ask about should page rather than widen the request.

private const int referenceCount_Maximum = 10000;

Field Value

System.Int32

Methods

BuildingDataController.GetCategoriesAsync(int, CancellationToken) Method

Asynchronously retrieves all available building data column categories.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCategoriesAsync(int commandTimeout=600, 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<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingDataController.GetColumnReferencesAsync(List<string>, int, CancellationToken) Method

Asynchronously retrieves all column references, optionally filtered by the specified categories.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetColumnReferencesAsync(System.Collections.Generic.List<string>? categories=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

categories System.Collections.Generic.List<System.String>

An optional list of category names to filter the column references 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 System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning a list of column references.

BuildingDataController.GetColumnsAsync(int, CancellationToken) Method

Asynchronously retrieves all available column definitions for building data.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetColumnsAsync(int commandTimeout=600, 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<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingDataController.GetColumnsByCategoriesAsync(List<string>, int, CancellationToken) Method

Asynchronously retrieves all columns filtered by the specified categories.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetColumnsByCategoriesAsync(System.Collections.Generic.List<string>? categories=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

categories System.Collections.Generic.List<System.String>

An optional list of category names to filter the columns by. If null, the filtering behavior is determined by the underlying data source.

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<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingDataController.GetColumnsByCategoriesParameterAsync(ColumnsByCategoriesParameter, int, CancellationToken) Method

Retrieves all columns with given categories by columns by categories parameter (which contains categories).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetColumnsByCategoriesParameterAsync(DiGi.GIS.WebAPI.Classes.ColumnsByCategoriesParameter columnsByCategoriesParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

columnsByCategoriesParameter ColumnsByCategoriesParameter

The parameter containing the categories for querying columns.

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<Microsoft.AspNetCore.Mvc.IActionResult>
Column DiGi.PostgreSQL.Table.Classes.Column

BuildingDataController.GetColumnUniqueIdsAsync(List<string>, int, CancellationToken) Method

Retrieves the unique identifiers for columns, optionally filtered by the specified categories.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetColumnUniqueIdsAsync(System.Collections.Generic.List<string>? categories=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

categories System.Collections.Generic.List<System.String>

An optional list of category names used to filter the column 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 to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingDataController.GetCountByCountyIdAsync(int, bool, bool, int, CancellationToken) Method

Asynchronously retrieves the number of building data rows stored for one county.

The cheapest question that can be asked of the table, and the one that separates a county no run has reached from one a run reached and wrote nothing for.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCountByCountyIdAsync(int countyId, bool estimated=false, bool analyze=false, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The identifier of the county to count.

estimated System.Boolean

Reads the planner's row estimate instead of counting the rows. Far faster on a partition of millions and accurate to a few percent, but it reflects the last time the partition was analysed rather than this moment. An unanalysed partition returns 204 NoContent.

analyze System.Boolean

A boolean value indicating whether to perform an ANALYZE operation before reading the estimate to ensure statistics are current.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the count, 204 NoContent when the partition exists but is unanalysed, or 404 NotFound when the county has no partition.

BuildingDataController.GetCountyIdsByReferenceAsync(string, int, CancellationToken) Method

Asynchronously retrieves the counties whose building data holds a row for one reference.

A reference addresses one building of one county, so more than one identifier coming back means the reference was written outside the county it belongs to.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCountyIdsByReferenceAsync(string reference, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The building reference to look up.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the county identifiers in ascending order, or 404 when the reference is not stored.

BuildingDataController.GetCoverageByCountyIdAsync(int, int, CancellationToken) Method

Asynchronously measures what one county's building data holds against the buildings that county actually has.

What a row count cannot answer: how much was left out, and how much of that no run could have reached. A shortfall larger than the unresolved subdivision count is a run that did not finish what it could have.

Reads both databases - the buildings from the main one and their data from the storage one - so it costs more than a count. Call it per county rather than in a sweep.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCoverageByCountyIdAsync(int countyId, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The identifier of the county to measure.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the DiGi.GIS.PostgreSQL.Classes.BuildingDataCoverageResult, or 404 when either side could not be read.

BuildingDataController.GetDuplicateReferencesAsync(int, int, CancellationToken) Method

Asynchronously retrieves the references the building data holds under more than one county, ordered by collision count descending.

Expected to come back empty. A reference addresses one building of one county, so anything listed here was written outside the county it belongs to and nothing removes it afterwards.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetDuplicateReferencesAsync(int limit=100, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

limit System.Int32

The maximum number of references to return. Defaults to 100.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the duplicated references, or 404 when there are none.

BuildingDataController.GetHistogramSummaryAsync(HistogramRequestParameter, int, CancellationToken) Method

Generates a value range distribution histogram for a specific building data column inside a county partition, applying optional dynamic filters.

Each row of the answer is one bucket - {bucket, rangeStart, rangeEnd, count}, the actual minimum and maximum of the values the bucket holds and their count. The buckets are of equal value width unless the body asks for DiGi.PostgreSQL.Table.Enums.HistogramBucketing.EqualCount (HistogramBucketing: 1), which gives every bucket the same number of rows and keeps a skewed column's resolution where its rows are (ZiolkowskiJakub/DiGi.GIS.WebAPI#35).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetHistogramSummaryAsync(DiGi.GIS.WebAPI.Classes.HistogramRequestParameter histogramRequestParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

histogramRequestParameter HistogramRequestParameter

The parameter containing the target column, county identifier, desired bucket count, bucketing rule, and optional dynamic filters.

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<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning the histogram bucket list as a JSON array.

BuildingDataController.GetMultivalueAggregateSummaryAsync(MultivalueAggregateRequestParameter, int, CancellationToken) Method

Computes multi-value statistical summaries (SplitDistinctCount, SplitValueDistribution) on a partition column.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetMultivalueAggregateSummaryAsync(DiGi.GIS.WebAPI.Classes.MultivalueAggregateRequestParameter multivalueAggregateRequestParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

multivalueAggregateRequestParameter MultivalueAggregateRequestParameter

The parameter containing target column, multi-value aggregate function, county identifier, and optional separator.

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<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning the aggregate result as a JSON node.

BuildingDataController.GetSinglevalueAggregateSummaryAsync(SinglevalueAggregateRequestParameter, int, CancellationToken) Method

Computes single-value statistical summaries (Avg, Sum, Min, Max, Count, DistinctCount) on a partition column.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetSinglevalueAggregateSummaryAsync(DiGi.GIS.WebAPI.Classes.SinglevalueAggregateRequestParameter singlevalueAggregateRequestParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

singlevalueAggregateRequestParameter SinglevalueAggregateRequestParameter

The parameter containing target column, single-value aggregate function, and county identifier.

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<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning the aggregate result as a JSON node.

BuildingDataController.GetTableByBuildingDataByPagingParameterAsync(BuildingDataByPagingParameter, int, CancellationToken) Method

Retrieves one page of a county part's building data, following a cursor from page to page.

Reference order (default, PhysicalOrder false): rows ordered by reference. The cursor is the previous page's last reference, and a page shorter than PageSize ends the part. Every row is one random heap read, which on a large part is slow: part 55417 (155 307 rows) took 368-654 s cold (DiGi.GIS.WebAPI.UI#29).

Physical order (PhysicalOrder true): rows in heap order, read sequentially. The next cursor is returned in the DiGi-Next-Cursor response header (NextCursor), and a response without the header ends the part. The page may still carry the part's last rows. Row order is unspecified. When the physical read is unavailable - a database older than PostgreSQL 14, or a Cursor that is not a physical position - the same request is answered by the reference-ordered page for that Cursor, without the header. A client that keeps asking for physical order and follows the last row's reference whenever the header is absent from a full page therefore pages correctly either way.

Concurrent writes. Each request reads its own snapshot. In physical order a row rewritten during a walk moves: it is repeated when its new version lands ahead of the walk and missed when it lands behind. Clients dedup on (reference, county_id), which covers the repeats. The misses are the price of the sequential read and matter only while the part is being rewritten.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetTableByBuildingDataByPagingParameterAsync(DiGi.GIS.WebAPI.Classes.BuildingDataByPagingParameter buildingDataByPagingParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

buildingDataByPagingParameter BuildingDataByPagingParameter

The parameter containing paging options, including column projections, county identifier, cursor, page size and order.

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<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning the populated table. In physical order the next cursor, if any, is in the DiGi-Next-Cursor header.

BuildingDataController.GetTableByBuildingDataByReferencesParameterAsync(BuildingDataByReferencesParameter, int, CancellationToken) Method

Retrieves a building data table by building data by references parameter (column unique ids, county id and references).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetTableByBuildingDataByReferencesParameterAsync(DiGi.GIS.WebAPI.Classes.BuildingDataByReferencesParameter buildingDataByReferencesParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

buildingDataByReferencesParameter BuildingDataByReferencesParameter

The parameter containing references for querying building data, including column unique identifiers, county identifier, and specific 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 to observe while waiting for the task to complete.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult representing the result of the operation, typically containing a DiGi.PostgreSQL.Table.Classes.Table if found.

BuildingDataController.GetTableByBuildingDataBySubdivisionIdsParameterAsync(BuildingDataBySubdivisionIdsParameter, int, CancellationToken) Method

Retrieves a building data table by building data by subdivision ids parameter (column unique ids, subdivision ids).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetTableByBuildingDataBySubdivisionIdsParameterAsync(DiGi.GIS.WebAPI.Classes.BuildingDataBySubdivisionIdsParameter buildingDataBySubdivisionIdsParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

buildingDataBySubdivisionIdsParameter BuildingDataBySubdivisionIdsParameter

The parameter containing the subdivision IDs and optional column unique identifiers for querying building data.

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<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingDataController.GetTableByFilterGroupAsync(BuildingDataByFilterGroupParameter, int, CancellationToken) Method

Retrieves a building data table filtered by the specified dynamic hierarchical filters.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetTableByFilterGroupAsync(DiGi.GIS.WebAPI.Classes.BuildingDataByFilterGroupParameter buildingDataByFilterGroupParameter, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

buildingDataByFilterGroupParameter BuildingDataByFilterGroupParameter

The parameter containing the dynamic filter group and optional column unique identifiers.

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<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning the populated filtered table.

BuildingDataController.GetTableByReferenceAsync(string, Nullable<int>, int, CancellationToken) Method

Retrieves a building data table for one specific building.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetTableByReferenceAsync(string reference, System.Nullable<int> countyId=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

Building reference

countyId System.Nullable<System.Int32>

The unique identifier of the county for which building belongs 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<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation, returning the populated filtered table with data for sigle building.

BuildingDataController.GetUniqueValuesAsync(string, Nullable<int>, int, CancellationToken) Method

Retrieves unique values for a specified column unique identifier and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetUniqueValuesAsync(string columnUniqueId, System.Nullable<int> countyId=null, int commandTimeout=90, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

columnUniqueId System.String

The unique identifier of the column from which to retrieve unique values.

countyId System.Nullable<System.Int32>

The optional integer identifier of the county 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. Defaults to 90 seconds; a national (unfiltered) unique-values scan runs well past that and should pass commandtimeout=600 explicitly.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingDataController.GetUniqueValuesByColumnUniqueIdParameterAsync(UniqueValuesByColumnUniqueIdParameter, int, CancellationToken) Method

Retrieves unique values for a given UniqueValuesByColumnUniqueIdParameter (column unique id and optionally county id), applying optional dynamic filters.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetUniqueValuesByColumnUniqueIdParameterAsync(DiGi.GIS.WebAPI.Classes.UniqueValuesByColumnUniqueIdParameter uniqueValuesByColumnUniqueIdParameter, int commandTimeout=90, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

uniqueValuesByColumnUniqueIdParameter UniqueValuesByColumnUniqueIdParameter

The parameter containing the column unique identifier, optional county identifier, and optional dynamic filters.

commandTimeout System.Int32

The timeout in seconds for the execution of the command. A value of 0 disables the timeout. Defaults to 90 seconds; a national (unfiltered) unique-values scan runs well past that and should pass commandtimeout=600 explicitly.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult representing the result of the operation, typically a list of unique values or a not found status.

BuildingDataController.UpdateItemsByCountyIdsAsync(JsonObject, int[], int, string, CancellationToken) Method

Asynchronously updates building data for the specified county identifiers.

The identifiers are the parts of one county in play, and each row is filed under the part already holding the building_2d row its reference names, probed lowest part first - whether one identifier arrived or several, since naming one part is not evidence the county has one. That row was filed by geometry when it was imported, so reusing its answer keeps both tables keyed by the same (county_id, reference) pair.

A row no named part holds is widened to every part of the county its parts name, and only a row no part of the county holds is left unwritten - nothing states where it belongs, and storing it under a guessed part is the state this replaced.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsByCountyIdsAsync(System.Text.Json.Nodes.JsonObject? jsonObject, int[]? countyIds, int commandTimeout=600, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing the table structure and data to be updated.

countyIds System.Int32[]

The identifiers of the county rows the building data belongs to. Normally every polygon part of one county.

commandTimeout System.Int32

The timeout in seconds for the execution of the database command. Defaults to 600.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task representing the asynchronous operation with an Microsoft.AspNetCore.Mvc.IActionResult containing an UpdateItemsResult.

BuildingModelController Class

Web API controller for building model operations, providing endpoints to retrieve building model data.

public class BuildingModelController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → BuildingModelController

Constructors

BuildingModelController(GISWebAPIConfigurationFileWatcher, BuildingModelPostgreSQLConverter, Building2DPostgreSQLConverter, AdministrativeAreal2DPostgreSQLConverter) Constructor

Initializes a new instance of the BuildingModelController class.

public BuildingModelController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.BuildingModelPostgreSQLConverter buildingModelPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter building2DPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter administrativeAreal2DPostgreSQLConverter);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The configuration file watcher for the GIS PostgreSQL Web API.

buildingModelPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.BuildingModelPostgreSQLConverter

The converter used for building model data operations in PostgreSQL.

building2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter

The converter used for Building 2D data operations in PostgreSQL.

administrativeAreal2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter

The converter used to resolve an administrative area code to its county identifier.

Methods

BuildingModelController.GetCountByCountyIdAsync(int, int, CancellationToken) Method

Asynchronously retrieves the number of building model rows stored for one county part.

Compared against gis/Building2D/referencesbycountyid it tells whether a county's regeneration covered every building; the count is exact, so it walks the partition.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCountByCountyIdAsync(int countyId, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The identifier of the county part (the building_2d.county_id value, one per polygon part).

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the row count, or 404 when the county has no building model partition.

BuildingModelController.GetItemsByCircleAsync(double, double, Nullable<double>, Nullable<double>, Nullable<double>, CancellationToken) Method

Retrieves the building models stored in the database for all buildings within a specified circle.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByCircleAsync(double x, double y, System.Nullable<double> radius, System.Nullable<double> diameter, System.Nullable<double> tolerance=1E-06, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x System.Double

The X-coordinate of the center point of the search circle.

y System.Double

The Y-coordinate of the center point of the search circle.

radius System.Nullable<System.Double>

The radius of the search circle. This value can be null.

diameter System.Nullable<System.Double>

The diameter of the search circle. This value can be null.

tolerance System.Nullable<System.Double>

An optional tolerance value for the spatial query. If not provided, the default distance tolerance is used.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingModelController.GetItemsByReferencesAsync(IEnumerable<string>, Nullable<int>, Nullable<long>, CancellationToken) Method

Retrieves building models stored in the database for the specified references.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemsByReferencesAsync(System.Collections.Generic.IEnumerable<string>? references, System.Nullable<int> countyId, System.Nullable<long> limit=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The building references identifying the building models to retrieve. This value can be null.

countyId System.Nullable<System.Int32>

The optional county identifier used to narrow the search. This value can be null.

limit System.Nullable<System.Int64>

The optional maximum number of building models to retrieve. This value can be null.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingModelController.GetLatestCreatedAtByCountyIdAsync(int, int, CancellationToken) Method

Asynchronously retrieves the most recent creation stamp among the building model rows of one county part.

The model JSON carries no timestamp, so this is the only way to tell through the API whether a county holds the rows of the latest regeneration run or still those of an earlier one.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetLatestCreatedAtByCountyIdAsync(int countyId, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The identifier of the county part (the building_2d.county_id value, one per polygon part).

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the stamp as an ISO 8601 UTC string, or 404 when the county has no building model partition or it holds no rows.

BuildingModelController.UpdateAsync(List<BuildingModel>, int) Method

Writes the given building models to the partition of a single county row, replacing whatever those buildings already held there.

Shared by both update actions so the county row is resolved once, by the action, and this method never has to guess one.

A post replaces rather than adds. A model row is addressed by the identifier of the model it holds, and a model is handed a fresh one whenever it is created, so the write itself always appends - see DiGi.GIS.PostgreSQL.Classes.Building2DReferencedObject<>. Left at that, regenerating a county would add a model to every building instead of replacing its own, so what the buildings already held is read first and removed once the write has succeeded. A building therefore ends up holding exactly the models this call sent for it.

The identifiers are read before the write and deleted after it, deliberately in that order: an interrupted call then leaves the building holding both its old and its new model, which is recoverable, rather than holding neither.

private System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateAsync(System.Collections.Generic.List<DiGi.Analytical.Building.Classes.BuildingModel> buildingModels, int countyId);

Parameters

buildingModels System.Collections.Generic.List<DiGi.Analytical.Building.Classes.BuildingModel>

The building models to write.

countyId System.Int32

The identifier of the county row the models belong to.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingModelController.UpdateItemsAsync(JsonArray, string, string, CancellationToken) Method

Updates multiple building model items in the database, keyed by administrative area code.

A county code does not identify a single county row: BDOT10k stores a county whose territory is disconnected as one feature per polygon part, and every part becomes its own row. Every part the code names is passed on, and each model is filed under the part it actually belongs to - see UpdateItemsByCountyIdsAsync(JsonArray, int[], string, CancellationToken) for how that is decided.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, string? code, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the building models to be updated.

code System.String

The administrative area code the building models belong to, resolved server-side to a county identifier.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingModelController.UpdateItemsByCountyIdsAsync(JsonArray, int[], string, CancellationToken) Method

Updates multiple building model items in the database for the given county rows.

The unambiguous counterpart of UpdateItemsAsync(JsonArray, string, string, CancellationToken): it takes county identifiers rather than a code, so the caller states which rows are in play instead of leaving the server to derive them.

The identifiers are the parts of one county in play, and each model is filed under the part already holding the building_2d row its reference names, probed lowest part first - whether one identifier arrived or several, since naming one part is not evidence the county has one. That row was filed by geometry when it was imported, so reusing its answer keeps both tables keyed by the same (county_id, reference) pair.

A model no named part holds is widened to every part of the county its parts name, and only a model no part of the county holds is left unwritten - nothing states where it belongs, and storing it under a guessed part is the state this replaced.

Nothing filed is answered as a failure, not a quiet no-op: the county-part lookup not running answers a distinct 500 naming it, a transient database failure answers 503 with Retry-After, and a non-empty batch in which no model could be filed under any county answers 500. This is the endpoint behind a regeneration that once posted 33 687 models into an unreachable database and reported success.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsByCountyIdsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, int[]? countyIds, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the building models to be updated. This value can be null.

countyIds System.Int32[]

The identifiers of the county rows the building models belong to. Normally every polygon part of one county.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

BuildingModelsPostTask Class

Provides functionality to handle the asynchronous posting of DiGi.Analytical.Building.Classes.BuildingModel collections to the PostgreSQL database.

public class BuildingModelsPostTask : DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.Analytical.Building.Classes.BuildingModel>

Inheritance System.Object → DiGi.Core.Classes.BackgroundTask → DiGi.Core.Classes.CancelableBackgroundTask → DiGi.Core.Classes.ReportableBackgroundTask<System.Int64> → DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.Analytical.Building.Classes.BuildingModel> → BuildingModelsPostTask

Constructors

BuildingModelsPostTask(GISWebAPIManager) Constructor

Initializes a new instance of the BuildingModelsPostTask class.

public BuildingModelsPostTask(DiGi.GIS.WebAPI.Classes.GISWebAPIManager GISWebAPIManager);

Parameters

GISWebAPIManager GISWebAPIManager

The GISWebAPIManager instance used to communicate with the server.

Properties

BuildingModelsPostTask.Code Property

Gets or sets the administrative area code the building models belong to. It is resolved server-side to a county identifier.

A code does not identify a single county row - a multi-part county holds one row per polygon part - so set CountyIds instead wherever the identifiers are already known. CountyIds takes precedence when both are set.

public string? Code { get; set; }

Property Value

System.String

BuildingModelsPostTask.CountyIds Property

Gets or sets the identifiers of the county rows the building models belong to - normally every polygon part of one county, since a single id is not evidence the code has one part. When set it is used in preference to Code, which lets the server resolve the code to every part.

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

Property Value

System.Collections.Generic.HashSet<System.Int32>

Methods

BuildingModelsPostTask.ExecuteAsync(IEnumerable<BuildingModel>, string, LongProgressWrapper, CancellationToken) Method

Asynchronously executes the task of posting building models to the database in memory-size-split batches.

protected System.Threading.Tasks.Task<bool> ExecuteAsync(System.Collections.Generic.IEnumerable<DiGi.Analytical.Building.Classes.BuildingModel>? buildingModels, string? code, DiGi.Core.Classes.LongProgressWrapper? longProgressWrapper, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

buildingModels System.Collections.Generic.IEnumerable<DiGi.Analytical.Building.Classes.BuildingModel>

The collection of DiGi.Analytical.Building.Classes.BuildingModel instances to post.

code System.String

The administrative area code the building models belong to.

longProgressWrapper DiGi.Core.Classes.LongProgressWrapper

A DiGi.Core.Classes.LongProgressWrapper tracking the progress of the operation.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result is true if all batches were posted successfully; otherwise, false.

BuildingModelsPostTask.ExecuteAsync(IEnumerable<BuildingModel>, IEnumerable<int>, LongProgressWrapper, CancellationToken) Method

Asynchronously executes the task of posting building models to the database in memory-size-split batches, keyed by county identifier.

protected System.Threading.Tasks.Task<bool> ExecuteAsync(System.Collections.Generic.IEnumerable<DiGi.Analytical.Building.Classes.BuildingModel>? buildingModels, System.Collections.Generic.IEnumerable<int>? countyIds, DiGi.Core.Classes.LongProgressWrapper? longProgressWrapper, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

buildingModels System.Collections.Generic.IEnumerable<DiGi.Analytical.Building.Classes.BuildingModel>

The collection of DiGi.Analytical.Building.Classes.BuildingModel instances to post.

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

The identifiers of the county rows the building models belong to - normally every polygon part of one county.

longProgressWrapper DiGi.Core.Classes.LongProgressWrapper

A DiGi.Core.Classes.LongProgressWrapper tracking the progress of the operation.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result is true if all batches were posted successfully; otherwise, false.

BuildingsPostTask Class

Provides functionality to handle the asynchronous posting of DiGi.CityGML.Classes.Building collections to the PostgreSQL database.

public class BuildingsPostTask : DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.CityGML.Classes.Building>

Inheritance System.Object → DiGi.Core.Classes.BackgroundTask → DiGi.Core.Classes.CancelableBackgroundTask → DiGi.Core.Classes.ReportableBackgroundTask<System.Int64> → DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.CityGML.Classes.Building> → BuildingsPostTask

Constructors

BuildingsPostTask(GISWebAPIManager) Constructor

Initializes a new instance of the BuildingsPostTask class.

public BuildingsPostTask(DiGi.GIS.WebAPI.Classes.GISWebAPIManager GISWebAPIManager);

Parameters

GISWebAPIManager GISWebAPIManager

The GIS PostgreSQL Web API manager used to handle data persistence.

Properties

BuildingsPostTask.Code Property

Gets or sets the code associated with the buildings post task.

A code does not identify a single county row - a multi-part county holds one row per polygon part - so set CountyId instead wherever the identifier is already known. CountyId takes precedence when both are set.

public string? Code { get; set; }

Property Value

System.String

BuildingsPostTask.CountyId Property

Gets or sets the identifier of the county row the buildings belong to. When set it is used in preference to Code, which leaves the server to choose between the rows of a multi-part county.

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

Property Value

System.Nullable<System.Int32>

Methods

BuildingsPostTask.ExecuteAsync(IEnumerable<Building>, int, LongProgressWrapper, CancellationToken) Method

Asynchronously executes the task of posting building objects to the database, keyed by county identifier.

protected System.Threading.Tasks.Task<bool> ExecuteAsync(System.Collections.Generic.IEnumerable<DiGi.CityGML.Classes.Building>? values, int countyId, DiGi.Core.Classes.LongProgressWrapper? longProgressWrapper, System.Threading.CancellationToken cancellationToken);

Parameters

values System.Collections.Generic.IEnumerable<DiGi.CityGML.Classes.Building>

The collection of DiGi.CityGML.Classes.Building instances to post.

countyId System.Int32

The identifier of the county row the buildings belong to.

longProgressWrapper DiGi.Core.Classes.LongProgressWrapper

A DiGi.Core.Classes.LongProgressWrapper tracking the progress of the operation.

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result is true if all batches were posted successfully; otherwise, false.

BuildingsPostTask.ExecuteAsync(IEnumerable<Building>, string, LongProgressWrapper, CancellationToken) Method

Asynchronously executes the task of posting building objects to the database.

protected System.Threading.Tasks.Task<bool> ExecuteAsync(System.Collections.Generic.IEnumerable<DiGi.CityGML.Classes.Building>? values, string? code, DiGi.Core.Classes.LongProgressWrapper? longProgressWrapper, System.Threading.CancellationToken cancellationToken);

Parameters

values System.Collections.Generic.IEnumerable<DiGi.CityGML.Classes.Building>

code System.String

longProgressWrapper DiGi.Core.Classes.LongProgressWrapper

cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<System.Boolean>

ColumnsByCategoriesParameter Class

Represents a parameter containing categories for querying columns.

public class ColumnsByCategoriesParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → ColumnsByCategoriesParameter

Constructors

ColumnsByCategoriesParameter() Constructor

Initializes a new instance of the ColumnsByCategoriesParameter class.

public ColumnsByCategoriesParameter();

ColumnsByCategoriesParameter(IEnumerable<string>) Constructor

Initializes a new instance of the ColumnsByCategoriesParameter class with the specified categories.

public ColumnsByCategoriesParameter(System.Collections.Generic.IEnumerable<string> categories);

Parameters

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

The collection of categories for querying columns.

ColumnsByCategoriesParameter(JsonObject) Constructor

Initializes a new instance of the ColumnsByCategoriesParameter class using an System.Text.Json.Nodes.JsonObject object.

public ColumnsByCategoriesParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the data used to initialize the parameter.

Properties

ColumnsByCategoriesParameter.Categories Property

Gets or sets the categories for querying columns. All columns will be returned if the collection is null or empty.

public System.Collections.Generic.IEnumerable<string> Categories { get; set; }

Property Value

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

CountByAdministrativeAreal2DIdsParameter Class

Represents a parameter object used to perform counting operations based on a collection of administrative areal 2D identifiers.

public class CountByAdministrativeAreal2DIdsParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → CountByAdministrativeAreal2DIdsParameter

Constructors

CountByAdministrativeAreal2DIdsParameter() Constructor

Initializes a new instance of the CountByAdministrativeAreal2DIdsParameter class.

public CountByAdministrativeAreal2DIdsParameter();

CountByAdministrativeAreal2DIdsParameter(CountByAdministrativeAreal2DIdsParameter) Constructor

Initializes a new instance of the CountByAdministrativeAreal2DIdsParameter class by copying the values from an existing instance.

public CountByAdministrativeAreal2DIdsParameter(DiGi.GIS.WebAPI.Classes.CountByAdministrativeAreal2DIdsParameter countByAdministrativeAreal2DIdsParameter);

Parameters

countByAdministrativeAreal2DIdsParameter CountByAdministrativeAreal2DIdsParameter

The source instance from which to copy the administrative areal 2D identifiers.

CountByAdministrativeAreal2DIdsParameter(JsonObject) Constructor

Initializes a new instance of the CountByAdministrativeAreal2DIdsParameter class using the provided JSON object.

public CountByAdministrativeAreal2DIdsParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the data used to initialize the parameter.

Properties

CountByAdministrativeAreal2DIdsParameter.AdministrativeAreal2DIds Property

Gets or sets the collection of administrative areal 2D identifiers used for counting operations.

public System.Collections.Generic.IEnumerable<int> AdministrativeAreal2DIds { get; set; }

Property Value

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

EPWFileController Class

Controller responsible for handling API requests related to EPW files retrieved from or updated in a PostgreSQL database.

public class EPWFileController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → EPWFileController

Constructors

EPWFileController(GISWebAPIConfigurationFileWatcher, EPWFilePostgreSQLConverter) Constructor

Initializes a new instance of the EPWFileController class.

public EPWFileController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.EPWFilePostgreSQLConverter ePWFilePostgreSQLConverter);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The configuration file watcher used to monitor changes to the GIS PostgreSQL Web API settings.

ePWFilePostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.EPWFilePostgreSQLConverter

The converter used for handling EPW file operations within the PostgreSQL database.

Methods

EPWFileController.GetEPWFileAsync(double, double, CancellationToken) Method

Asynchronously retrieves the closest EPWFile to the given coordinate (x, y).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetEPWFileAsync(double x, double y, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

x System.Double

The X coordinate (longitude).

y System.Double

The Y coordinate (latitude).

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

EPWFileController.UpdateItemsAsync(JsonArray, string, CancellationToken) Method

Asynchronously updates or inserts a collection of EPW files.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> UpdateItemsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The JSON array containing the EPW files to update or insert.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

EPWFilesPostTask Class

Provides functionality to handle the asynchronous posting of multiple DiGi.EPW.Classes.EPWFile objects to the GIS PostgreSQL database.

public class EPWFilesPostTask : DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.EPW.Classes.EPWFile>

Inheritance System.Object → DiGi.Core.Classes.BackgroundTask → DiGi.Core.Classes.CancelableBackgroundTask → DiGi.Core.Classes.ReportableBackgroundTask<System.Int64> → DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.EPW.Classes.EPWFile> → EPWFilesPostTask

Constructors

EPWFilesPostTask(GISWebAPIManager) Constructor

Initializes a new instance of the EPWFilesPostTask class.

public EPWFilesPostTask(DiGi.GIS.WebAPI.Classes.GISWebAPIManager GISWebAPIManager);

Parameters

GISWebAPIManager GISWebAPIManager

The GISWebAPIManager used to manage PostgreSQL GIS operations.

Methods

EPWFilesPostTask.ExecuteAsync(IEnumerable<EPWFile>, LongProgressWrapper, CancellationToken) Method

Asynchronously executes the posting of EPW files.

protected System.Threading.Tasks.Task<bool> ExecuteAsync(System.Collections.Generic.IEnumerable<DiGi.EPW.Classes.EPWFile>? ePWFiles, DiGi.Core.Classes.LongProgressWrapper? longProgressWrapper, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

ePWFiles System.Collections.Generic.IEnumerable<DiGi.EPW.Classes.EPWFile>

The collection of EPW files to post.

longProgressWrapper DiGi.Core.Classes.LongProgressWrapper

The progress wrapper to track the number of posted files.

cancellationToken System.Threading.CancellationToken

The cancellation token to cancel the operation.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation, returning true if the post succeeded; otherwise, false.

EPWFilesPostTask.ExecuteAsync(IProgress<long>, CancellationToken) Method

Asynchronously executes the background task, reporting progress.

protected override System.Threading.Tasks.Task<bool> ExecuteAsync(System.IProgress<long> progress, System.Threading.CancellationToken cancellationToken);

Parameters

progress System.IProgress<System.Int64>

The progress reporter for reporting progress updates.

cancellationToken System.Threading.CancellationToken

The cancellation token to cancel the operation.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation, returning true if the operation succeeded; otherwise, false.

GISWebAPIConfigurationFileWatcher Class

Provides functionality to watch and retrieve configuration settings for the GIS PostgreSQL Web API from a specified configuration file.

public class GISWebAPIConfigurationFileWatcher : DiGi.Core.IO.FileWatcher.Classes.ConfigurationFileWatcher

Inheritance System.Object → DiGi.Core.IO.FileWatcher.Classes.FileWatcher → DiGi.Core.IO.FileWatcher.Classes.ConfigurationFileWatcher → GISWebAPIConfigurationFileWatcher

Constructors

GISWebAPIConfigurationFileWatcher(string, double) Constructor

Initializes a new instance of the GISWebAPIConfigurationFileWatcher class.

public GISWebAPIConfigurationFileWatcher(string path, double interval=5000.0);

Parameters

path System.String

The path to the configuration file to be watched.

interval System.Double

The time interval in milliseconds between checks for changes to the configuration file.

Properties

GISWebAPIConfigurationFileWatcher.AllowUpdateAdministrativeAreal2D Property

Gets a value indicating whether updates to administrative areal 2D data are permitted according to the configuration file.

public bool AllowUpdateAdministrativeAreal2D { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateBuilding Property

Gets a value indicating whether updates to buildings are permitted based on the configuration file settings.

public bool AllowUpdateBuilding { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateBuilding2D Property

Gets a value indicating whether updates to 2D buildings are permitted based on the configuration file settings.

public bool AllowUpdateBuilding2D { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateBuildingData Property

Gets a value indicating whether updates to building data are permitted based on the configuration file settings.

public bool AllowUpdateBuildingData { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateBuildingModel Property

Gets a value indicating whether updates to building models are permitted based on the configuration file settings.

public bool AllowUpdateBuildingModel { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateEPWFile Property

Gets a value indicating whether updating EPW file data is enabled in the configuration.

public bool AllowUpdateEPWFile { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateOccupancyData Property

Gets a value indicating whether updates to occupancy data are permitted according to the configuration file.

public bool AllowUpdateOccupancyData { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateOrtoDatas Property

Gets a value indicating whether updates to orthophoto data are permitted according to the configuration file.

public bool AllowUpdateOrtoDatas { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateUnit Property

Gets a value indicating whether updates to territorial unit data are permitted according to the configuration file.

public bool AllowUpdateUnit { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.AllowUpdateYearBuiltData Property

Gets a value indicating whether updating year built data is enabled in the configuration.

public bool AllowUpdateYearBuiltData { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.Enabled Property

Gets a value indicating whether write authorization enforcement is enabled.

False denies every write request; it does not open them.

public bool Enabled { get; }

Property Value

System.Boolean

GISWebAPIConfigurationFileWatcher.Key Property

Gets the secret access token for authorizing write operations, or the value of the DIGI_GIS_WEBAPI_KEY environment variable if not configured in the file.

public string? Key { get; }

Property Value

System.String

GISWebAPIConfigurationFileWatcher.Open Property

Gets a value indicating whether the key check is explicitly waived, leaving write endpoints reachable without an access key.

Intended for local development only. This is the sole setting that grants unauthenticated access to write endpoints.

public bool Open { get; }

Property Value

System.Boolean

GISWebAPIManager Class

Manages the creation and lifecycle of System.Net.Http.HttpClient instances used to interact with the GIS PostgreSQL Web API.

public class GISWebAPIManager

Inheritance System.Object → GISWebAPIManager

Constructors

GISWebAPIManager(IHttpClientFactory, string) Constructor

Initializes a new instance of the GISWebAPIManager class.

public GISWebAPIManager(System.Net.Http.IHttpClientFactory? httpClientFactory, string? key=null);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The HTTP client factory used to create and manage System.Net.Http.HttpClient instances.

key System.String

The optional API authorization key used for authenticating requests to protected endpoints.

Properties

GISWebAPIManager.Key Property

Gets or sets the API authorization key used for authenticating requests to protected endpoints.

public string? Key { get; set; }

Property Value

System.String

Methods

GISWebAPIManager.CreateHttpClient(string) Method

Creates an HttpClient instance with the specified name.

public System.Net.Http.HttpClient? CreateHttpClient(string name);

Parameters

name System.String

The unique identifier or name of the HTTP client to be created.

Returns

System.Net.Http.HttpClient
An System.Net.Http.HttpClient instance configured with the specified client name and authorization key header if configured.

GISWebAPIManager.CreateHttpClient<TControllerBase>(string) Method

Creates an System.Net.Http.HttpClient instance configured for the Web API, resolving the route associated with the specified controller type.

public System.Net.Http.HttpClient? CreateHttpClient<TControllerBase>(out string? route)
    where TControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase;

Type parameters

TControllerBase

The TControllerBase type parameter.

Parameters

route System.String

The route.

Returns

System.Net.Http.HttpClient
A task that represents the asynchronous operation.

GISWebAPIManager.CreateHttpClient<TControllerBase>(string, string) Method

Creates an System.Net.Http.HttpClient instance configured for the specified controller's method and retrieves the corresponding API path.

public System.Net.Http.HttpClient? CreateHttpClient<TControllerBase>(string methodName, out string? path)
    where TControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase;

Type parameters

TControllerBase

The type of the base controller used to resolve the endpoint path.

Parameters

methodName System.String

The name of the method within the controller to resolve.

path System.String

The path.

Returns

System.Net.Http.HttpClient
A task that represents the asynchronous operation.

HeatTransferCoefficientController Class

Controller responsible for handling API requests related to heat transfer coefficients, providing access to regulated heat transfer coefficient data.

public class HeatTransferCoefficientController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → HeatTransferCoefficientController

Constructors

HeatTransferCoefficientController() Constructor

Initializes a new instance of the HeatTransferCoefficientController class.

public HeatTransferCoefficientController();

Methods

HeatTransferCoefficientController.GetRegulatedHeatTransferCoefficientsByYearAsync(short, CancellationToken) Method

Retrieves the regulated heat transfer coefficients for a specified year.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetRegulatedHeatTransferCoefficientsByYearAsync(short year, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

year System.Int16

The year used to filter the regulated heat transfer coefficients.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult representing the result of the request, containing the retrieved coefficients or an error status.

HistogramRequestParameter Class

Parameter class containing options for generating histograms.

public class HistogramRequestParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → HistogramRequestParameter

Constructors

HistogramRequestParameter() Constructor

Initializes a new instance of the HistogramRequestParameter class.

public HistogramRequestParameter();

HistogramRequestParameter(JsonObject) Constructor

Initializes a new instance of the HistogramRequestParameter class using an System.Text.Json.Nodes.JsonObject object.

public HistogramRequestParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing data used to initialize the parameter.

Properties

HistogramRequestParameter.BucketCount Property

Gets or sets the total number of histogram buckets. Defaults to 10.

Capped because the bucket count is width_bucket's divisor rather than a page size: the server builds and returns one row per bucket whatever the table holds, so an unbounded value turns a cheap aggregate into an arbitrarily large response.

public int BucketCount { get; set; }

Property Value

System.Int32

Example

20

HistogramRequestParameter.ColumnUniqueId Property

Gets or sets the column unique identifier to calculate value distributions for.

public string ColumnUniqueId { get; set; }

Property Value

System.String

Example

"column_unique_id_123"

HistogramRequestParameter.CountyId Property

Gets or sets the target partition identifier (County ID). If null, histogram is generated across all partitions.

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

Property Value

System.Nullable<System.Int32>

Example

10365

HistogramRequestParameter.FilterGroup Property

Gets or sets the optional dynamic hierarchical filters to apply prior to generating the histogram.

public DiGi.PostgreSQL.Table.Classes.FilterGroup? FilterGroup { get; set; }

Property Value

DiGi.PostgreSQL.Table.Classes.FilterGroup

HistogramRequestParameter.HistogramBucketing Property

Gets or sets the bucketing rule. Defaults to DiGi.PostgreSQL.Table.Enums.HistogramBucketing.EqualWidth (width_bucket over the scope's [min, max], the maximum in the overflow bucket BucketCount + 1); DiGi.PostgreSQL.Table.Enums.HistogramBucketing.EqualCount (ntile) gives every bucket the same number of rows, so a skewed column keeps its resolution where its rows are - what a consumer placing quantiles needs (ZiolkowskiJakub/DiGi.PostgreSQL#7).

Sent as the integer value; an omitted property keeps equal width, so clients written against the earlier contract are unaffected.

public DiGi.PostgreSQL.Table.Enums.HistogramBucketing HistogramBucketing { get; set; }

Property Value

DiGi.PostgreSQL.Table.Enums.HistogramBucketing

Example

1

MultivalueAggregateRequestParameter Class

Parameter class containing options for multi-value database aggregation queries.

public class MultivalueAggregateRequestParameter : DiGi.WebAPI.Classes.Parameter

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.WebAPI.Classes.Parameter → MultivalueAggregateRequestParameter

Constructors

MultivalueAggregateRequestParameter() Constructor

Initializes a new instance of the MultivalueAggregateRequestParameter class.

public MultivalueAggregateRequestParameter();

MultivalueAggregateRequestParameter(JsonObject) Constructor

Initializes a new instance of the MultivalueAggregateRequestParameter class using a System.Text.Json.Nodes.JsonObject object.

public MultivalueAggregateRequestParameter(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing data used to initialize the parameter.

Properties

MultivalueAggregateRequestParameter.ColumnUniqueId Property

Gets or sets the column unique identifier to calculate statistics for.

public string ColumnUniqueId { get; set; }

Property Value

System.String

Example

"col_unique_id_123"

MultivalueAggregateRequestParameter.CountyId Property

Gets or sets the target partition identifier (County ID). If null, aggregation is performed across all partitions.

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

Property Value

System.Nullable<System.Int32>

Example

10365

MultivalueAggregateRequestParameter.FilterGroup Property

Gets or sets the optional dynamic hierarchical filters to apply prior to aggregation.

public DiGi.PostgreSQL.Table.Classes.FilterGroup? FilterGroup { get; set; }

Property Value

DiGi.PostgreSQL.Table.Classes.FilterGroup

MultivalueAggregateRequestParameter.MultivalueAggregateFunction Property

Gets or sets the multi-value aggregation function to perform.

public DiGi.PostgreSQL.Table.Enums.MultivalueAggregateFunction MultivalueAggregateFunction { get; set; }

Property Value

DiGi.PostgreSQL.Table.Enums.MultivalueAggregateFunction

Example

SplitDistinctCount

MultivalueAggregateRequestParameter.Separator Property

Gets or sets the optional string separator; defaults to null triggering dynamic auto-detection.

public string? Separator { get; set; }

Property Value

System.String

Example

","

OccupancyDataController Class

Controller responsible for handling requests related to occupancy data within the GIS PostgreSQL Web API.

public class OccupancyDataController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → OccupancyDataController

Constructors

OccupancyDataController(GISWebAPIConfigurationFileWatcher, Building2DOccupancyDataPostgreSQLConverter, AdministrativeAreal2DOccupancyDataPostgreSQLConverter, Building2DPostgreSQLConverter, AdministrativeAreal2DPostgreSQLConverter) Constructor

Initializes a new instance of the OccupancyDataController class.

public OccupancyDataController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.Building2DOccupancyDataPostgreSQLConverter building2DOccupancyDataPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DOccupancyDataPostgreSQLConverter administrativeAreal2DOccupancyDataPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter building2DPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter administrativeAreal2DPostgreSQLConverter);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The configuration file watcher used to monitor settings for the GIS PostgreSQL Web API.

building2DOccupancyDataPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.Building2DOccupancyDataPostgreSQLConverter

The converter used for building 2D occupancy data operations in the PostgreSQL database.

administrativeAreal2DOccupancyDataPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DOccupancyDataPostgreSQLConverter

The converter used for administrative areal 2D occupancy data operations in the PostgreSQL database.

building2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter

The converter for Building2D objects, used to read which county row a reference is already filed under.

administrativeAreal2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter

The converter used for administrative areal 2D data operations in the PostgreSQL database.

Methods

OccupancyDataController.AdministrativeAreal2DUpdateItemsAsync(JsonArray, string, CancellationToken) Method

Asynchronously updates occupancy data items for administrative areal 2D entities.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> AdministrativeAreal2DUpdateItemsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The System.Text.Json.Nodes.JsonArray containing the occupancy data items to be updated.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult representing the result of the update operation, returning a bad request if updates are disabled or no content if the input array is null or empty.

OccupancyDataController.Building2DUpdateItemsAsync(JsonArray, string, string, CancellationToken) Method

Asynchronously updates building 2D items based on the provided JSON data and identification code.

A county code does not identify a single county row: BDOT10k stores a county whose territory is disconnected as one feature per polygon part, and every part becomes its own row. Every part the code names is passed on, and each datum is filed under the part it actually belongs to - see Building2DUpdateItemsByCountyIdsAsync(JsonArray, int[], string, CancellationToken) for how that is decided.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> Building2DUpdateItemsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, string code, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The System.Text.Json.Nodes.JsonArray containing the item data to be updated.

code System.String

The identification code used to validate or categorize the update request.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OccupancyDataController.Building2DUpdateItemsByCountyIdsAsync(JsonArray, int[], string, CancellationToken) Method

Asynchronously updates building 2D occupancy items in the database for the given county rows.

The unambiguous counterpart of Building2DUpdateItemsAsync(JsonArray, string, string, CancellationToken): it takes county identifiers rather than a code, so the caller states which rows are in play instead of leaving the server to derive them.

The identifiers are the parts of one county in play, and each datum is filed under the part already holding the building_2d row its reference names, probed lowest part first - whether one identifier arrived or several, since naming one part is not evidence the county has one. That row was filed by geometry when it was imported, so reusing its answer keeps both tables keyed by the same (county_id, reference) pair.

A datum no named part holds is widened to every part of the county its parts name, and only a datum no part of the county holds is left unwritten - it carries no geometry of its own, so nothing states where it belongs, and storing it under a guessed part is the state this replaced.

The county-part lookup not running is answered as a distinct 500 naming it, and a transient database failure as 503 with Retry-After, so an unreachable database is never mistaken for a quiet no-op.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> Building2DUpdateItemsByCountyIdsAsync(System.Text.Json.Nodes.JsonArray? jsonArray, int[]? countyIds, string? key=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

jsonArray System.Text.Json.Nodes.JsonArray

The System.Text.Json.Nodes.JsonArray containing the item data to be updated.

countyIds System.Int32[]

The identifiers of the county rows the occupancy data belong to. Normally every polygon part of one county.

key System.String

The secret access key supplied in the request header.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OccupancyDataController.GetAdministrativeAreal2DItemsByReferenceAsync(string, CancellationToken) Method

Retrieves administrative areal 2D items based on the provided reference identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetAdministrativeAreal2DItemsByReferenceAsync(string reference, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string used to identify the administrative areal 2D items.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult representing the result of the operation, containing the requested items or an error response.

OccupancyDataController.GetBuilding2DDuplicateReferencesAsync(Nullable<int>, int, int, CancellationToken) Method

Asynchronously retrieves the building references that hold more than one occupancy data record, optionally filtered by county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DDuplicateReferencesAsync(System.Nullable<int> countyId=null, int limit=100, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Nullable<System.Int32>

The optional integer identifier of the county to filter by; if null, searches across all counties.

limit System.Int32

The maximum number of duplicate references to return. Defaults to 100.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult containing the list of duplicate references, or 404 if none are found.

OccupancyDataController.GetBuilding2DDuplicatesCountAsync(Nullable<int>, int, CancellationToken) Method

Asynchronously retrieves the total count of building references that hold more than one occupancy data record, optionally filtered by county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DDuplicatesCountAsync(System.Nullable<int> countyId=null, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Nullable<System.Int32>

The optional integer identifier of the county to filter by; if null, counts across all counties.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the duplicates count, or 404 if the partition does not exist or count is negative.

OccupancyDataController.GetBuilding2DItemsByReferenceAsync(string, Nullable<int>, CancellationToken) Method

Retrieves Building 2D occupancy data items based on a specified reference and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DItemsByReferenceAsync(string reference, System.Nullable<int> countyId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string used to identify the building 2D items.

countyId System.Nullable<System.Int32>

The optional identifier of the county associated with the building data.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult containing the requested building 2D items, or a Microsoft.AspNetCore.Mvc.BadRequestResult if the reference is null or whitespace.

OccupancyDatasPostTask Class

Represents a task for posting occupancy data to the GIS PostgreSQL Web API.

public class OccupancyDatasPostTask : DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.GIS.Classes.OccupancyData>

Inheritance System.Object → DiGi.Core.Classes.BackgroundTask → DiGi.Core.Classes.CancelableBackgroundTask → DiGi.Core.Classes.ReportableBackgroundTask<System.Int64> → DiGi.GIS.WebAPI.Classes.SerializableObjectsPostTask<DiGi.GIS.Classes.OccupancyData> → OccupancyDatasPostTask

Constructors

OccupancyDatasPostTask(GISWebAPIManager) Constructor

Initializes a new instance of the OccupancyDatasPostTask class.

public OccupancyDatasPostTask(DiGi.GIS.WebAPI.Classes.GISWebAPIManager GISWebAPIManager);

Parameters

GISWebAPIManager GISWebAPIManager

The manager used to handle GIS PostgreSQL Web API operations.

Properties

OccupancyDatasPostTask.Code Property

Gets or sets the code associated with the occupancy data post task.

A code does not identify a single county row - a multi-part county holds one row per polygon part - so set CountyIds instead wherever the identifiers are already known. CountyIds takes precedence when both are set.

public string? Code { get; set; }

Property Value

System.String

OccupancyDatasPostTask.CountyIds Property

Gets or sets the identifiers of the county rows the building 2D occupancy data belong to - normally every polygon part of one county, since a single id is not evidence the code has one part. When set it is used in preference to Code, which lets the server resolve the code to every part. It does not affect Values_AdministrativeAreal2D, which is not county-keyed.

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

Property Value

System.Collections.Generic.HashSet<System.Int32>

OccupancyDatasPostTask.Values_AdministrativeAreal2D Property

Gets or sets the collection of DiGi.GIS.Classes.OccupancyData values for administrative areal 2D.

public System.Collections.Generic.IEnumerable<DiGi.GIS.Classes.OccupancyData>? Values_AdministrativeAreal2D { get; set; }

Property Value

System.Collections.Generic.IEnumerable<DiGi.GIS.Classes.OccupancyData>

OrtoDatasController Class

Controller providing API endpoints for managing and accessing orthophoto data and related GIS spatial information via a PostgreSQL database.

public class OrtoDatasController : DiGi.WebAPI.Classes.WebAPIController

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → DiGi.WebAPI.Classes.WebAPIController → OrtoDatasController

Constructors

OrtoDatasController(GISWebAPIConfigurationFileWatcher, OrtoDatasPostgreSQLConverter, Building2DPostgreSQLConverter, AdministrativeAreal2DPostgreSQLConverter, SecurityKeyManager, TokenRevocationStore, YearBuiltDataPostgreSQLConverter) Constructor

Initializes a new instance of the OrtoDatasController class.

public OrtoDatasController(DiGi.GIS.WebAPI.Classes.GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher, DiGi.GIS.PostgreSQL.Classes.OrtoDatasPostgreSQLConverter ortoDatasPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter building2DPostgreSQLConverter, DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter administrativeAreal2DPostgreSQLConverter, DiGi.WebAPI.Classes.SecurityKeyManager? securityKeyManager=null, DiGi.WebAPI.Classes.TokenRevocationStore? tokenRevocationStore=null, DiGi.GIS.PostgreSQL.Classes.YearBuiltDataPostgreSQLConverter? yearBuiltDataPostgreSQLConverter=null);

Parameters

GISWebAPIConfigurationFileWatcher GISWebAPIConfigurationFileWatcher

The configuration file watcher used to monitor changes to the GIS PostgreSQL Web API settings.

ortoDatasPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.OrtoDatasPostgreSQLConverter

The converter used for handling OrtoDatas data operations within the PostgreSQL database.

building2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.Building2DPostgreSQLConverter

The converter used for handling Building 2D data operations within the PostgreSQL database.

administrativeAreal2DPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.AdministrativeAreal2DPostgreSQLConverter

The converter used for handling Administrative Areal 2D data operations within the PostgreSQL database.

securityKeyManager DiGi.WebAPI.Classes.SecurityKeyManager

The user extension's security key manager; null when the user extension is not loaded, in which case every user-token check denies.

tokenRevocationStore DiGi.WebAPI.Classes.TokenRevocationStore

The user extension's token revocation store; null when the user extension is not loaded, in which case every user-token check denies.

yearBuiltDataPostgreSQLConverter DiGi.GIS.PostgreSQL.Classes.YearBuiltDataPostgreSQLConverter

The converter reading the buildings and their year-built rows in the main database - the other half of the random unverified-building draw, whose orthophoto half is the storage database; null when the main store is not configured, in which case the draw answers 503.

Methods

OrtoDatasController.AcknowledgeBuilding2DReferencesAsync(IEnumerable<long>, CancellationToken) Method

Acknowledges and deletes completed building 2D reference objects from the update queue.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> AcknowledgeBuilding2DReferencesAsync(System.Collections.Generic.IEnumerable<long>? ids, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The collection of queue entry identifiers to acknowledge and remove from the queue.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.ContainsByReferencesAsync(List<string>, Nullable<int>, Nullable<bool>, CancellationToken) Method

Asynchronously checks for the existence of a collection of references, optionally filtered by a county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> ContainsByReferencesAsync(System.Collections.Generic.List<string>? references, System.Nullable<int> countyId, System.Nullable<bool> inverted, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

A list of strings representing the references to be checked.

countyId System.Nullable<System.Int32>

The identifier of the county partition to confine the check to. Omit to search every partition.

inverted System.Nullable<System.Boolean>

Returns the references that are absent rather than the ones present.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.GetCountByCountyIdAsync(int, bool, bool, int, CancellationToken) Method

Asynchronously retrieves the number of orthophoto rows stored for one county partition.

The cheapest question that can be asked of the store, and the one that separates a county nothing was ever downloaded for from one that was downloaded and holds nothing.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetCountByCountyIdAsync(int countyId, bool estimated=false, bool analyze=false, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The identifier of the county partition to count.

estimated System.Boolean

Reads the planner's row estimate instead of counting the rows. Far faster on a large partition and accurate to a few percent, but it reflects the last time the partition was analysed rather than this moment. An unanalysed partition returns 204 NoContent.

analyze System.Boolean

A boolean value indicating whether to perform an ANALYZE operation before reading the estimate to ensure statistics are current.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the count, 204 NoContent when the partition exists but is unanalysed, or 404 NotFound when the county has no partition.

OrtoDatasController.GetEstimatedCoverageFactorAsync(int, int, CancellationToken) Method

Retrieves the orthophoto coverage factor for a specified administrative area 2D identifier.

Below county level the figure is counted rather than estimated. A subdivision and a municipality have no partition of their own - both tables are partitioned by county_id - so the coverage is measured over the buildings whose centre lies inside the area's polygon, by reading its county once per side and matching the references in memory. Membership is geometric, not the stored subdivision_id: where the subdivision layer nests, a district holds nothing by that column while its polygon holds thousands, and a municipality is measured over its own polygon rather than as a sum of its subdivisions, which would count a nested city once per level (DiGi.GIS.PostgreSQL#77). County and above keep the planner's row estimate, which is what makes a voivodeship or a country affordable at all, so an exact sub-county figure and its county's estimate can differ by a few percent and both be right.

Where building data is measured but no orthophoto partition has been created for a county, the county has zero orthophotos stored and yields a coverage factor of 0.0. A coverage that cannot be measured (missing or unanalysed building data, or an unanalysed orthophoto partition) answers 204 NoContent; countbycountyid?estimated=true reads the state of one county, answering 200 when it is analysed, 204 when it is unanalysed and 404 when it has no partition.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetEstimatedCoverageFactorAsync(int administrativeAreal2DId, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

administrativeAreal2DId System.Int32

The unique identifier of the administrative area 2D.

commandTimeout System.Int32

The timeout in seconds for the execution of each command. A value of 0 disables the timeout. Defaults to 600 seconds.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the coverage factor, 204 NoContent when it could not be measured, or an error status code.

OrtoDatasController.GetEstimatedCoverageFactorsAsync(IEnumerable<int>, Nullable<bool>, int, CancellationToken) Method

Retrieves the orthophoto coverage factors for the specified administrative area identifiers.

The values come back in the order the identifiers were given, one per identifier, so a caller can update one row per value without matching anything up. A value is null where the coverage could not be measured (missing or unanalysed building data, or unanalysed orthophoto partition). Where building data is measured but no orthophoto partition has been created for a county, its orthophoto count is 0, yielding a coverage factor of 0.0.

A county, a voivodeship and a country are answered from the two tables row estimates - every identifier is resolved to the counties it stands for and both estimates are read for the whole set in one query per table. A subdivision and a municipality have no partition of their own and are instead counted, over the buildings whose centre lies inside their own polygon, by reading their county once per side; every subdivision and municipality of one county is served from that single pass. A municipality is one polygon, not a sum of its subdivisions - where the subdivision layer nests that sum counts a city once per level (DiGi.GIS.PostgreSQL#77).

Because counting reads a whole county, at most MaximumCoverageCountyCount distinct counties are counted per request, taken in the order the identifiers were given. Identifiers sitting in counties beyond that are answered null rather than given their county figure or failing the request.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetEstimatedCoverageFactorsAsync(System.Collections.Generic.IEnumerable<int> administrativeAreal2DIds, System.Nullable<bool> analyze, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The collection of administrative area 2D identifiers to be processed.

analyze System.Nullable<System.Boolean>

Refreshes the statistics before reading them. This applies only to the estimated county-and-above path and does nothing for a subdivision or a municipality, which are counted. It costs one VACUUM ANALYZE per resolved county partition on each of the two tables - for a country identifier that is several hundred maintenance statements against live partitions, so raise commandtimeout to match or leave the flag off.

commandTimeout System.Int32

The timeout in seconds for the execution of each command. A value of 0 disables the timeout. Defaults to 600 seconds.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.GetImageByReferenceAsync(string, short, Nullable<int>, bool, CancellationToken) Method

Retrieves the orthophoto image a building holds for one exact year.

Exact-year: the answer is the photo taken in that year, or a 404 when the building holds none for it - a year without a photo is not served by the nearest earlier one, which is what the previous floor lookup did. Send a year from yearsbyreference, which lists only the years that have a card.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetImageByReferenceAsync(string reference, short year, System.Nullable<int> countyId=null, bool fallbackByReference=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string of the orthophoto image.

year System.Int16

The exact year the orthophoto is requested for.

countyId System.Nullable<System.Int32>

The optional identifier of the county associated with the orthophoto data.

fallbackByReference System.Boolean

A boolean value indicating whether to re-run the read by reference alone when nothing is held under the named county.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation. 200 with the photo bytes, 404 when the building holds no photo for that year, 400 when the reference is missing, or 500 when the read failed.

OrtoDatasController.GetItemByReferenceAsync(string, Nullable<int>, CancellationToken) Method

Asynchronously retrieves an orthodata item based on the specified reference and optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetItemByReferenceAsync(string reference, System.Nullable<int> countyId=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string used to locate the orthodata item.

countyId System.Nullable<System.Int32>

The optional identifier of the county associated with the orthodata item.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.GetOrtoDatasReferenceByReferenceAsync(string, Nullable<int>, bool, CancellationToken) Method

Retrieves an orthodata reference by its unique reference code and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetOrtoDatasReferenceByReferenceAsync(string reference, System.Nullable<int> countyId=null, bool fallbackByReference=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference string of the building to retrieve orthodata metadata for.

countyId System.Nullable<System.Int32>

The optional integer identifier of the county used to filter the search.

fallbackByReference System.Boolean

A boolean value indicating whether to perform a fallback search across all partitions if not matched by county.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.GetOrtoDatasReferencesByBuilding2DReferencesAsync(IEnumerable<Building2DReference>, bool, CancellationToken) Method

Retrieves a list of orthodata references for the specified building 2D reference objects.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetOrtoDatasReferencesByBuilding2DReferencesAsync(System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Classes.Building2DReference> building2DReferences, bool fallbackByReference=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

building2DReferences System.Collections.Generic.IEnumerable<DiGi.GIS.PostgreSQL.Classes.Building2DReference>

A collection of DiGi.GIS.PostgreSQL.Classes.Building2DReference objects to query.

fallbackByReference System.Boolean

A boolean value indicating whether to perform a fallback search across all partitions if not matched by county.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.GetOrtoDatasReferencesByCountyIdAsync(int, int[], CancellationToken) Method

Retrieves a list of orthodata references for a specified county, with optional subdivision filtering.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetOrtoDatasReferencesByCountyIdAsync(int countyId, int[]? subdivisionIds=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The integer identifier of the county.

subdivisionIds System.Int32[]

An optional array of subdivision identifiers to filter by.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.GetOrtoDatasReferencesByReferencesAsync(IEnumerable<string>, Nullable<int>, bool, CancellationToken) Method

Retrieves a list of orthodata references for the specified building reference codes and optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetOrtoDatasReferencesByReferencesAsync(System.Collections.Generic.IEnumerable<string> references, System.Nullable<int> countyId=null, bool fallbackByReference=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

A collection of unique reference strings to query.

countyId System.Nullable<System.Int32>

The optional integer identifier of the county used to filter the search.

fallbackByReference System.Boolean

A boolean value indicating whether to perform a fallback search across all partitions if not matched by county.

cancellationToken System.Threading.CancellationToken

The cancellation token to observe.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation.

OrtoDatasController.GetPolygonalFace2DsByIdAsync(IEnumerable<int>, int, CancellationToken) Method

Resolves administrative areas to their polygons, keyed by identifier - the shape a coverage is measured over.

Any level is accepted, and each area is measured as one polygon: a municipality over its own outline rather than as the sum of its subdivisions, which double-counts wherever the subdivision layer nests (DiGi.GIS.PostgreSQL#77).

private System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<int,DiGi.Geometry.Planar.Classes.PolygonalFace2D>?> GetPolygonalFace2DsByIdAsync(System.Collections.Generic.IEnumerable<int> administrativeAreal2DIds, int commandTimeout, System.Threading.CancellationToken cancellationToken);

Parameters

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

The identifiers to resolve.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.Int32,DiGi.Geometry.Planar.Classes.PolygonalFace2D>>
The polygon of every identifier that has one, or null when the converter is missing or the rows could not be read.

OrtoDatasController.GetQueueSummariesByCountyIdsAsync(List<int>, int, CancellationToken) Method

Asynchronously reports what each of the named counties still has waiting in the orthophoto download queue.

Reads the queue without claiming anything from it, unlike NextBuilding2DReferencesAsync(int, int, int, int, CancellationToken), which claims the rows it returns. It is the only way to see what a refresh queued, and the way to watch the refresh and the download move against each other.

Naming no county reports every one. Counties with nothing waiting are absent from the result rather than present with a zero, so an empty result means the queue is drained.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetQueueSummariesByCountyIdsAsync(System.Collections.Generic.List<int>? countyIds, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The identifiers of the counties to report on, repeated once per county. Omit to report every one.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the queue depths as JSON, or an error status.

OrtoDatasController.GetRandomBuilding2DReferenceAsync(int[], int, CancellationToken) Method

Draws one building that has orthophoto coverage and no user-provided year built yet - the next candidate for a reviewer.

The drawn DiGi.GIS.PostgreSQL.Classes.Building2DReference carries the building_2d part it is filed under; that part is what the caller must send back on the write and on every read, since a county code can name several parts.

An optional repeated countyids confines the draw to those building_2d parts (?countyids=73482&countyids=73485, one per polygon part - never a county code); omitted or empty draws from every covered part.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetRandomBuilding2DReferenceAsync(int[]? countyIds=null, int commandTimeout=30, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyIds System.Int32[]

Optional building_2d part ids that confine the draw; omitted or empty draws from every covered part.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

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

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A task that represents the asynchronous operation. 200 with the drawn building, 404 when no unverified covered building remains (in the requested parts, when given), 401 without a valid user token, 400 for an invalid timeout, or 503 when the main (year built) store is not configured.

OrtoDatasController.GetSubdivisionLinksByCountyIdAsync(int, int, int, CancellationToken) Method

Asynchronously compares, for one county, the subdivision each building is filed under against the one its orthophoto row carries.

The two tables live in different databases, so nothing keeps them in step on its own and no query can join them - each side is read once and matched in memory. This is the only place the two can be seen together.

Read the result across a run rather than on its own. OrtoDatasOnlyCount counts rows whose orthophoto knows a subdivision the building no longer does, and nothing legitimate removes one, so a refresh that lowers it is doing damage. Building2DOnlyCount counts what a refresh exists to fix: it should fall to near zero and stay there, and climbing again once the download drains the queue is issue #36.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetSubdivisionLinksByCountyIdAsync(int countyId, int sampleCount=20, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyId System.Int32

The identifier of the county to compare. One polygon part, not a code - a multi-part county is compared a part at a time.

sampleCount System.Int32

How many references to name back per disagreeing category. The counts are exact whatever this is; the samples are what make a disagreement actionable.

commandTimeout System.Int32

The timeout in seconds for the execution of each command. A value of 0 disables the timeout. Defaults to 600 seconds.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the comparison as JSON, or an error status.

OrtoDatasController.GetSummariesByCountyIdsAsync(List<int>, int, CancellationToken) Method

Asynchronously summarises what each of the named county partitions holds: how many rows, how many name a subdivision, how many distinct subdivisions they are spread across, and when they were written.

The measurement to take either side of a refresh. A building's subdivision is resolved in another database and pushed across, so DiGi.GIS.PostgreSQL.Classes.OrtoDatasCountyResult.WithSubdivisionIdCount can only ever be gained - a run that lowers it is clearing subdivisions rather than filling them in, which is the defect of issues #23, #31 and #36.

Naming no county summarises every partition, in one grouped statement. Counties holding no row are absent from the result rather than present with a zero.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetSummariesByCountyIdsAsync(System.Collections.Generic.List<int>? countyIds, int commandTimeout=600, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The identifiers of the county partitions to summarise, repeated once per county. Omit to summarise every one.

commandTimeout System.Int32

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

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
An Microsoft.AspNetCore.Mvc.IActionResult carrying the summaries as JSON, or an error status.

OrtoDatasController.GetYearsByReferenceAsync(string, Nullable<int>, bool, CancellationToken) Method

Lists the years that hold a photo for one building - only the years that have imagery, not every year of the [min, max] range.

The read is projected on the server: it answers the years that have a card and never reads the photo bytes, so listing a building's years stays cheap no matter how much imagery it carries. A building with no orthophotos answers 204, so an empty answer is a result the caller can act on rather than a failure to special-case.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetYearsByReferenceAsync(string reference, System.Nullable<int> countyId=null, bool fallbackByReference=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The reference of the building to list the years of.

countyId System.Nullable<System.Int32>

The optional identifier of the county part the building is filed under.

fallbackByReference System.Boolean

Re-run the read by reference alone when nothing is held under the named county.

cancellationToken System.Threading.CancellationToken

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

Returns

[System.Threading.Tasks.Task<](https://learn.microsoft.c

Clone this wiki locally