Skip to main content

Module generalization

Module generalization 

Source
Expand description

Map generalization operators following the ICA (International Cartographic Association) taxonomy.

This module implements three canonical generalization operations:

§Collapse

Reduces a polygon or short line below a minimum-size threshold to a representative point (the geometric centroid or midpoint). This mirrors the ICA “collapse” operator which converts areal/linear features to point symbols when they are too small to be rendered at the target scale.

§Exaggerate

Scales a polygon or linestring outward (or inward, for scale < 1) from an anchor point, thereby making the feature visually larger without moving its symbolic location. Corresponds to the ICA “exaggeration” operator used e.g. for roads or buildings that would otherwise disappear at small scales.

§Displace

Resolves positional conflicts between point symbols that are too close together by iteratively pushing overlapping positions apart until all pairwise distances exceed a minimum separation. Corresponds to the ICA “displacement” operator.

§References

  • Mackaness, W., Ruas, A. & Sarjakoski, L.T. (2007) Generalisation of Geographic Information: Cartographic Modelling and Applications. ISPRS Book Series, Elsevier.
  • Ruas, A. (1998) “OO-Generalisation with a multi-agent system”, in Proceedings of the 8th International Symposium on Spatial Data Handling, pp. 325–337.

Structs§

CollapseOptions
Options that govern when a feature is considered small enough to collapse.
DisplaceOptions
Options for the iterative displacement solver.
DisplaceStats
Summary statistics returned after the displacement solver finishes.
ExaggerateOptions
Options controlling the exaggeration transform.

Enums§

ExaggerateAnchor
Specifies the fixed point from which exaggeration is applied.

Functions§

collapse_linestring_to_point
Collapses line to its arc-length midpoint when the line’s total Euclidean length falls below the configured threshold.
collapse_polygon_to_point
Collapses poly to its area-weighted 2-D centroid when the polygon’s absolute area falls below the configured threshold.
displace_points
Displaces a mutable slice of point coordinates so that all pairwise distances are at least options.min_distance.
displace_polygons_by_centroid
Displaces a mutable slice of polygons by operating on their centroids.
exaggerate_coord
Applies an affine scale-from-anchor transform to a single coordinate.
exaggerate_linestring
Exaggerates every vertex of line from its computed (or specified) anchor.
exaggerate_polygon
Exaggerates all rings of poly uniformly from the polygon’s anchor.
should_collapse_polygon
Returns true when the polygon’s absolute planimetric area is strictly below options.min_polygon_area, i.e. the polygon should be collapsed.