|
Aleph-w 3.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 11857 of file geom_algorithms.H.
|
inlinestaticprivate |
Formats a Geom_Number as a string with high precision.
Definition at line 11862 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and 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().
Converts a Point to a GeoJSON geometry object.
Definition at line 11960 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().
Point3D → GeoJSON Point with Z.
Definition at line 12018 of file geom_algorithms.H.
References dbl(), Aleph::Point3D::get_x(), Aleph::Point3D::get_y(), and Aleph::Point3D::get_z().
Definition at line 11991 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::geom_number_to_double(), Aleph::Point::get_x(), Aleph::Point::get_y(), and Aleph::Dlink::Iterator::has_curr().
Converts a Segment to a GeoJSON LineString.
Definition at line 11969 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().
Definition at line 11979 of file geom_algorithms.H.
References dbl(), Aleph::Triangle::get_p1(), Aleph::Triangle::get_p2(), and Aleph::Triangle::get_p3().
Converts a Point to WKT format: "POINT (x y)".
Definition at line 11875 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().
Converts a Point3D to WKT format: "POINT Z (x y z)".
Definition at line 11949 of file geom_algorithms.H.
References dbl(), Aleph::Point3D::get_x(), Aleph::Point3D::get_y(), and Aleph::Point3D::get_z().
Converts a Polygon to WKT format: "POLYGON ((x1 y1, x2 y2, ..., x1 y1))".
Definition at line 11921 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::geom_number_to_double(), Aleph::Point::get_x(), Aleph::Point::get_y(), and Aleph::Dlink::Iterator::has_curr().
Converts a Rectangle to WKT format: "POLYGON ((xmin ymin, xmax ymin, xmax ymax, xmin ymax, xmin ymin))".
Definition at line 11908 of file geom_algorithms.H.
Converts a Segment to WKT format: "LINESTRING (x1 y1, x2 y2)".
Definition at line 11883 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().
Converts a Triangle to WKT format: "POLYGON ((x1 y1, x2 y2, x3 y3, x1 y1))".
Definition at line 11895 of file geom_algorithms.H.
References dbl(), Aleph::Triangle::get_p1(), Aleph::Triangle::get_p2(), and Aleph::Triangle::get_p3().