AdministrativeUnit

data class AdministrativeUnit(val name: String, val administrativeLevel: AdministrativeLevel, var cartographicBoundary: CartographicBoundary? = null, val subAdministrativeUnits: IdentitySet<AdministrativeUnit> = IdentitySet(), val images: MutableSet<Image> = mutableSetOf())

Represents an administrative unit with its properties and relationships.

Constructors

Link copied to clipboard
constructor(name: String, administrativeLevel: AdministrativeLevel, cartographicBoundary: CartographicBoundary? = null, subAdministrativeUnits: IdentitySet<AdministrativeUnit> = IdentitySet(), images: MutableSet<Image> = mutableSetOf())

Properties

Link copied to clipboard

The AdministrativeLevel of this unit (e.g., state, county, city).

Link copied to clipboard

The CartographicBoundary object representing the outline of the unit on a map (can be null).

Link copied to clipboard

Returns the first part of the unit's name, excluding names of outer administrative units. This assumes the name is formatted with outer unit names separated by commas (", "). If the name format is different, consider adjusting the splitting logic.

Link copied to clipboard

A set containing all Image objects associated with this administrative unit (presumably images taken within its boundaries).

Link copied to clipboard

The full name of the administrative unit, potentially including names of outer administrative units separated by commas (or other separators).

Link copied to clipboard

A set containing all child administrative units under this unit.

Functions

Link copied to clipboard

Handles active regions (regions that are visible and not unchecked by a user) from the cartographic boundary delimited by a bounding box.

Recursively iterates over all sub-administrative units within an AdministrativeUnit and creates a list of converted CartographicBoundaryViewData objects.

Link copied to clipboard

Converts the AdministrativeUnit model into the view object AdministrativeUnitViewData used to represent administrative units in the UI.

Link copied to clipboard
open override fun toString(): String