OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches

Spatial frame containing CRS and georeferenced coordinates. More...

#include <SpatialFrame.hpp>

Collaboration diagram for openswmm::SpatialFrame:

Public Member Functions

void register_coupling_point (ICouplingPoint *point)
 Register a 2D coupling point.
 
bool has_2d_coupling () const noexcept
 Returns true if any 2D coupling points are registered.
 

Public Attributes

std::string crs
 CRS specification string.
 
bool is_geographic = false
 True if the CRS represents geographic coordinates (lon/lat).
 
std::vector< double > node_x
 Node X coordinates (easting or longitude).
 
std::vector< double > node_y
 Node Y coordinates (northing or latitude).
 
std::vector< double > link_x
 Link centroid X coordinates.
 
std::vector< double > link_y
 Link centroid Y coordinates.
 
std::vector< double > subcatch_x
 Subcatchment centroid X.
 
std::vector< double > subcatch_y
 Subcatchment centroid Y.
 
std::vector< std::vector< double > > link_vertices_x
 Per-link X vertices. link_vertices_x[link_idx] is a vector of X coords.
 
std::vector< std::vector< double > > link_vertices_y
 Per-link Y vertices. link_vertices_y[link_idx] is a vector of Y coords.
 
std::vector< std::vector< double > > subcatch_polygon_x
 Per-subcatchment polygon X vertices.
 
std::vector< std::vector< double > > subcatch_polygon_y
 Per-subcatchment polygon Y vertices.
 
std::vector< double > gage_x
 Gage X coordinates.
 
std::vector< double > gage_y
 Gage Y coordinates.
 
std::vector< ICouplingPoint * > coupling_points
 Registered 2D coupling points.
 

Detailed Description

Spatial frame containing CRS and georeferenced coordinates.

Coordinates are stored in the CRS specified by the crs field. If crs is empty, coordinates are in model units (as in legacy SWMM).

Arrays are indexed identically to the corresponding SoA data stores (NodeData, LinkData, SubcatchData). Index i in node_x corresponds to node i in NodeData.

Member Function Documentation

◆ has_2d_coupling()

bool openswmm::SpatialFrame::has_2d_coupling ( ) const
inlinenoexcept

Returns true if any 2D coupling points are registered.

◆ register_coupling_point()

void openswmm::SpatialFrame::register_coupling_point ( ICouplingPoint point)
inline

Register a 2D coupling point.

Parameters
pointNon-owning pointer to a coupling point.

Member Data Documentation

◆ coupling_points

std::vector<ICouplingPoint*> openswmm::SpatialFrame::coupling_points

Registered 2D coupling points.

2D components register ICouplingPoint objects here to establish exchange at specific 1D objects. The 1D engine calls exchange_to_2d() and receive_from_2d() at each timestep if any coupling points are registered.

Not owned — the 2D component manages the lifetime of these objects.

◆ crs

std::string openswmm::SpatialFrame::crs

CRS specification string.

EPSG code (e.g., "EPSG:4326") or PROJ string (e.g., "+proj=utm +zone=33 +datum=WGS84"). Empty string means no CRS is specified (legacy behavior).

Set from the CRS key in [OPTIONS]:

[OPTIONS]
CRS EPSG:4326

◆ gage_x

std::vector<double> openswmm::SpatialFrame::gage_x

Gage X coordinates.

◆ gage_y

std::vector<double> openswmm::SpatialFrame::gage_y

Gage Y coordinates.

◆ is_geographic

bool openswmm::SpatialFrame::is_geographic = false

True if the CRS represents geographic coordinates (lon/lat).

Used for distance calculations and 2D coupling.

◆ link_vertices_x

std::vector<std::vector<double> > openswmm::SpatialFrame::link_vertices_x

Per-link X vertices. link_vertices_x[link_idx] is a vector of X coords.

◆ link_vertices_y

std::vector<std::vector<double> > openswmm::SpatialFrame::link_vertices_y

Per-link Y vertices. link_vertices_y[link_idx] is a vector of Y coords.

◆ link_x

std::vector<double> openswmm::SpatialFrame::link_x

Link centroid X coordinates.

◆ link_y

std::vector<double> openswmm::SpatialFrame::link_y

Link centroid Y coordinates.

◆ node_x

std::vector<double> openswmm::SpatialFrame::node_x

Node X coordinates (easting or longitude).

◆ node_y

std::vector<double> openswmm::SpatialFrame::node_y

Node Y coordinates (northing or latitude).

◆ subcatch_polygon_x

std::vector<std::vector<double> > openswmm::SpatialFrame::subcatch_polygon_x

Per-subcatchment polygon X vertices.

◆ subcatch_polygon_y

std::vector<std::vector<double> > openswmm::SpatialFrame::subcatch_polygon_y

Per-subcatchment polygon Y vertices.

◆ subcatch_x

std::vector<double> openswmm::SpatialFrame::subcatch_x

Subcatchment centroid X.

◆ subcatch_y

std::vector<double> openswmm::SpatialFrame::subcatch_y

Subcatchment centroid Y.


The documentation for this struct was generated from the following file: