HilbertCode.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <string>
#include <cstdint>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
}
}
namespace geos {
namespace shape { // geos.shape
namespace fractal { // geos.shape.fractal
class GEOS_DLL HilbertCode {
public:
static constexpr int MAX_LEVEL = 16;
static geom::Coordinate decode(uint32_t level, uint32_t i);
static uint32_t encode(uint32_t level, uint32_t x, uint32_t y);
static uint32_t levelSize(uint32_t level);
static uint32_t maxOrdinate(uint32_t level);
static uint32_t level(uint32_t numPoints);
private:
static uint32_t deinterleave(uint32_t x);
static uint32_t interleave(uint32_t x);
static uint32_t prefixScan(uint32_t x);
static uint32_t descan(uint32_t x);
static void checkLevel(uint32_t level);
};
} // namespace geos.shape.fractal
} // namespace geos.shape
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::shape::fractal::HilbertCode
Definition HilbertCode.h:65
geos::shape::fractal::HilbertCode::MAX_LEVEL
static constexpr int MAX_LEVEL
Definition HilbertCode.h:72
geos::shape::fractal::HilbertCode::maxOrdinate
static uint32_t maxOrdinate(uint32_t level)
geos::shape::fractal::HilbertCode::level
static uint32_t level(uint32_t numPoints)
geos::shape::fractal::HilbertCode::levelSize
static uint32_t levelSize(uint32_t level)
geos::geom
Definition Angle.h:26
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38