boat
C++23 geospatial library
Loading...
Searching...
No Matches
boat::geometry Namespace Reference

Classes

struct  d2

Concepts

concept  tagged
concept  srs_spec
concept  box
concept  dynamic
concept  linestring
concept  multi
concept  multi_point
concept  point
concept  polygon
concept  same_tag
concept  single
concept  curve
concept  projection_or_transformation
concept  ogc99

Typedefs

using mat_forward
template<class T>
using tag = boost::geometry::tag<T>::type
using cartesian = d2<boost::geometry::cs::cartesian>
using geographic = d2<boost::geometry::cs::geographic<boost::geometry::degree>>
using matrix = boost::qvm::mat<double, 3, 3>
using srs_variant = std::variant<srs::epsg, srs::proj4>
template<class T>
using d2_of = d2<typename boost::geometry::coordinate_system<T>::type>

Functions

template<point T>
T add_value (T geom, double value)
template<box T>
auto box_area_interpolate (T const &mbr, size_t num_points)
template<box T>
multi_point auto box_border_interpolate (T const &mbr, size_t num_points)
auto buffer (double distance, size_t num_points)
template<box T>
polygon auto to_polygon (T const &geom)
geographic::point wrap (geographic::point const &p)
 Normalizes longitude and latitude across the antimeridian and poles.
geographic::point add_meters (geographic::point const &p, double eastward, double northward)
geographic::grid geographic_interpolate (int width, int height, matrix const &mat, srs_spec auto const &crs, size_t num_points)
 Approximates a raster footprint with points from a fixed global grid.
matrix affine (int width, int height, cartesian::segment const &mid_pixel)
 Maps pixel coordinates to spatial coordinates.
matrix affine (int width, int height, cartesian::box const &mbr)
 Maps pixel coordinates to spatial coordinates.
auto ortho (geographic::point const &v)
 Orthographic SRS centered at v.
srs_variant to_srs_variant (auto const &meta)
 Prefers a positive epsg code to proj4; throws if neither is available.
auto transformation (srs_spec auto const &a, srs_spec auto const &b)
 Creates a transformation from source a to target b.
auto transformation (srs_spec auto const &v)
 Creates a transformation from WGS 84 longitude/latitude to v.
template<projection_or_transformation T>
auto srs_forward (T const &v)
template<projection_or_transformation T>
auto srs_inverse (T const &v)
auto mat_inverse (matrix const &v)
template<tagged T1, same_tag< T1 > T2, class Strategy>
bool transform (T1 const &geom1, T2 &geom2, Strategy const &strategy)
auto transform (auto const &... strategies)
 Composes strategies and returns std::nullopt if a transformation fails.

Variables

constexpr auto meter
 Approximate degrees per meter of latitude, or longitude at a given latitude.
constexpr auto minmax
template<class T>
constexpr bool has_tag = !std::is_same_v<tag<T>, void>
template<class... Ts>
constexpr bool has_tag< std::variant< Ts... > > = (has_tag<Ts> && ...)
template<class T>
constexpr bool is_srs_spec = std::is_constructible_v<srs::projection<>, T>
template<class... Ts>
constexpr bool is_srs_spec< std::variant< Ts... > > = (is_srs_spec<Ts> && ...)
template<class T>
constexpr auto variant_index_v = variant_index<typename d2_of<T>::variant, T>()

Typedef Documentation

◆ cartesian

using boat::geometry::cartesian = d2<boost::geometry::cs::cartesian>

◆ d2_of

template<class T>
using boat::geometry::d2_of = d2<typename boost::geometry::coordinate_system<T>::type>

◆ geographic

using boat::geometry::geographic = d2<boost::geometry::cs::geographic<boost::geometry::degree>>

◆ mat_forward

Initial value:
boost::geometry::strategy::transform::matrix_transformer<double, 2, 2>

◆ matrix

using boat::geometry::matrix = boost::qvm::mat<double, 3, 3>

◆ srs_variant

using boat::geometry::srs_variant = std::variant<srs::epsg, srs::proj4>

◆ tag

template<class T>
using boat::geometry::tag = boost::geometry::tag<T>::type

Function Documentation

◆ add_meters()

geographic::point boat::geometry::add_meters ( geographic::point const & p,
double eastward,
double northward )
inline

◆ add_value()

template<point T>
T boat::geometry::add_value ( T geom,
double value )

◆ affine() [1/2]

matrix boat::geometry::affine ( int width,
int height,
cartesian::box const & mbr )
inline

Maps pixel coordinates to spatial coordinates.

◆ affine() [2/2]

