Skip to main content

Module geo

Module geo 

Source
Expand description

Typed coordinate metadata for the balanced model, and the standalone geographic document (GeoLayer) that carries coordinates as a file of their own.

Structs§

Canvas
Diagram canvas metadata.
ElementKey
Element identity for one feature. Matching tries uid, then id, then case insensitive name; branches additionally fall back to the unordered (from, to) bus pair. index is a positional row alias (1-based, the MATPOWER row convention) accepted on read and never written; the durable identity is the payload uid (buses:3, branches:7).
GeoApplyReport
Result of applying a GeoLayer to a network.
GeoFeature
One point or route in a GeoLayer.
GeoLayer
A standalone geographic document: element points and routes in one coordinate space, keyed by element identity rather than embedded in a case.
GeoMeta
Network level coordinate metadata.
GeoParsed
Output of a tolerant geo read: the layer plus the reader’s notes on records it could not use.
Location
A point attached to one model element.

Enums§

CoordinateSpace
Coordinate space for locations in a network.
CoordsKind
Coordinate provenance.
GeoGeometry
Feature geometry: a point or a polyline route.
GeoTarget
The element family a feature places.

Constants§

GEO_LAYER_EXTENSION
Suggested extension for the canonical document.
PWD_MERCATOR_K
Scale of PowerWorld’s auto generated layouts: x = K·lon and y = K·mercdeg(lat), with the Mercator ordinate expressed in degrees.

Traits§

GeoApplyTarget
The model half of one apply_geo_features pass: how a feature key resolves to a row, and how a matched point or route lands on the model.

Functions§

apply_geo_features
One apply pass over a layer’s features. The model-specific lookups and placements come from the GeoApplyTarget; the feature dispatch, match counting, and substation bookkeeping live here, so the balanced network and the multiconductor glue in powerio-pkg report identically.
apply_substation_points
Join a layer’s substation points onto buses through the SubNum (or SubNumber) extras key: every bus in a matched substation takes the substation’s point, and the layer’s space becomes the network’s GeoMeta when anything matched. Replaced locations and a coordinate space change are reported in the notes rather than happening silently.
geo_layer_from_aux_substations
Lift the aux Substation table into a geographic GeoLayer with substation targets keyed by substation number. The number comes from SubNum or Number and the point from Latitude and Longitude, the column names PowerWorld writes itself, so they take no aliases. A row whose number or coordinate is absent or is not a finite number is skipped. Rows stay in file order, so a repeated substation number keeps the last point once apply_substation_points runs.
geo_layer_from_pwd
Lift decoded .pwd substation symbols into a diagram space GeoLayer with substation targets keyed by substation number.
pwd_mercator_to_lonlat
Approximate inverse of the projection PowerWorld’s auto generated layouts use (verified against ACTIVSg200/2000 to within ~0.02 degrees): longitude is x / K, latitude the inverse Gudermannian of y / K. Hand edited diagrams drift from this, so treat the result as approximate.