Result types¶
Named result values and aligned feature records returned by multi-output operations.
Related: Constructive operations
Circle
¶
A solved circle with a source-CRS center and a radius in unit.
working_crs identifies the coordinate frame in which the disk is solved.
Geographic metric results with one or two distinct point sites retain an
ellipsoidal solution; other geographic circles use a local projection.
to_polygon realizes the retained disk without repeating its optimization;
polygon resolution does not change its center or radius.
center
property
¶
center: Point
Circle center in the input CRS, retaining its coordinate epoch. Computed centers are XY; selected zero-radius source points retain Z/M.
Returns:
| Type | Description |
|---|---|
Point
|
Center in the source CRS and epoch. Empty circles return POINT EMPTY. |
is_empty
property
¶
is_empty: bool
Whether the circle has no points. A zero-radius circle is not empty.
Returns:
| Type | Description |
|---|---|
bool
|
True for an empty circle; false for a solved disk or source point. |
radius
property
¶
radius: float
Radius in the selected metric units; NaN for an empty circle.
Returns:
| Type | Description |
|---|---|
float
|
Radius in the selected units; NaN for an empty circle. |
unit
property
¶
unit: Literal['meters', 'planar']
meters for SI radii, or planar for native coordinate units.
Returns:
| Type | Description |
|---|---|
str
|
Effective radius units. |
working_crs
property
¶
working_crs: str | None
Working CRS, or None when no CRS-based working frame is used.
Returns:
| Type | Description |
|---|---|
str or None
|
Working CRS, or None when no CRS-based working frame is used. |
to_polygon
¶
Realize the retained disk as a polygon, or a Point for a degenerate disk.
In a Cartesian working frame, inscribed polygons lie inside their certified disk and bounding polygons enclose their exact disk. Ellipsoidal one-/two-point disks use the same local-projection approximation as geographic Point.buffer. Geographic output is in the source CRS. Empty circles return POLYGON EMPTY. Finite numeric solutions can exist even when polygon coordinates cannot be represented, in which case this method raises OverflowError without invalidating the numerical solution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quadrant_segments
|
int
|
Positive number of straight segments per quarter-circle. |
16
|
Returns:
| Type | Description |
|---|---|
Polygon or Point
|
Polygonal realization in the source CRS and epoch; a Point for a degenerate disk and POLYGON EMPTY for an empty disk. |
Raises:
| Type | Description |
|---|---|
GeometryError
|
If the segment count is not positive or cannot be represented. |
OverflowError
|
If the certified polygon cannot be represented with finite coordinates. |
CRSError
|
If a geographic polygon cannot fit the local projection's accuracy domain. Ellipsoidal center and radius remain available for widely separated sites. |
CircleArray
¶
An immutable sequence of solved circles with null-aware vector projections.
center returns a point GeometryArray; radius returns a read-only
NumPy array with NaN for empty or missing rows. is_missing distinguishes
missing rows from empty circles. Scalar indexing returns Circle or None;
slices, integer gathers, and boolean masks retain the circle solutions
without repeating their optimization.
center
property
readonly
¶
center: GeometryArray[Point] | GeometryArray[Point | None]
Circle centers as a point GeometryArray in the source CRS and epoch. Empty circles have empty Points; missing rows remain missing.
Returns:
| Type | Description |
|---|---|
GeometryArray of Point
|
One center per row, in the source CRS and epoch. |
is_empty
property
¶
is_empty: NDArray[bool_]
Read-only boolean mask identifying empty circles.
Returns:
| Type | Description |
|---|---|
numpy.ndarray of bool
|
True for empty circles; false for nonempty and missing rows. |
is_missing
property
¶
is_missing: NDArray[bool_]
Read-only boolean mask distinguishing missing rows from empty circles.
Returns:
| Type | Description |
|---|---|
numpy.ndarray of bool
|
True for missing rows; false for present rows, including empty circles. |
radius
property
¶
radius: NDArray[float64]
Read-only float64 radii in each circle's selected units. Empty and missing rows are NaN.
Returns:
| Type | Description |
|---|---|
numpy.ndarray of float
|
Read-only radius per row; NaN for empty and missing rows. |
unit
property
¶
unit: list[Literal['meters', 'planar'] | None]
Effective radius units per row: meters or planar native coordinate units. Missing rows are None.
Returns:
| Type | Description |
|---|---|
list of str or None
|
Effective units per row. |
working_crs
property
¶
working_crs: list[str | None]
Working CRS definitions per row, or None where absent.
Returns:
| Type | Description |
|---|---|
list of str or None
|
Working CRS per row, or None where absent. |
count
¶
count(value: object) -> int
Number of rows equal to a Circle, or missing rows when value is None.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Circle or None
|
Circle value to count; None counts missing rows. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Number of matching rows. |
index
¶
index(value: object, start: SupportsIndex = 0, stop: SupportsIndex | None = None) -> int
First matching row within start:stop, with normal negative-index bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Circle or None
|
Circle value to find; None finds a missing row. |
required |
start
|
int
|
Start of the search window; negative indices count from the end. |
0
|
stop
|
int or None
|
End of the search window; None searches through the end. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Index of the first matching row. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the selected window contains no equal Circle or missing row. |
to_polygon
¶
Accepted call forms
to_polygon(*, quadrant_segments: int = 16) -> GeometryArray[Polygon | Point]
to_polygon(*, quadrant_segments: int = 16) -> GeometryArray[Polygon | Point | None]
Realize each retained disk without repeating its optimization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quadrant_segments
|
int
|
Positive number of straight segments per quarter-circle, shared by every row. Resolution does not change the solved centers or radii. |
16
|
Returns:
| Type | Description |
|---|---|
GeometryArray
|
Polygon or degenerate Point per row, in the source CRS and epoch. Empty disks yield empty polygons; missing rows remain missing. |
Raises:
| Type | Description |
|---|---|
GeometryError
|
If the segment count is not positive or cannot be represented. |
OverflowError
|
If a certified polygon cannot be represented with finite coordinates. |
CRSError
|
If a geographic realization exceeds the local-projection accuracy domain. |
ValidationReport
¶
A structured geometry-validity verdict.
Returned by geom.validate(): truthy when the geometry is valid;
otherwise report.reason names the OGC violation, report.location
pinpoints it, report.path addresses the offending part, and
report.code/report.detail provide stable machine-readable and
human-readable issue data.
Validation reports describe invalid geometries and their reasons.
code
property
¶
code: str | None
Stable machine-readable validity code, or None for a valid report.
Returns:
| Type | Description |
|---|---|
str or None
|
|
detail
property
¶
detail: str | None
Detail for the first validity issue, or None for a valid report.
Returns:
| Type | Description |
|---|---|
str or None
|
|
location
property
¶
location: tuple[float, float] | None
(x, y) location of the first problem, when known.
For quotient-topology issues, the location is a canonical coordinate of the issue's contact set, chosen deterministically by minimum latitude then longitude.
Returns:
| Type | Description |
|---|---|
tuple or None
|
|
path
property
¶
path: str | None
Structural path to the first problem (e.g. '$.shell'), when known.
Returns:
| Type | Description |
|---|---|
str or None
|
|
reason
property
¶
reason: str | None
Human-readable reason for the first validity problem, or None.
Returns:
| Type | Description |
|---|---|
str or None
|
|
valid
property
¶
valid: bool
Whether the geometry is valid (also the report's truth value).
Returns:
| Type | Description |
|---|---|
bool
|
|
Extremes
¶
Accepted call forms
Extremes(west: ExtremeT, south: ExtremeT, east: ExtremeT, north: ExtremeT) -> Extremes[ExtremeT]
The westmost/southmost/eastmost/northmost vertices of a geometry.
Returned by Geometry.extremes() (four scalar Point fields, or None
for an empty geometry) and GeometryArray.extremes() (four row-aligned
GeometryArray[Point | None] columns; missing rows remain missing and
present empty rows contain empty points). Unpacks as (west, south, east,
north); ties keep the first vertex in storage order, and Z/M ordinates are
carried through.
Features
¶
Accepted call forms
Features(geometries: GeometryArray[Geometry | None], properties: Mapping[str, Any] | Iterable[Mapping[str, Any] | None] | None = None, ids: Iterable[FeatureId] | None = None) -> Features
Aligned feature columns returned by from_geojson(..., features=True).
Unpack as geometries, properties, ids = features. Each metadata entry
corresponds to the geometry at the same row; use len(features.geometries)
for the feature count. The outer columns are fixed, while property
dictionaries remain editable. __geo_interface__ exposes the aligned
record as a GeoJSON FeatureCollection.
Build row-aligned feature columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometries
|
GeometryArray[Geometry | None]
|
One geometry or |
required |
properties
|
Mapping[str, Any] | Iterable[Mapping[str, Any] | None] | None
|
A mapping or object with a callable |
None
|
ids
|
Iterable[FeatureId] | None
|
One string, non-boolean integer, finite float, or |
None
|
Returns:
| Type | Description |
|---|---|
Features
|
The geometry, property, and id columns aligned by input row. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If geometries is not a GeometryArray, a property input is not a
mapping or row iterable, a property key is not a string, or an id
is not a string, non-boolean integer, finite float, or |
GeometryError
|
If property or id rows do not match the geometry count, property keys repeat, or a numeric id is not finite. |
geometries
instance-attribute
¶
geometries: GeometryArray[Geometry | None]
One parsed geometry or None per input feature.
ids
instance-attribute
¶
ids: tuple[FeatureId, ...]
Row-aligned string, non-boolean integer, finite float, or None ids.
An entry is None where the feature carried no id.
properties
instance-attribute
¶
properties: tuple[dict[str, Any] | None, ...]
Row-aligned property mappings; None means no properties were supplied.
A single input mapping is shallow-copied for each row, so editing one returned dictionary does not change another row.
__iter__
¶
__iter__() -> Iterator[GeometryArray[Geometry | None] | tuple[dict[str, Any] | None, ...] | tuple[FeatureId, ...]]
Unpack as geometries, properties, ids (three fields).
PolygonizeResult
¶
Accepted call forms
PolygonizeResult(polygons: GeometryArray[Polygon], cut_edges: Groups[GeometryArray[LineString] | GroupMissingT_co], dangles: Groups[GeometryArray[LineString] | GroupMissingT_co], invalid_rings: Groups[GeometryArray[LineString] | GroupMissingT_co]) -> PolygonizeResult[GroupMissingT_co]
Full polygonization output: the polygons plus the leftover linework.
Returned by polygonize_all(diagnostics=True); unpacks as (polygons, cut_edges,
dangles, invalid_rings), or use the named fields. polygons is the
pooled result; each diagnostic is a Groups of GeometryArray[LineString]
rows, one per input source. Missing sources yield None rows, distinct
from present sources with no diagnostic linework. The generic argument is
None when source rows may be missing; it defaults to Never for dense
source rows.
cut_edges
instance-attribute
¶
cut_edges: Groups[GeometryArray[LineString] | GroupMissingT_co]
Noded edges that are not part of a polygon, grouped by source row.
dangles
instance-attribute
¶
dangles: Groups[GeometryArray[LineString] | GroupMissingT_co]
Noded edges with at least one free end, grouped by source row.
invalid_rings
instance-attribute
¶
invalid_rings: Groups[GeometryArray[LineString] | GroupMissingT_co]
Invalid noded rings or duplicate edges, grouped by source row.
polygons
instance-attribute
¶
polygons: GeometryArray[Polygon]
The polygons formed from the noded linework.