matrix boat::geometry::affine ( int width,
int height,
cartesian::segment const & mid_pixel )
inline

Maps pixel coordinates to spatial coordinates.

◆ box_area_interpolate()

template<box T>
auto boat::geometry::box_area_interpolate ( T const & mbr,
size_t num_points )

◆ box_border_interpolate()

template<box T>
multi_point auto boat::geometry::box_border_interpolate ( T const & mbr,
size_t num_points )

◆ buffer()

auto boat::geometry::buffer ( double distance,
size_t num_points )
inline

◆ geographic_interpolate()

geographic::grid boat::geometry::geographic_interpolate ( int width,
int height,
matrix const & mat,
srs_spec auto const & crs,
size_t num_points )

Approximates a raster footprint with points from a fixed global grid.

◆ mat_inverse()

auto boat::geometry::mat_inverse ( matrix const & v)
inline

◆ ortho()

auto boat::geometry::ortho ( geographic::point const & v)
inline

Orthographic SRS centered at v.

◆ srs_forward()

template<projection_or_transformation T>
auto boat::geometry::srs_forward ( T const & v)

◆ srs_inverse()

template<projection_or_transformation T>
auto boat::geometry::srs_inverse ( T const & v)

◆ to_polygon()

template<box T>
polygon auto boat::geometry::to_polygon ( T const & geom)

◆ to_srs_variant()

srs_variant boat::geometry::to_srs_variant ( auto const & meta)
inline

Prefers a positive epsg code to proj4; throws if neither is available.

◆ transform() [1/2]

auto boat::geometry::transform ( auto const &... strategies)

Composes strategies and returns std::nullopt if a transformation fails.

◆ transform() [2/2]

template<tagged T1, same_tag< T1 > T2, class Strategy>
bool boat::geometry::transform ( T1 const & geom1,
T2 & geom2,
Strategy const & strategy )

◆ transformation() [1/2]

auto boat::geometry::transformation ( srs_spec auto const & a,
srs_spec auto const & b )

Creates a transformation from source a to target b.

◆ transformation() [2/2]

auto boat::geometry::transformation ( srs_spec auto const & v)

Creates a transformation from WGS 84 longitude/latitude to v.

◆ wrap()

geographic::point boat::geometry::wrap ( geographic::point const & p)
inline

Normalizes longitude and latitude across the antimeridian and poles.

Variable Documentation

◆ has_tag

template<class T>
bool boat::geometry::has_tag = !std::is_same_v<tag<T>, void>
constexpr

◆ has_tag< std::variant< Ts... > >

template<class... Ts>
bool boat::geometry::has_tag< std::variant< Ts... > > = (has_tag<Ts> && ...)
constexpr

◆ is_srs_spec

template<class T>
bool boat::geometry::is_srs_spec = std::is_constructible_v<srs::projection<>, T>
constexpr

◆ is_srs_spec< std::variant< Ts... > >

template<class... Ts>
bool boat::geometry::is_srs_spec< std::variant< Ts... > > = (is_srs_spec<Ts> && ...)
constexpr

◆ meter

auto boat::geometry::meter
constexpr
Initial value:
= overloaded{
[] { return numbers::radian / numbers::earth::mean_radius; },
[](this auto&& self, double lat) {
auto den = std::cos(lat * numbers::degree);
return den ? self() / den : 0.;
},
}

Approximate degrees per meter of latitude, or longitude at a given latitude.

◆ minmax

auto boat::geometry::minmax
constexpr
Initial value:
= []<tagged T>(T const& geom) -> box auto {
double xmin = INFINITY;
double ymin = INFINITY;
double xmax = -INFINITY;
double ymax = -INFINITY;
overloaded{
[&](single auto& g) {
boost::geometry::for_each_point(g, [&](point auto& p) {
xmin = std::min<>(xmin, p.x());
ymin = std::min<>(ymin, p.y());
xmax = std::max<>(xmax, p.x());
ymax = std::max<>(ymax, p.y());
});
},
[](this auto&& self, multi auto& g) -> void {
std::ranges::for_each(g, self);
},
[](this auto&& self, dynamic auto& var) -> void {
std::visit(self, var);
},
}(geom);
return typename d2_of<T>::box{{xmin, ymin}, {xmax, ymax}};
}
Definition vocabulary.hpp:40
Definition vocabulary.hpp:55
Definition vocabulary.hpp:64
Definition vocabulary.hpp:28
model::box< point > box
Definition vocabulary.hpp:81

◆ variant_index_v

template<class T>
auto boat::geometry::variant_index_v = variant_index<typename d2_of<T>::variant, T>()
constexpr