Search for usage in LXR

OSM::Coordinate Class Reference

#include <datatypes.h>

Public Member Functions

constexpr Coordinate (double lat, double lon)
constexpr Coordinate (uint32_t lat, uint32_t lon)
constexpr Coordinate (uint64_t z)
constexpr bool isValid () const
constexpr double latF () const
constexpr double lonF () const
constexpr bool operator== (Coordinate other) const
constexpr uint64_t z () const

Public Attributes

uint32_t latitude = std::numeric_limits<uint32_t>::max()
uint32_t longitude = std::numeric_limits<uint32_t>::max()

Detailed Description

Coordinate, stored as 1e7 * degree to avoid floating point precision issues, and offset to unsigned values to make the z-order curve work.

Can be in an invalid state with coordinates out of range, see isValid().

See also
https://en.wikipedia.org/wiki/Z-order_curve for the z-order curve stuff

Definition at line 37 of file datatypes.h.

Constructor & Destructor Documentation

constexpr OSM::Coordinate::Coordinate ( uint64_t  z)

Create a coordinate from a z-order curve index.

Definition at line 50 of file datatypes.h.

Member Function Documentation

constexpr uint64_t OSM::Coordinate::z ( ) const

Z-order curve value for this coordinate.

Definition at line 70 of file datatypes.h.

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:03:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.