Skip to content

DiGi.GIS.WebAPI.UI.Controllers

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

DiGi.GIS.WebAPI.UI.Controllers Namespace

Classes

AdministrativeAreal2DController Class

Provides the pages and partial views of the administrative area feature.

The data itself is owned by the GIS Web API (gis/administrativeareal2D); this controller only reads it and renders it, so the query rules stay owned by that service and cannot drift here.

public class AdministrativeAreal2DController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → AdministrativeAreal2DController

Constructors

AdministrativeAreal2DController(IHttpClientFactory) Constructor

Initializes a new instance of the AdministrativeAreal2DController class.

public AdministrativeAreal2DController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create HTTP clients.

Methods

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencePathsByNameAsync(string, CancellationToken) Method

Searches for administrative area reference paths by name.

Status-preserving: an upstream failure (502) or no answer (503) is a refusal the page names, distinct from the empty result (204) (issue #40).

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 text to search for within the name column.

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 System.Threading.Tasks.Task<> containing the search result, a 204 No Content response when the upstream answers no matches, a 502 Bad Gateway response when the upstream answers a failure, a 503 Service Unavailable response when it answers nothing at all, or an empty 200 response for a blank search.

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

Retrieves administrative 2D area references based on the specified administrative areal type, parent identifier, and unique code filter.

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 type of the administrative area.

parentId System.Nullable<System.Int32>

The optional identifier of the parent administrative area.

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 the caller to cancel the asynchronous operation.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
A System.Threading.Tasks.Task<> representing the asynchronous operation result.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencesByCodeAsync(string, CancellationToken) Method

Retrieves administrative areal 2D references by the specified code asynchronously.

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

Parameters

code System.String

The code used to retrieve the administrative areal 2D references.

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 System.Threading.Tasks.Task<> representing the asynchronous operation result.

AdministrativeAreal2DController.GetAdministrativeAreal2DReferencesByIdAsync(int, CancellationToken) Method

Retrieves the administrative areal 2D references by their identifier.

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

Parameters

id System.Int32

The unique identifier of the administrative areal 2D reference.

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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult.

AdministrativeAreal2DController.GetItemByCodeAsync(string, CancellationToken) Method

Retrieves an administrative areal 2D item by its specified code.

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

Parameters

code System.String

The code of the item to retrieve.

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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult.

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

Retrieves items filtered by the specified 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 (e.g., country, voivodeship, county, municipality) to filter by.

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 System.Threading.Tasks.Task<> representing the asynchronous operation result containing the items or an error response.

AdministrativeAreal2DController.GetPolygonsByIdAsync(int, Nullable<double>, Nullable<int>, CancellationToken) Method

Retrieves the outlines of an administrative area, reduced for drawing as an overview map.

An area whose territory is disconnected is stored as one row per polygon part, so an area identified by a code is drawn from every row sharing that code. An area addressed directly (a municipality or a subdivision) is drawn from its own row alone.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetPolygonsByIdAsync(int id, System.Nullable<double> reductionFactor=null, System.Nullable<int> minCount=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

id System.Int32

The unique identifier of the administrative area.

reductionFactor System.Nullable<System.Double>

The optional reduction factor used to simplify the geometry of the retrieved polygons. When omitted, a factor matching the size of the area is applied.

minCount System.Nullable<System.Int32>

The optional fewest points a reduced outline may keep. When omitted, a count matching the size of the area is applied.

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 Microsoft.AspNetCore.Mvc.IActionResult carrying one flat coordinate list per outline.

AdministrativeAreal2DController.MinimumPointCount(AdministrativeArealType) Method

Gives the fewest points an outline of the given kind of area is allowed to keep.

private static int MinimumPointCount(DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType);

Parameters

administrativeArealType DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType

The kind of administrative area.

Returns

System.Int32
The fewest points to keep.

AdministrativeAreal2DController.ReductionFactor(AdministrativeArealType) Method

Gives the reduction factor an outline of the given kind of area is simplified with.

private static double ReductionFactor(DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType administrativeArealType);

Parameters

administrativeArealType DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType

The kind of administrative area.

Returns

System.Double
The reduction factor.

AdministrativeAreal2DController.Start() Method

Starts the Administrative Areal 2D view.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult result that renders the start view.

Building2DController Class

Provides the pages and partial views of the building feature.

The data itself is owned by the GIS Web API (gis/building2D); this controller only reads it and renders it.

public class Building2DController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → Building2DController

Constructors

Building2DController(IHttpClientFactory) Constructor

Initializes a new instance of the Building2DController class.

public Building2DController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create System.Net.Http.HttpClient instances.

Methods

Building2DController.CountyIdsAsync(HttpClient, Nullable<double>, Nullable<double>, CancellationToken) Method

Asynchronously resolves which county polygon parts a plan position can be filed under.

Used only as a fallback: the 3D viewer knows a building by its reference and its centroid, and the reference alone does not say which county partition holds it.

Every part of the county the point falls in is returned, not just the part covering the point. A county whose territory is disconnected is stored as one row per part and the building is filed under one of them, which need not be the part its own coordinates fall in.

private static System.Threading.Tasks.Task<System.Collections.Generic.List<int>?> CountyIdsAsync(System.Net.Http.HttpClient httpClient, System.Nullable<double> x, System.Nullable<double> y, System.Threading.CancellationToken cancellationToken);

Parameters

httpClient System.Net.Http.HttpClient

The HTTP client used for the requests.

x System.Nullable<System.Double>

The X coordinate, in PL-1992 (EPSG:2180) metres. This value can be null.

y System.Nullable<System.Double>

The Y coordinate, in PL-1992 (EPSG:2180) metres. 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<System.Collections.Generic.List<System.Int32>>
The identifiers of every polygon part of the county, in ascending order, or null when no county could be resolved.

Building2DController.GetBuilding2DReferencesByAdministrativeAreal2DIdAsync(int, CancellationToken) Method

Asynchronously retrieves building 2D references associated with the specified administrative areal 2D identifier.

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 administrative areal 2D identifier to filter by.

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 System.Threading.Tasks.Task<> representing the asynchronous operation.

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

Renders the standalone building details page for the specified building reference (used e.g. by the "Show" button of the 3D viewer "Details" panel).

The partial view _Building2DView cannot be rendered on its own: it depends on the scripts, styles and AJAX loading logic of the references master-detail layout. The building context is therefore injected into Building2DDetailsView, which renders only the details side and loads the partial through the same AJAX pipeline.

The building data is partitioned per county, so the by-reference lookup requires a county identifier. When it is not provided, it is resolved from the optional x/y point (e.g. the building centroid known to the 3D viewer).

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

Parameters

reference System.String

The unique reference string of the building.

countyId System.Nullable<System.Int32>

The optional unique identifier of the county associated with the building.

x System.Nullable<System.Double>

The optional X coordinate of a point inside the building used to resolve the county when countyId is not provided.

y System.Nullable<System.Double>

The optional Y coordinate of a point inside the building used to resolve the county when countyId is not provided.

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 System.Threading.Tasks.Task<> rendering the building details page.

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

Asynchronously retrieves a building 2D item by its unique 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 item to retrieve.

countyId System.Nullable<System.Int32>

The optional unique identifier of the county associated with the 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, containing the Microsoft.AspNetCore.Mvc.IActionResult result.

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

Retrieves the bounding-box centres of every building of an administrative area, keyed by reference and county part, for the 2D dot rendering of the Typology area view.

A relay of the GIS Web API's compact gis/building2D/centroidsbyadministrativeareal2Did (DiGi.GIS.WebAPI#40), answered without the _type discriminator (Building2DCentroidsAsync(this HttpClient, int, int, CancellationToken)). The area is resolved upstream through its subdivision children, so a county part identifier answers the buildings of every part sharing the code, each row carrying the county part it is actually filed under - a reference is unique only per county partition, so the view joins by (reference, countyId). An area resolving to no subdivision answers an empty list, which is "nothing to draw"; an upstream failure, after one retry with a doubled command timeout for a cold partition, answers Microsoft.AspNetCore.Http.StatusCodes.Status204NoContent so the outline still renders without its dots.

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

Parameters

administrativeAreal2DId System.Int32

The unique identifier of the administrative area.

commandTimeout System.Nullable<System.Int32>

The optional upstream command timeout in seconds for the first attempt. When omitted, 30 seconds is applied.

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 System.Threading.Tasks.Task<> carrying the centroids as Building2DCentroidViewModel items, a 400 Bad Request response for an invalid identifier or timeout, or a 204 No Content response when the upstream answered nothing.

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

Retrieves the outline of a building footprint, reduced for drawing.

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

Parameters

id System.Int64

The unique identifier of the building.

countyId System.Nullable<System.Int32>

The optional county identifier used to filter the request.

reductionFactor System.Nullable<System.Double>

The optional reduction factor for simplifying the polygon geometry.

minCount System.Nullable<System.Int32>

The optional fewest points the reduced outline may keep.

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 System.Threading.Tasks.Task<> carrying the outline as a space separated coordinate list.

Building2DController.Start() Method

Initializes and returns the start view for the 2D building interface.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult result that renders the starting view.

BuildingDataController Class

Provides controller endpoints for accessing and managing building data, acting as an interface between the client and the underlying GIS building data services.

public class BuildingDataController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → BuildingDataController

Constructors

BuildingDataController(IHttpClientFactory) Constructor

Initializes a new instance of the BuildingDataController class.

public BuildingDataController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create and manage System.Net.Http.HttpClient instances for making API requests.

Methods

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

Asynchronously retrieves a building data table based on the specified reference and an optional county identifier.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetTableByReferenceAsync(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 look up the table.

countyId System.Nullable<System.Int32>

The optional ID of the county associated with the request.

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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult representing the HTTP response.

BuildingModelController Class

Provides controller endpoints for accessing analytical DiGi.Analytical.Building.Classes.BuildingModel data, acting as an interface between the client and the underlying GIS building data services.

public class BuildingModelController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → BuildingModelController

Constructors

BuildingModelController(IHttpClientFactory) Constructor

Initializes a new instance of the BuildingModelController class.

public BuildingModelController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create and manage System.Net.Http.HttpClient instances for making API requests.

Methods

BuildingModelController.AddTerrainAsync(List<GLTFNode>, HttpClient, Circle2D, IEnumerable<BuildingModel>, CancellationToken) Method

Adds the ground surface around the given circular area to the nodes of a scene, with the outlines of the buildings of the scene cut out of it.

The surface is optional: no stored elevation points, an undeployed or unreachable terrain service and a timeout all leave the scene exactly as it was, so a building scene never depends on terrain being there.

private static System.Threading.Tasks.Task AddTerrainAsync(System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFNode> gLTFNodes, System.Net.Http.HttpClient httpClient, DiGi.Geometry.Planar.Classes.Circle2D? circle2D, System.Collections.Generic.IEnumerable<DiGi.Analytical.Building.Classes.BuildingModel>? buildingModels, System.Threading.CancellationToken cancellationToken);

Parameters

gLTFNodes System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFNode>

The nodes of the scene being built.

httpClient System.Net.Http.HttpClient

The HTTP client used for the request.

circle2D DiGi.Geometry.Planar.Classes.Circle2D

The circular area of ground to show, in PL-1992 (EPSG:2180) metres. This value can be null.

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

The buildings of the scene, whose outlines are cut out of the ground so it does not run through their interiors (see TerrainGLTFNode(this GLTFNode, IEnumerable<BuildingModel>, Circle2D, double, double)). 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
A System.Threading.Tasks.Task representing the asynchronous operation.

BuildingModelController.GetBuildingModelByIdAsync(long, Nullable<int>, CancellationToken) Method

Renders the 3D viewer page for a single building. The page itself carries no geometry; the viewer streams the binary glTF payload from the glb endpoint.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuildingModelByIdAsync(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>

The optional unique identifier of the county associated with the building.

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 rendering the glTF scene view.

BuildingModelController.GetBuildingsGLBByRadiusAsync(double, double, double, CancellationToken) Method

Asynchronously retrieves all building models within the specified circular area from the PostgreSQL database via the GIS Web API, converts each DiGi.Analytical.Building.Classes.BuildingModel into a batched DiGi.GLTF.Classes.GLTFScene with buildings selectable as whole envelopes and streams it as a binary glTF (.glb) payload.

The search is purely spatial: the area may span multiple counties, so no county identifier is required.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuildingsGLBByRadiusAsync(double centerX, double centerY, double radius, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

centerX System.Double

The X coordinate of the center of the search circle.

centerY System.Double

The Y coordinate of the center of the search circle.

radius System.Double

The radius of the search circle in meters.

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 System.Threading.Tasks.Task<> holding the .glb file.

BuildingModelController.GetGLBBuildingModelByIdAsync(long, Nullable<int>, CancellationToken) Method

Asynchronously retrieves the 3D DiGi.Analytical.Building.Classes.BuildingModel for the building with the specified unique identifier from the database (see BuildingModelAsync(this HttpClient, long, Nullable<int>, CancellationToken)), converts each of its components (walls, floors and roofs) into a separate node of a batched DiGi.GLTF.Classes.GLTFScene (translated to a local origin) and streams it as a binary glTF (.glb) payload.

Each component carries its own identity in the scene object map, so the 3D viewer can hit-test and select individual components instead of the building as a whole.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetGLBBuildingModelByIdAsync(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>

The optional unique identifier of the county associated with the building.

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 System.Threading.Tasks.Task<> holding the .glb file.

BuildingModelController.GetItemByReferenceAsync(string, double, double, CancellationToken) Method

Asynchronously loads a DiGi.Analytical.Building.Classes.BuildingModel from the GIS Web API by searching for the building at the specified coordinates, converts its components into separate selectable DiGi.GLTF.Classes.GLTFNode instances and renders the 3D viewer page.

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

Parameters

reference System.String

The reference of the building model.

x System.Double

The X coordinate of the building centroid.

y System.Double

The Y coordinate of the building centroid.

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 System.Threading.Tasks.Task<> rendering the 3D glTF scene view or a not found response.

BuildingModelController.GetItemsByRadius(double, double, double) Method

Renders the 3D viewer page for all buildings within the specified circular area. The page itself carries no geometry; the viewer streams the binary glTF payload from the glb endpoint.

The search is purely spatial: the area may span multiple counties, so no county identifier is required.

public Microsoft.AspNetCore.Mvc.IActionResult GetItemsByRadius(double centerX, double centerY, double radius);

Parameters

centerX System.Double

The X coordinate of the center of the search circle.

centerY System.Double

The Y coordinate of the center of the search circle.

radius System.Double

The radius of the search circle in meters.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult rendering the glTF scene view.

BuildingModelController.Start() Method

Handles the HTTP GET request to the root endpoint and returns the 3D viewer landing page.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult representing the start view.

CommunicationController Class

Provides the communication analysis feature: an input page for the analyzed circular area, the 3D scene view with the antenna toolbar and the calculation endpoint that fetches the analyzed area buildings and solves the radio propagation between the placed antennas in process.

public class CommunicationController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → CommunicationController

Constructors

CommunicationController(IHttpClientFactory) Constructor

Initializes a new instance of the CommunicationController class.

public CommunicationController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create System.Net.Http.HttpClient instances.

Methods

CommunicationController.CalculateAsync(CommunicationCalculationParameter, CancellationToken) Method

Executes the communication calculation for the antennas placed in the 3D view.

The buildings of the analyzed area are fetched as DiGi.Analytical.Building.Classes.BuildingModel instances and converted to DiGi.Communication.Classes.ScatteringObject instances, packaged together with the antennas into a DiGi.Communication.Classes.GeometricalPropagationModel and solved in process (DiGi.Communication.Classes.ScatteringSolver + DiGi.Communication.Classes.AngularPowerDistributionSolver); nothing is persisted.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> CalculateAsync(DiGi.GIS.WebAPI.UI.Classes.CommunicationCalculationParameter? communicationCalculationParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

communicationCalculationParameter CommunicationCalculationParameter

The analyzed circular area and the antennas placed by the user.

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 System.Threading.Tasks.Task<> holding the DiGi.Communication.WebAPI.Classes.GeometricalPropagationResult JSON grouped by delay (ascending): the propagation ellipsoids, the scattering polylines (one per DiGi.Communication.Classes.ScatteringPointGroup) and the angular power distribution vectors, all in world coordinates.

CommunicationController.GetBuildingsByRadius(double, double, double) Method

Renders the communication 3D scene view for all buildings within the specified circular area (streamed as a binary glTF payload from the existing glb endpoint) together with the antenna toolbar.

public Microsoft.AspNetCore.Mvc.IActionResult GetBuildingsByRadius(double centerX, double centerY, double radius);

Parameters

centerX System.Double

The X coordinate of the center of the analyzed circular area.

centerY System.Double

The Y coordinate of the center of the analyzed circular area.

radius System.Double

The radius of the analyzed circular area in meters.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult rendering the communication scene view.

CommunicationController.Start() Method

Initializes and returns the start view of the communication analysis feature.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult result that renders the starting view.

EPWFileController Class

Provides controller endpoints for accessing and managing EPW file data.

public class EPWFileController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → EPWFileController

Constructors

EPWFileController(IHttpClientFactory) Constructor

Initializes a new instance of the EPWFileController class.

public EPWFileController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The HTTP client factory.

Methods

EPWFileController.GetEPWFileAsync(double, double, CancellationToken) Method

Asynchronously retrieves an EPW file based on the specified coordinates.

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, in PL-1992 (EPSG:2180) metres.

y System.Double

The Y coordinate, in PL-1992 (EPSG:2180) metres.

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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult representing the HTTP response.

HeatTransferCoefficientController Class

Controller responsible for handling requests related to heat transfer coefficients, providing data based on year or building reference.

public class HeatTransferCoefficientController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → HeatTransferCoefficientController

Constructors

HeatTransferCoefficientController(IHttpClientFactory) Constructor

Initializes a new instance of the HeatTransferCoefficientController class.

public HeatTransferCoefficientController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The HTTP client factory used to create clients for external API communication.

Methods

HeatTransferCoefficientController.GetRegulatedHeatTransferCoefficientsByReferenceAsync(string, Nullable<int>, CancellationToken) Method

Retrieves regulated heat transfer coefficients for a building identified by its reference, determining the applicable year based on the building's construction data.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetRegulatedHeatTransferCoefficientsByReferenceAsync(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.

countyId System.Nullable<System.Int32>

The optional identifier for the county associated with the building.

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 a partial view with the coefficient data, or an error result if the request fails.

HomeController Class

Provides the controller logic for handling requests to the home page of the GIS WebAPI user interface.

public class HomeController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → HomeController

Constructors

HomeController() Constructor

Initializes a new instance of the HomeController class.

The landing pages carry no data of their own, so nothing is injected here.

public HomeController();

Methods

HomeController.About() Method

Returns the view for the About page.

public Microsoft.AspNetCore.Mvc.IActionResult About();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult result.

HomeController.Start() Method

Returns the view for the Start page.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult result.

OccupancyDataController Class

Controller responsible for handling requests related to occupancy data for 2D buildings.

public class OccupancyDataController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → OccupancyDataController

Constructors

OccupancyDataController(IHttpClientFactory) Constructor

Initializes a new instance of the OccupancyDataController class.

public OccupancyDataController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The HTTP client factory used to create clients for external API communication.

Methods

OccupancyDataController.GetBuilding2DItemByReferenceAsync(string, Nullable<int>, CancellationToken) Method

Retrieves the occupancy data and building reference for a specific 2D building item by its reference.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetBuilding2DItemByReferenceAsync(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.

countyId System.Nullable<System.Int32>

The optional ID of the county associated with the building.

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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult, which returns a partial view containing the occupancy data if successful; otherwise, a bad request or no content response.

OrtoDataController Class

Provides the Orto Data verification page and the endpoints it uses, each relaying to the GIS Web API with the visitor's session presented as a bearer token.

Distinct from OrtoDatasController, which serves the orthophoto coverage panel of the building details page. This controller is the whole of a standalone page: it draws a building that has photos but no user year built answer yet, shows one card per photo year, and records the reviewer's answer.

The page requires a session: the page action redirects an anonymous visitor to the sign-in page, and every other action answers 401, which the page script answers with one refresh attempt and then a sign-out (wwwroot/js/user.js).

public class OrtoDataController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → OrtoDataController

Constructors

OrtoDataController(IHttpClientFactory) Constructor

Initializes a new instance of the OrtoDataController class.

public OrtoDataController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create HTTP clients.

Methods

OrtoDataController.GetBuildingAsync(Nullable<int>, string, CancellationToken) Method

Reads a named building with its photo years and the answer already recorded for it.

Direct mode: reached from the query values the page was opened with, and the only mode that can carry an existing answer - a freshly drawn building has none by construction.

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

Parameters

countyId System.Nullable<System.Int32>

The optional identifier of the county part the building is filed under; omitted, the service resolves the reference to the lowest part holding it.

reference System.String

The reference of the building to read.

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 holding the building with its years and any recorded answer, 404 when no such building exists, 400 without a reference, 401 without a session, 503 when the service answered nothing at all, or the status the service answered with.

OrtoDataController.GetImageAsync(Nullable<int>, string, Nullable<short>, CancellationToken) Method

Reads the orthophoto image of a building for one year, as JPEG bytes.

The image is requested only for years the years read listed, and a year the service holds no photo for answers 404 here, which the page turns into a hidden card.

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

Parameters

countyId System.Nullable<System.Int32>

The optional identifier of the county part the building is filed under.

reference System.String

The reference of the building.

year System.Nullable<System.Int16>

The photo year to read.

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 holding the image, 404 when there is none, 400 without a reference or year, or 401 without a session.

OrtoDataController.GetRandomAsync(int[], CancellationToken) Method

Draws the next building to verify and reads the photo years it holds.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetRandomAsync(int[]? countyIds, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

countyIds System.Int32[]

Optional building_2d part ids confining the draw; omitted or empty draws from every covered part.

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 holding the drawn building with its years, the empty state when nothing unverified remains, 401 without a session, or the status the service answered with.

OrtoDataController.SetUserYearBuiltAsync(UserYearBuiltParameter, CancellationToken) Method

Records a reviewer's year built answer for a building, relaying it to the GIS Web API.

The upstream status is mirrored rather than reinterpreted: 404 is the page's "building not found", 400 the service's own refusal of an incomplete answer, 401 a spent session, and a 500 or 503 a server fault that must not be reported as the caller's mistake.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> SetUserYearBuiltAsync(DiGi.GIS.WebAPI.UI.Classes.UserYearBuiltParameter? userYearBuiltParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

userYearBuiltParameter UserYearBuiltParameter

The submitted answer.

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 that is empty on success or carries the status the service answered with.

OrtoDataController.Start() Method

Returns the Orto Data verification page.

The page itself carries no building: its script draws one on load, either the next unverified building or the one named by the countyid and reference query values it reads itself. The optional repeated countyids confines the script's draws to those building_2d parts.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult holding the verification view, or a redirect to the sign-in page for an anonymous visitor.

OrtoDataController.YearsAsync(HttpClient, string, Nullable<int>, string, CancellationToken) Method

Reads the photo years the GIS Web API holds for a building, presenting the session token the read requires.

Asked with fallbackbyreference, so a reference filed under a different county part than the one named still answers with the part that holds it.

private static System.Threading.Tasks.Task<System.Collections.Generic.List<short>?> YearsAsync(System.Net.Http.HttpClient httpClient, string? reference, System.Nullable<int> countyId, string? tokenString, System.Threading.CancellationToken cancellationToken);

Parameters

httpClient System.Net.Http.HttpClient

The HTTP client used for the request.

reference System.String

The reference of the building.

countyId System.Nullable<System.Int32>

The identifier of the county part the building is filed under. This value can be null.

tokenString System.String

The session token to present to the service.

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.List<System.Int16>>
The sorted years that hold a photo, or null when the service answered with none.

OrtoDatasController Class

Controller providing endpoints for managing and retrieving orthodata and coverage factor information.

public class OrtoDatasController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → OrtoDatasController

Constructors

OrtoDatasController(IHttpClientFactory) Constructor

Initializes a new instance of the OrtoDatasController class.

public OrtoDatasController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

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

Methods

OrtoDatasController.GetEstimatedCoverageFactorAsync(int, CancellationToken) Method

Retrieves the estimated orthophoto coverage factor of a single administrative area.

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

Parameters

administrativeAreal2DId System.Int32

The unique identifier of the administrative area.

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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult with the coverage factor or error status.

OrtoDatasController.GetEstimatedCoverageFactorsAsync(IEnumerable<int>, CancellationToken) Method

Retrieves the estimated orthophoto coverage factors of several administrative areas at once.

The values come back in the order the identifiers were given, which is what lets the page update one progress bar per row without matching anything up.

A value is null where the coverage could not be measured, which the API keeps distinct from zero - a county nothing has ever been downloaded for is not a county that is nought per cent covered. Relayed on as null so the page can show it as such rather than drawing an empty bar.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetEstimatedCoverageFactorsAsync(System.Collections.Generic.IEnumerable<int> administrativeAreal2DIds, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

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

The unique identifiers of the administrative areas.

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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult with the list of coverage factor values or error status.

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

Retrieves orthodata and building 2D reference information based on a provided reference and optional county ID.

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 for the item.

countyId System.Nullable<System.Int32>

The optional identifier for the 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. The task result contains an Microsoft.AspNetCore.Mvc.IActionResult representing the partial view or error response.

SolarController Class

Solar calculations for the 3D viewers: the sun position for the Lighting panel, and the annual solar radiation on the external walls and roofs of one building, calculated on this host's CPU with DiGi.Solar over one EPW year, with the building itself and its neighbours casting shade.

The radiation routes answer the same refusals: 400 for a neighbour radius outside (0, SolarSurroundingRadiusMax], 204 when the building or its weather file is not found, 422 when the building cannot be located or has no closed external envelope, 413 above SolarReceiverCountMax receiving surfaces or SolarCasterTriangleCountMax caster triangles, 502 when the neighbours cannot be read, 503 with Retry-After when the solve gate stays busy for SolarSolveGateWaitSeconds seconds, and 499 / 504 / 500 for a client cancel, an upstream timeout and any other failure.

Buildings above those ceilings are calculated as background jobs (solar/jobs, DiGi.GIS.WebAPI.UI#60): the POST runs the same checks with the job ceilings (SolarJobReceiverCountMax, SolarJobCasterTriangleCountMax), queues the prepared calculation and answers 202, or 503 with Retry-After when SolarJobQueueLengthMax jobs are already waiting. The job routes answer 404 for an unknown or expired job and 409 for results of a job that has not completed.

public class SolarController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → SolarController

Constructors

SolarController(IHttpClientFactory, SemaphoreSlim, SolarJobQueue, ILogger<SolarController>) Constructor

Initializes a new instance of the SolarController class.

public SolarController(System.Net.Http.IHttpClientFactory httpClientFactory, System.Threading.SemaphoreSlim semaphoreSlim, DiGi.GIS.WebAPI.UI.Classes.SolarJobQueue solarJobQueue, Microsoft.Extensions.Logging.ILogger<DiGi.GIS.WebAPI.UI.Controllers.SolarController> logger);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create System.Net.Http.HttpClient instances.

semaphoreSlim System.Threading.SemaphoreSlim

The gate shared by every solar radiation solve on this host, registered under SolarSolveGateKey.

solarJobQueue SolarJobQueue

The background solar radiation jobs of this host.

logger Microsoft.Extensions.Logging.ILogger<SolarController>

The logger receiving one line per solar radiation request.

Properties

SolarController.SolveGateWait Property

Gets or sets how long a synchronous request waits for the solve gate before it is refused with a 503; SolarSolveGateWaitSeconds outside the tests.

internal System.TimeSpan SolveGateWait { internal get; internal set; }

Property Value

System.TimeSpan

Methods

SolarController.DeleteJob(Guid) Method

Cancels a background solar radiation job: a queued job is never calculated; a running calculation cannot be interrupted, so it finishes and its results are discarded.

public Microsoft.AspNetCore.Mvc.IActionResult DeleteJob(System.Guid jobId);

Parameters

jobId System.Guid

The unique identifier of the job.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
204; 404 when the job is unknown or has expired.

SolarController.GetBuildingModelByIdAsync(long, Nullable<int>, Nullable<double>, CancellationToken) Method

Displays the solar radiation 3D viewer of a building: the page streams its scene from GetGLBBuildingModelByIdAsync(long, Nullable<int>, Nullable<double>, CancellationToken) and shows a legend with the colour ramp, the neighbour radius and the EPW station. The page itself carries no geometry and runs no solve.

When the scene request is refused with a 413, the page offers a background calculation (PostJobAsync(long, Nullable<int>, Nullable<double>, CancellationToken)), polls it and loads its scene from GetJobGLB(Guid); the job identifier is kept in the page address (job), so a reload resumes the polling.

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

Parameters

id System.Int64

The unique identifier of the building.

countyId System.Nullable<System.Int32>

The optional unique identifier of the county associated with the building.

radius System.Nullable<System.Double>

The neighbour radius in metres, measured from the edge of the footprint; omitted means SolarSurroundingRadius.

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>
The viewer page; 400 for an invalid radius, 204 when the building or its weather file is not found, 422 when the building cannot be located.

SolarController.GetGLBBuildingModelByIdAsync(long, Nullable<int>, Nullable<double>, CancellationToken) Method

Calculates the annual solar radiation on the external walls and roofs of a building and streams it as a binary glTF (.glb) scene: each receiving surface coloured by its irradiation on the fixed ramp of SolarIrradiationColor(double) and carrying its SurfaceSolarRadiationResult as node properties, the building's other components grey, and the neighbours as grey semi-transparent context.

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

Parameters

id System.Int64

The unique identifier of the building.

countyId System.Nullable<System.Int32>

The optional unique identifier of the county associated with the building.

radius System.Nullable<System.Double>

The neighbour radius in metres, measured from the edge of the footprint; omitted means SolarSurroundingRadius.

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>
The model/gltf-binary payload, or one of the refusals listed on SolarController.

SolarController.GetJob(Guid) Method

Gets the state of a background solar radiation job: its status, its place in the queue, the seconds spent in its current state and, for a failed job, the error text.

public Microsoft.AspNetCore.Mvc.IActionResult GetJob(System.Guid jobId);

Parameters

jobId System.Guid

The unique identifier of the job.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
200 with the SolarJobViewModel of the job; 404 when it is unknown or has expired.

SolarController.GetJobGLB(Guid) Method

Streams the coloured binary glTF (.glb) scene of a completed background solar radiation job, in the shape of GetGLBBuildingModelByIdAsync(long, Nullable<int>, Nullable<double>, CancellationToken), built from the stored results without solving again.

public Microsoft.AspNetCore.Mvc.IActionResult GetJobGLB(System.Guid jobId);

Parameters

jobId System.Guid

The unique identifier of the job.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
The model/gltf-binary payload; 409 when the job has not completed; 404 when it is unknown or has expired.

SolarController.GetJobResult(Guid) Method

Gets the results of a completed background solar radiation job, in the shape of GetRadiationByBuildingModelIdAsync(long, Nullable<int>, Nullable<double>, CancellationToken).

public Microsoft.AspNetCore.Mvc.IActionResult GetJobResult(System.Guid jobId);

Parameters

jobId System.Guid

The unique identifier of the job.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
The results as DiGi JSON; 409 when the job has not completed; 404 when it is unknown or has expired.

SolarController.GetRadiationByBuildingModelIdAsync(long, Nullable<int>, Nullable<double>, CancellationToken) Method

Calculates the annual solar radiation on the external walls and roofs of a building: one SurfaceSolarRadiationResult per receiving surface, over one EPW year, with the building itself and its neighbours within radius casting shade.

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

Parameters

id System.Int64

The unique identifier of the building.

countyId System.Nullable<System.Int32>

The optional unique identifier of the county associated with the building.

radius System.Nullable<System.Double>

The neighbour radius in metres, measured from the edge of the footprint; omitted means SolarSurroundingRadius.

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>
The results as DiGi JSON (Core.Convert.ToSystem_String, readable by Core.Convert.ToDiGi), or one of the refusals listed on SolarController.

SolarController.GetSunDirection(double, double, string, double) Method

[TEMPORARY] Calculates the sun position for a world location and a local date and time, for the 3D viewer Lighting panel.

Hosted locally until a DiGi.Solar backed endpoint is available on the central GIS Web API. The route contract (solar/sundirection) is final - when the central endpoint exists this action becomes a proxy like the other actions in this project, and the consuming frontend (gltf-viewer.js) stays unchanged.

public Microsoft.AspNetCore.Mvc.IActionResult GetSunDirection(double x, double y, string? date, double hour);

Parameters

x System.Double

The X coordinate in the EPSG:2180 coordinate system [m].

y System.Double

The Y coordinate in the EPSG:2180 coordinate system [m].

date System.String

The local calendar date in the yyyy-MM-dd format.

hour System.Double

The local time of day as a decimal hour in the 0-24 range.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
JSON with the true solar angles: azimuth [deg] (0 = north, clockwise) and altitude [deg] above the horizon (negative at night).

SolarController.PostJobAsync(long, Nullable<int>, Nullable<double>, CancellationToken) Method

Queues the annual solar radiation of a building as a background job, for buildings above the synchronous ceilings. The building, its neighbours and its weather are fetched and checked in this request, with the job ceilings (SolarJobReceiverCountMax, SolarJobCasterTriangleCountMax), so every refusal is immediate; the solve runs later, one job at a time, behind the gate shared with the synchronous routes.

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

Parameters

id System.Int64

The unique identifier of the building.

countyId System.Nullable<System.Int32>

The optional unique identifier of the county associated with the building.

radius System.Nullable<System.Double>

The neighbour radius in metres, measured from the edge of the footprint; omitted means SolarSurroundingRadius.

cancellationToken System.Threading.CancellationToken

A cancellation token that can be used by the caller to cancel the asynchronous operation; it does not reach the queued job.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult>
202 with the SolarJobViewModel of the job and its Location (solar/jobs/{jobId}); 503 with Retry-After when the queue is full; otherwise one of the refusals listed on SolarController.

SolarController.Start() Method

Handles the HTTP GET request to the root endpoint and returns the solar radiation landing page, where a building is chosen by its identifier.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult representing the start view.

TerrainController Class

Provides the terrain feature: the ground surface of an area as a DiGi.Geometry.Spatial.Classes.Mesh3D, as a binary glTF payload and as a 3D viewer page.

The surface itself is reconstructed by the GIS Web API terrain endpoints (gis/terrain) from the elevation points stored per county; this controller only relays them, so the query limits (maximum radius, mesh edge length, tolerance defaults) stay owned by that service and cannot drift here.

Every surface returned here is a two-and-a-half dimensional height field: exactly one elevation per plan position. It models ground, and cannot express a vertical face, an overhang or a canopy.

public class TerrainController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → TerrainController

Constructors

TerrainController(IHttpClientFactory) Constructor

Initializes a new instance of the TerrainController class.

public TerrainController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create System.Net.Http.HttpClient instances.

Methods

TerrainController.BoundingBoxName(double, double, double, double) Method

Builds the name of a rectangular terrain area, used as the scene name and as the viewer page title.

private static string BoundingBoxName(double x_1, double y_1, double x_2, double y_2);

Parameters

x_1 System.Double

The X coordinate of the first corner, in PL-1992 (EPSG:2180) metres.

y_1 System.Double

The Y coordinate of the first corner, in PL-1992 (EPSG:2180) metres.

x_2 System.Double

The X coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

y_2 System.Double

The Y coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

Returns

System.String
The name of the area.

TerrainController.Circle2D(double, double, Nullable<double>, Nullable<double>) Method

Builds the circular area a request asked for, resolving the radius from either the radius or the diameter.

An area that cannot be served (a coordinate or a radius that is not a usable number) is built all the same and rejected afterwards by TerrainRequestUri(this Circle2D, Nullable<double>), so what a terrain request may ask for is decided in one place.

private static DiGi.Geometry.Planar.Classes.Circle2D Circle2D(double x, double y, System.Nullable<double> radius, System.Nullable<double> diameter);

Parameters

x System.Double

The X coordinate of the centre, in PL-1992 (EPSG:2180) metres.

y System.Double

The Y coordinate of the centre, in PL-1992 (EPSG:2180) metres.

radius System.Nullable<System.Double>

The search radius in metres. Optional when diameter is supplied.

diameter System.Nullable<System.Double>

The search diameter in metres, used only when radius is absent.

Returns

DiGi.Geometry.Planar.Classes.Circle2D
The requested area.

TerrainController.CircleName(double, double, Nullable<double>, Nullable<double>) Method

Builds the name of a circular terrain area, used as the scene name and as the viewer page title.

private static string CircleName(double x, double y, System.Nullable<double> radius, System.Nullable<double> diameter);

Parameters

x System.Double

The X coordinate of the centre, in PL-1992 (EPSG:2180) metres.

y System.Double

The Y coordinate of the centre, in PL-1992 (EPSG:2180) metres.

radius System.Nullable<System.Double>

The search radius in metres. Optional when diameter is supplied.

diameter System.Nullable<System.Double>

The search diameter in metres, used only when radius is absent.

Returns

System.String
The name of the area.

TerrainController.GetGLBMesh3DByBoundingBoxAsync(double, double, double, double, Nullable<double>, CancellationToken) Method

Asynchronously retrieves the terrain surface inside an axis aligned bounding box and streams it as a binary glTF (.glb) payload for the 3D viewer.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetGLBMesh3DByBoundingBoxAsync(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, in PL-1992 (EPSG:2180) metres.

y_1 System.Double

The Y coordinate of the first corner, in PL-1992 (EPSG:2180) metres.

x_2 System.Double

The X coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

y_2 System.Double

The Y coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

tolerance System.Nullable<System.Double>

An optional tolerance for the spatial query, in metres. When omitted the terrain service applies its own default.

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 System.Threading.Tasks.Task<> holding the .glb file.

TerrainController.GetGLBMesh3DByCircleAsync(double, double, Nullable<double>, Nullable<double>, Nullable<double>, CancellationToken) Method

Asynchronously retrieves the terrain surface inside a circle and streams it as a binary glTF (.glb) payload for the 3D viewer.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetGLBMesh3DByCircleAsync(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 centre, in PL-1992 (EPSG:2180) metres.

y System.Double

The Y coordinate of the centre, in PL-1992 (EPSG:2180) metres.

radius System.Nullable<System.Double>

The search radius in metres. Optional when diameter is supplied.

diameter System.Nullable<System.Double>

The search diameter in metres, used only when radius is absent.

tolerance System.Nullable<System.Double>

An optional tolerance for the spatial query, in metres. When omitted the terrain service applies its own default.

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 System.Threading.Tasks.Task<> holding the .glb file.

TerrainController.GetMesh3DByBoundingBoxAsync(double, double, double, double, Nullable<double>, CancellationToken) Method

Asynchronously retrieves the terrain surface inside an axis aligned bounding box given by two opposite corners.

Corner order does not matter.

A terrain payload is optional by contract: when the area holds no stored elevation points, or the terrain service cannot answer, the response is 204 rather than an error - see TerrainJsonAsync(this HttpClient, string, CancellationToken).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetMesh3DByBoundingBoxAsync(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, in PL-1992 (EPSG:2180) metres.

y_1 System.Double

The Y coordinate of the first corner, in PL-1992 (EPSG:2180) metres.

x_2 System.Double

The X coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

y_2 System.Double

The Y coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

tolerance System.Nullable<System.Double>

An optional tolerance for the spatial query, in metres. When omitted the terrain service applies its own default.

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 System.Threading.Tasks.Task<> carrying the DiGi.Geometry.Spatial.Classes.Mesh3D as JSON.

TerrainController.GetMesh3DByCircleAsync(double, double, Nullable<double>, Nullable<double>, Nullable<double>, CancellationToken) Method

Asynchronously retrieves the terrain surface inside a circle centred on the given plan coordinate.

Either radius or diameter must be supplied; radius wins when both are.

A terrain payload is optional by contract: when the area holds no stored elevation points, or the terrain service cannot answer, the response is 204 rather than an error - see TerrainJsonAsync(this HttpClient, string, CancellationToken).

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GetMesh3DByCircleAsync(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 centre, in PL-1992 (EPSG:2180) metres.

y System.Double

The Y coordinate of the centre, in PL-1992 (EPSG:2180) metres.

radius System.Nullable<System.Double>

The search radius in metres. Optional when diameter is supplied.

diameter System.Nullable<System.Double>

The search diameter in metres, used only when radius is absent.

tolerance System.Nullable<System.Double>

An optional tolerance for the spatial query, in metres. When omitted the terrain service applies its own default.

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 System.Threading.Tasks.Task<> carrying the DiGi.Geometry.Spatial.Classes.Mesh3D as JSON.

TerrainController.GetTerrainByBoundingBox(double, double, double, double) Method

Renders the 3D viewer page for the terrain inside an axis aligned bounding box. The page itself carries no geometry; the viewer streams the binary glTF payload from the glb endpoint.

public Microsoft.AspNetCore.Mvc.IActionResult GetTerrainByBoundingBox(double x_1, double y_1, double x_2, double y_2);

Parameters

x_1 System.Double

The X coordinate of the first corner, in PL-1992 (EPSG:2180) metres.

y_1 System.Double

The Y coordinate of the first corner, in PL-1992 (EPSG:2180) metres.

x_2 System.Double

The X coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

y_2 System.Double

The Y coordinate of the second corner, in PL-1992 (EPSG:2180) metres.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult rendering the glTF scene view.

TerrainController.GetTerrainByCircle(double, double, double) Method

Renders the 3D viewer page for the terrain inside a circle. The page itself carries no geometry; the viewer streams the binary glTF payload from the glb endpoint.

public Microsoft.AspNetCore.Mvc.IActionResult GetTerrainByCircle(double centerX, double centerY, double radius);

Parameters

centerX System.Double

The X coordinate of the centre of the requested area.

centerY System.Double

The Y coordinate of the centre of the requested area.

radius System.Double

The radius of the requested area in metres.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult rendering the glTF scene view.

TerrainController.GLBResultAsync(string, string, Point3D, CancellationToken) Method

Converts the terrain surface behind the given request into a batched DiGi.GLTF.Classes.GLTFScene and renders it as a binary glTF (.glb) response body.

Missing terrain is answered with 204 at every step. The viewer treats an empty payload as "nothing to draw" and keeps the rest of the page working, so a request for an area the terrain store does not cover yet degrades instead of failing.

private System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> GLBResultAsync(string requestUri, string name, DiGi.Geometry.Spatial.Classes.Point3D referencePoint, System.Threading.CancellationToken cancellationToken);

Parameters

requestUri System.String

The terrain service URL to read the surface from.

name System.String

The name given to the scene and to its single node.

referencePoint DiGi.Geometry.Spatial.Classes.Point3D

The world point the scene is translated to a local origin around. The centre of the requested area, matching what the building scenes use, so a terrain scene and a building scene of the same area share one local origin.

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 System.Threading.Tasks.Task<> holding the .glb file, or a no content status.

TerrainController.Start() Method

Initializes and returns the start view of the terrain feature.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult result that renders the starting view.

TypologyController Class

Provides the Typology definition feature: the page where a building typology is defined as a chain of building-data columns with rule types, ranges and colors.

The column catalog, the building data and the area geometry are read from the GIS Web API. The solve runs here: POST /typology/buildings joins the building data to the definition and classifies it with DiGi.Typology.Visual, because the per-building DTO the view draws is shaped for this page. An upstream solve was considered and rejected (DiGi.GIS.WebAPI.UI#29): the cost is the database reading the building data, which moving the classification does not reduce.

public class TypologyController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → TypologyController

Constructors

TypologyController(IHttpClientFactory, ILogger<TypologyController>) Constructor

Initializes a new instance of the TypologyController class.

public TypologyController(System.Net.Http.IHttpClientFactory httpClientFactory, Microsoft.Extensions.Logging.ILogger<DiGi.GIS.WebAPI.UI.Controllers.TypologyController> logger);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory the feature's data actions use to create System.Net.Http.HttpClient instances.

logger Microsoft.Extensions.Logging.ILogger<TypologyController>

The logger the solve action reports each county part's page count and row count to (issue #22 Definition of Done: "upstream page count logged per part").

Methods

TypologyController.AreaViewAsync(int, string, Nullable<AdministrativeArealType>, CancellationToken) Method

Renders the Typology area view the Load modal redirects to: the colour-coded building typology of one administrative area, with the area context (name, type, code, id) in the Administrative Area card.

The type is bound nullable and rejected when absent: a non-nullable DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType binding keeps Country for an omitted parameter, because the Undefined sentinel is -1 and not 0 - see Coding - WebAPI Contracts, section 2.

The name is the one thing the query does not carry; it is read by the identifier, and a lookup that answers nothing leaves it blank rather than failing the page.

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

Parameters

id System.Int32

The unique identifier of the selected administrative area.

code System.String

The optional code of the selected administrative area.

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

The type of the selected administrative area, as the integer the Load modal carried.

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 System.Threading.Tasks.Task<> that renders the view, or a 400 Bad Request response when the identifier or the area type is missing.

TypologyController.ExportDefinitionAsync(TypologyDefinitionParameter, CancellationToken) Method

Turns the page state of the Typology definition page into its document: the DiGi JSON of a DiGi.Typology.Visual.Classes.VisualColumnTypologyFilter chain, which is what the page downloads on Export and what ValidateDefinitionAsync(JsonObject, CancellationToken) reads back on Import.

The state is resolved against the live column catalog and checked by TypologyDefinitionErrors(this TypologyDefinitionParameter, IEnumerable<Column>); the document is composed here so that the browser never spells a _type or an appearance key. Unlike the read actions above, a rejected state answers 400 with the error list as a JSON string array - the page shows it as it is - because the visitor can act on it; an unreachable catalog is not the visitor's fault and answers 503.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> ExportDefinitionAsync(DiGi.GIS.WebAPI.UI.Classes.TypologyDefinitionParameter? typologyDefinitionParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

typologyDefinitionParameter TypologyDefinitionParameter

The page state, as typology.js holds it.

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 System.Threading.Tasks.Task<> containing the document as JSON, a 400 Bad Request response carrying the error list, or a 503 Service Unavailable response when the column catalog cannot be read.

TypologyController.GetBuildingCountAsync(int, string, Nullable<AdministrativeArealType>, CancellationToken) Method

Answers the pre-flight of a Typology solve: how many buildings the solve of an area reads, from how many county parts, against which ceiling - known in a fraction of a second, so the area view can say what the solve is waiting for (DiGi.GIS.WebAPI.UI#29, B1).

The same resolution and count SolveBuildingsAsync(TypologySolveParameter, CancellationToken) runs before it reads a page (CountyPartIdsAsync(this HttpClient, string, AdministrativeArealType, CancellationToken), then one countbycountyid per part). A municipality or subdivision is clipped to its polygon after the read, so its count is the count of its county parts - an upper bound, flagged by clipped. A country is not counted (count null): the solve refuses it outright. An area that names no parts counts 0.

DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType is bound nullable and rejected when absent (Coding - WebAPI Contracts, section 2).

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

Parameters

id System.Int32

The unique identifier of the administrative area.

code System.String

The code of the administrative area.

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

The type of the administrative area, as the integer the area view carries.

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 System.Threading.Tasks.Task<> containing a TypologyAreaCountViewModel, a 400 Bad Request response for a missing identifier or type, or a missing code for any area but the country, or a 503 Service Unavailable response when the parts or their counts cannot be read.

TypologyController.GetChildAreasAsync(int, string, Nullable<AdministrativeArealType>, CancellationToken) Method

Lists the areas one level below an area too large for a Typology solve - a voivodeship's counties with their building counts, or the country's voivodeships - so the area view can offer a smaller area instead of the 413 (DiGi.GIS.WebAPI.UI#29, B2).

See ChildAreasAsync(this HttpClient, string, AdministrativeArealType, CancellationToken) for the grouping of multi-part areas, the counts and the order. The parameters are those of the area view, so the page passes its own query through.

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

Parameters

id System.Int32

The unique identifier of the administrative area.

code System.String

The code of the administrative area; required for a voivodeship.

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

The type of the administrative area: a voivodeship or the country.

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 System.Threading.Tasks.Task<> containing the list of TypologyChildAreaViewModel, a 400 Bad Request response for a missing identifier, a type other than voivodeship or country, or a voivodeship without a code, or a 503 Service Unavailable response when the areas cannot be read.

TypologyController.GetColumnsAsync(CancellationToken) Method

Retrieves the building-data columns available for typology grouping, sorted alphabetically by name.

Status-preserving rather than the collapsing catalog read: an upstream failure is a 502 and a service that answered nothing at all is a 503, so the page's outcome can name the cause instead of reading a fault as an empty catalog (issue #40).

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

Parameters

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 System.Threading.Tasks.Task<> containing the sorted column list, a 204 No Content response when the upstream answers no columns, a 502 Bad Gateway response when the upstream answers a failure, or a 503 Service Unavailable response when it answers nothing at all.

TypologyController.GetCountyIdsAsync(string, Nullable<AdministrativeArealType>, CancellationToken) Method

Resolves the administrative area selected in the Load Area modal into the county part identifiers that scope a "Load values" request of the Column Properties section.

The upstream gis/BuildingData/uniquevalues filters by a single county part id, so the page loads a county at a time and unions the answers. A county code maps to one id per polygon part (18 codes have several - see Coding - GIS Administrative Data.md), so a county resolves through idsbycode rather than the single id the modal row carries. A municipality or subdivision resolves to the parts of its parent county (a TERYT municipality code carries the county code as its first four characters), so its values are a superset - the upstream endpoint cannot narrow below a county. A voivodeship resolves to every county whose code starts with the voivodeship code. A country resolves to an empty list, which the page reads as the whole table.

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

Parameters

code System.String

The administrative code of the selected area.

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

The type of the selected area, bound as nullable so an omitted value is refused rather than read as DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType.Country.

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 System.Threading.Tasks.Task<> containing the JSON array of county part identifiers (empty for a country), a 204 No Content response when the upstream answers no parts, a 502 Bad Gateway response when the upstream answers a failure, a 503 Service Unavailable response when it answers nothing at all, or a 400 Bad Request response when the code is blank or the type is missing.

TypologyController.GetHistogramSummaryAsync(string, Nullable<int>, CancellationToken) Method

Relays the value distribution histogram of one building-data column for one county part, so the Column Properties Load splits the buildings of the chosen area into ranges of comparable size (issue #30).

The upstream gis/BuildingData/histogramsummary takes its criteria in the body (POST) and filters by a single county part at a time, so the page asks per part and merges the answers — the same county-by-county pattern as GetUniqueValuesAsync(string, Nullable<int>, CancellationToken). Each answer is the {bucket, rangeStart, rangeEnd, count} array the page inverts into the equal-count boundaries of the area's buildings. The bucket count is fixed to HistogramBucketCount — it is the boundary resolution, and 1000 is the upstream cap — and the buckets are asked for as equal-count (DiGi.PostgreSQL.Table.Enums.HistogramBucketing.EqualCount, issue #37), so the resolution follows the buildings rather than a value span set by outliers; a host without DiGi-Organization/DiGi.GIS.WebAPI#35 ignores that property and answers equal-width buckets, which the page still inverts. The relay keeps the upstream's 404 as the 204 the page reads as "no values in scope", and answers the rest of what the service did - an answered failure (502) or no answer at all (503) - so the page's outcome can name the cause instead of reading a failure as an empty column (issue #40).

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

Parameters

columnUniqueId System.String

The unique identifier (slug) of the column, as listed by GetColumnsAsync(CancellationToken).

countyId System.Nullable<System.Int32>

The optional county part identifier scoping the histogram; absent asks for the whole table.

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 System.Threading.Tasks.Task<> containing the upstream JSON array of bucket rows, a 204 No Content response for the upstream's empty result, a 502 Bad Gateway response when the upstream answers a failure, a 503 Service Unavailable response when it answers nothing at all, or a 400 Bad Request response when the column identifier is blank.

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

Relays the distinct values of one building-data column, for unique-value coloring in the Column Properties section.

The upstream gis/BuildingData/uniquevalues answers 404 for an empty result and takes several seconds per county (tens of seconds nationwide). The relay keeps that 404 as the 204 the page reads as "no values in scope", and answers the rest of what the service did - an answered failure (502) or no answer at all (503) - so the page's outcome can name the cause instead of reading a failure as an empty column (issue #40).

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

Parameters

columnUniqueId System.String

The unique identifier (slug) of the column, as listed by GetColumnsAsync(CancellationToken).

countyId System.Nullable<System.Int32>

The optional county part identifier that scopes the distinct values; null asks for the whole table.

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 System.Threading.Tasks.Task<> containing the upstream JSON array of primitive values, a 204 No Content response for the upstream's empty result, a 502 Bad Gateway response when the upstream answers a failure, a 503 Service Unavailable response when it answers nothing at all, or a 400 Bad Request response when the column identifier is blank.

TypologyController.SolveBuildingsAsync(TypologySolveParameter, CancellationToken) Method

Solves the Typology definition for the selected administrative area: joins the building data to the definition, runs the solver, and answers the view DTO the area view renders.

The pipeline: validate the definition against the live column catalog, resolve the area to county part identifiers, count the parts' rows and refuse an area above the ceiling before a page is read, fetch the building data per part (sequential, one retry on a cold partition, stopped at the ceiling), clip to the area when it is below county, solve, and flatten to the view DTO. The page arrives already in the solver's table type - the deployed GIS Web API's own Create.Table shape - so the join needs no bridge. The browser never spells a _type or a rule name; the join and the solve run server-side.

DiGi.GIS.PostgreSQL.Enums.AdministrativeArealType is bound nullable and rejected when absent: the Undefined sentinel is -1 and not 0, so a non-nullable binding would silently keep Country for an omitted parameter (Coding - WebAPI Contracts, section 2). A country is refused outright as above the ceiling: it is every part there is, not an empty area.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> SolveBuildingsAsync(DiGi.GIS.WebAPI.UI.Classes.TypologySolveParameter? typologySolveParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

typologySolveParameter TypologySolveParameter

The request body: the definition to solve and the area it is solved for.

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 System.Threading.Tasks.Task<> containing the view DTO, a 400 Bad Request response for a rejected definition, a 404 Not Found response when the area has no buildings, a 413 Payload Too Large response when the area exceeds BuildingSolveCeiling, or a 503 Service Unavailable response when the column catalog or the building data cannot be read.

TypologyController.Start() Method

Starts the Typology definition page.

public Microsoft.AspNetCore.Mvc.IActionResult Start();

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult result that renders the start view.

TypologyController.ValidateDefinitionAsync(JsonObject, CancellationToken) Method

Reads a Typology definition document chosen for Import, validates it against the live column catalog and answers the page state the page replaces its own with.

The body is bound as a JSON object so that a file that is not JSON is refused before anything is read from it; a body whose _type names no known class deserializes to nothing and is refused the same way - never turned into an emptied level. Every check of TypologyDefinitionErrors(this VisualColumnTypologyFilter<Column>, IEnumerable<Column>) answers 400 with the error list; only a document the page can show in full answers 200, so the page state is replaced after this action succeeds and never before.

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

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The document, the JSON ExportDefinitionAsync(TypologyDefinitionParameter, CancellationToken) produced.

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 System.Threading.Tasks.Task<> containing the page state, a 400 Bad Request response carrying the error list, or a 503 Service Unavailable response when the column catalog cannot be read.

UserController Class

Controller providing the sign-in page and the session endpoints this application's pages use, relaying each of them to the user authentication service (DiGi.User.WebAPI).

The session token never reaches the browser. It is written into an HttpOnly cookie by LoginAsync(UserLoginParameter, CancellationToken), read back out of that cookie here on every later call, and presented to the service as a bearer token - so a script on the page can act as the visitor but can never read, copy or forward the credential that lets it.

Nothing in this application is gated on being signed in. These endpoints add a session; which content requires one is decided feature by feature as gated features arrive.

public class UserController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → UserController

Constructors

UserController(IHttpClientFactory) Constructor

Initializes a new instance of the UserController class.

public UserController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

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

Methods

UserController.GetMeAsync(CancellationToken) Method

Reads the stored record of the signed-in visitor, for the name and email the header shows.

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

Parameters

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 holding the user record, or an empty result when nobody is signed in.

UserController.GetSessionAsync(CancellationToken) Method

Introspects the current session, returning the identity and the token's issue and expiry times.

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

Parameters

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 holding the session information, or an empty result when nobody is signed in.

UserController.Login(string) Method

Returns the sign-in page.

Routed at the site root rather than under this controller, because it is a page a visitor is sent to and reads as an address, not one of the session endpoints below.

public Microsoft.AspNetCore.Mvc.IActionResult Login(string? returnUrl=null);

Parameters

returnUrl System.String

The page to return to once signed in.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
An Microsoft.AspNetCore.Mvc.IActionResult holding the sign-in view.

UserController.LoginAsync(UserLoginParameter, CancellationToken) Method

Exchanges a set of credentials for a session, storing the issued token in this application's session cookie.

Nothing about which part of the credential was wrong survives this method. An unknown email, an account with no stored credential and a wrong password are one 401 to the service and stay one 401 here, so the page can only ever say that signing in failed.

The submitted password exists in the request body and in the relayed body, and nowhere else: it is never logged, never returned and never written into a view. Do not add request logging to this action.

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> LoginAsync(DiGi.GIS.WebAPI.UI.Classes.UserLoginParameter? userLoginParameter, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

userLoginParameter UserLoginParameter

The submitted credentials.

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 that is empty on success, the session being carried in a cookie rather than in the body.

UserController.LogoutAsync(CancellationToken) Method

Ends the session, clearing this application's cookie and asking the service to revoke the token.

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

Parameters

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 confirming that the session has ended.

UserController.RefreshAsync(CancellationToken) Method

Carries the session forward by exchanging the presented token for a new one.

This works only while the presented token is still valid: the service issues the new token for the identity carried by the old one, so a session that has already expired cannot be recovered and ends in signing out.

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

Parameters

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 that is empty on success, the renewed session being carried in the cookie.

UserController.Relay(WebAPIResponse) Method

Turns a relayed response into the result this application answers with.

The upstream status is mirrored rather than reinterpreted: a 500 from the authentication service is a server fault, and answering it as a bad request would blame the caller for it.

Only a successful body is passed on. A failure body carries the service's own diagnostics - a trace identifier and its build number - which are of no use to the page and need not be published to whoever asked.

A 401 is relayed with the cookie left alone, deliberately. It means the presented token was not accepted, but not yet that the session is over: the caller is expected to try RefreshAsync(CancellationToken) once, and clearing the cookie here would delete the very token that refresh has to present, turning every expiry into an immediate sign-out. Ending the session is RefreshAsync(CancellationToken)'s to do, when the refresh itself is refused.

private Microsoft.AspNetCore.Mvc.IActionResult Relay(DiGi.GIS.WebAPI.UI.Classes.WebAPIResponse? webAPIResponse);

Parameters

webAPIResponse WebAPIResponse

The relayed response. This value can be null.

Returns

Microsoft.AspNetCore.Mvc.IActionResult
The result to answer with.

YearBuiltDataController Class

Provides API endpoints for retrieving and managing year built data.

public class YearBuiltDataController : Microsoft.AspNetCore.Mvc.Controller

Inheritance System.Object → Microsoft.AspNetCore.Mvc.ControllerBase → Microsoft.AspNetCore.Mvc.Controller → YearBuiltDataController

Constructors

YearBuiltDataController(IHttpClientFactory) Constructor

Initializes a new instance of the YearBuiltDataController class.

public YearBuiltDataController(System.Net.Http.IHttpClientFactory httpClientFactory);

Parameters

httpClientFactory System.Net.Http.IHttpClientFactory

The System.Net.Http.IHttpClientFactory used to create HTTP clients.

Methods

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

Retrieves a year built data 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, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

reference System.String

The unique reference of the item to retrieve.

countyId System.Nullable<System.Int32>

The optional identifier of the county associated with the 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, containing an Microsoft.AspNetCore.Mvc.IActionResult result.

Clone this wiki locally