|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Serialization utilities for geometry objects. More...
#include <geom_algorithms.H>
Static Public Member Functions | |
| static std::string | to_wkt (const Point &p) |
| Converts a Point to WKT format: "POINT (x y)". | |
| static std::string | to_wkt (const Segment &s) |
| Converts a Segment to WKT format: "LINESTRING (x1 y1, x2 y2)". | |
| static std::string | to_wkt (const Triangle &t) |
| Converts a Triangle to WKT format: "POLYGON ((x1 y1, x2 y2, x3 y3, x1 y1))". | |
| static std::string | to_wkt (const Rectangle &r) |
| Converts a Rectangle to WKT format: "POLYGON ((xmin ymin, xmax ymin, xmax ymax, xmin
ymax, xmin ymin))". | |
| static std::string | to_wkt (const Polygon &poly) |
| Converts a Polygon to WKT format: "POLYGON ((x1 y1, x2 y2, ..., x1 y1))". | |
| static std::string | to_wkt (const Point3D &p) |
| Converts a Point3D to WKT format: "POINT Z (x y z)". | |
| static std::string | to_geojson (const Point &p) |
| Converts a Point to a GeoJSON geometry object. | |
| static std::string | to_geojson (const Segment &s) |
| Converts a Segment to a GeoJSON LineString. | |
| static std::string | to_geojson (const Triangle &t) |
| Triangle → GeoJSON Polygon. | |
| static std::string | to_geojson (const Polygon &poly) |
| Polygon → GeoJSON Polygon. | |
| static std::string | to_geojson (const Point3D &p) |
| Point3D → GeoJSON Point with Z. | |
Static Private Member Functions | |
| static std::string | dbl (const Geom_Number &n) |
| Formats a Geom_Number as a string with high precision. | |
Serialization utilities for geometry objects.
Provides conversion to standard text formats:
All numeric values are output as doubles (via geom_number_to_double).
Serializes geometric types to standard string formats (WKT, GeoJSON).
This class provides static methods to convert basic geometric primitives like Point, Segment, Polygon, etc., into Well-Known Text (WKT) and GeoJSON representations.
All numeric values are output as doubles (via geom_number_to_double).
Definition at line 11509 of file geom_algorithms.H.
|
inlinestaticprivate |
Formats a Geom_Number as a string with high precision.
Definition at line 11514 of file geom_algorithms.H.
References Aleph::geom_number_to_double().
Referenced by to_geojson(), to_geojson(), to_geojson(), to_geojson(), to_wkt(), to_wkt(), to_wkt(), to_wkt(), and to_wkt().
|
inlinestatic |
Converts a Point to a GeoJSON geometry object.
Definition at line 11607 of file geom_algorithms.H.
References dbl(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestatic |
Point3D → GeoJSON Point with Z.
Definition at line 11662 of file geom_algorithms.H.
References dbl(), Aleph::Point3D::get_x(), Aleph::Point3D::get_y(), and Aleph::Point3D::get_z().
|
inlinestatic |
Definition at line 11634 of file geom_algorithms.H.
References Aleph::geom_number_to_double(), Aleph::Point::get_x(), Aleph::Point::get_y(), and Aleph::Dlink::Iterator::has_curr().
|
inlinestatic |
Converts a Segment to a GeoJSON LineString.
Definition at line 11615 of file geom_algorithms.H.
References dbl(), Aleph::Segment::get_src_point(), Aleph::Segment::get_tgt_point(), Aleph::Point::get_x(), and Aleph::Point::get_y().
|
inlinestatic |
Definition at line 11623 of file geom_algorithms.H.
References dbl(), Aleph::Triangle::get_p1(), Aleph::Triangle::get_p2(), and Aleph::Triangle::get_p3().
|
inlinestatic |
Converts a Point to WKT format: "POINT (x y)".
Definition at line 11527 of file geom_algorithms.H.
References dbl(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestatic |
Converts a Point3D to WKT format: "POINT Z (x y z)".
Definition at line 11597 of file geom_algorithms.H.
References dbl(), Aleph::Point3D::get_x(), Aleph::Point3D::get_y(), and Aleph::Point3D::get_z().
|
inlinestatic |
Converts a Polygon to WKT format: "POLYGON ((x1 y1, x2 y2, ..., x1 y1))".
Definition at line 11569 of file geom_algorithms.H.
References Aleph::geom_number_to_double(), Aleph::Point::get_x(), Aleph::Point::get_y(), and Aleph::Dlink::Iterator::has_curr().
|
inlinestatic |
Converts a Rectangle to WKT format: "POLYGON ((xmin ymin, xmax ymin, xmax ymax, xmin ymax, xmin ymin))".
Definition at line 11558 of file geom_algorithms.H.
|
inlinestatic |
Converts a Segment to WKT format: "LINESTRING (x1 y1, x2 y2)".
Definition at line 11535 of file geom_algorithms.H.
References dbl(), Aleph::Segment::get_src_point(), Aleph::Segment::get_tgt_point(), Aleph::Point::get_x(), and Aleph::Point::get_y().
|
inlinestatic |
Converts a Triangle to WKT format: "POLYGON ((x1 y1, x2 y2, x3 y3, x1 y1))".
Definition at line 11544 of file geom_algorithms.H.
References dbl(), Aleph::Triangle::get_p1(), Aleph::Triangle::get_p2(), and Aleph::Triangle::get_p3().