1#ifndef SQL_GIS_COORDINATE_RANGE_VISITOR_H_INCLUDED
2#define SQL_GIS_COORDINATE_RANGE_VISITOR_H_INCLUDED
95 if (lon <= -M_PI || lon > M_PI) {
101 double lat = pt->
y();
103 if (lat < -M_PI_2 || lat > M_PI_2) {
Definition: spatial_reference_system.h:53
virtual double angular_unit() const =0
virtual bool positive_north() const =0
virtual double from_radians(double d) const =0
Converts a coordinate value from radians to the SRS unit.
virtual bool is_cartesian() const =0
virtual bool positive_east() const =0
virtual double prime_meridian() const =0
A visitor that checks if coordinates are within range for a spatial reference system.
Definition: coordinate_range_visitor.h:42
Coordinate_range_visitor(const dd::Spatial_reference_system *srs)
Construct a new coordinate range visitor.
Definition: coordinate_range_visitor.h:57
bool m_detected_latitude
Whether an out of range latitude value has been encountered.
Definition: coordinate_range_visitor.h:49
bool m_detected_longitude
Whether an out of range longitude value has been encountered.
Definition: coordinate_range_visitor.h:47
bool visit_enter(Geometry *) override
Enters a compound geometry.
Definition: coordinate_range_visitor.h:81
double coordinate_value() const
Get the coordinate value that is out of range.
Definition: coordinate_range_visitor.h:78
bool latitude_out_of_range() const
Check if the visitor has detected any out of range latitude values.
Definition: coordinate_range_visitor.h:73
double m_coordinate
The coordinate value that is out of range, in SRS unit.
Definition: coordinate_range_visitor.h:51
const dd::Spatial_reference_system * m_srs
Spatial reference system of the geometry.
Definition: coordinate_range_visitor.h:45
bool visit(Point *pt) override
Definition: coordinate_range_visitor.h:89
bool longitude_out_of_range() const
Check if the visitor has detected any out of range longitude values.
Definition: coordinate_range_visitor.h:67
Abstract superclass for all geometric objects.
Definition: geometries.h:100
A visitor that implements the entire interface and does nothing.
Definition: geometry_visitor.h:122
bool visit_enter(Geometry *) override
Enters a compound geometry.
Definition: geometry_visitor.h:124
bool visit(Geometry *) override
Visits a geometry.
Definition: geometry_visitor.h:159
A 2d point.
Definition: geometries.h:150
double x() const
Gets the first coordinate value.
Definition: geometries.cc:46
double y() const
Gets the second coordinate value.
Definition: geometries.cc:48
The geometries implement a hierarchical visitor pattern.