The Tiny HTM Library
Data Structures | Defines | Enumerations | Functions | Variables
include/tinyhtm/htm.h File Reference

Minimalistic functions and types for HTM indexing. More...

#include "geometry.h"
+ Include dependency graph for htm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  htm_ids
 A sorted list of 64 bit integer ranges. More...
struct  htm_v3p
 A position and a payload. More...
struct  htm_tri
 A structure describing the geometry of an HTM triangle (aka a trixel). More...

Defines

#define HTM_MAX_LEVEL   24
 Maximum HTM tree subdivision level.
#define HTM_DEC_MAX_LEVEL   18
 Maximum level of a decimal index stored in a 64 bit signed integer.

Enumerations

enum  htm_root {
  HTM_S0 = 0, HTM_S1 = 1, HTM_S2 = 2, HTM_S3 = 3,
  HTM_N0 = 4, HTM_N1 = 5, HTM_N2 = 6, HTM_N3 = 7,
  HTM_NROOTS = 8
}
 Root triangle numbers. More...

Functions

struct htm_v3p __attribute__ ((aligned(16)))
int64_t htm_v3_id (const struct htm_v3 *point, int level)
 Computes an HTM ID for a position.
enum htm_errcode htm_v3p_idsort (struct htm_v3p *points, int64_t *ids, size_t n, int level)
 Computes HTM IDs for a list of positions with payloads.
int htm_level (int64_t id)
 Returns the HTM subdivision level of the given ID, or -1 if the ID is invalid.
enum htm_errcode htm_tri_init (struct htm_tri *tri, int64_t id)
 Computes and stores the attributes of the HTM triangle with the given id.
struct htm_idshtm_s2circle_ids (struct htm_ids *ids, const struct htm_v3 *center, double radius, int level, size_t maxranges, enum htm_errcode *err)
 Returns a list of HTM ID ranges corresponding to the HTM triangles overlapping the given circle.
struct htm_idshtm_s2ellipse_ids (struct htm_ids *ids, const struct htm_s2ellipse *ellipse, int level, size_t maxranges, enum htm_errcode *err)
 Returns a list of HTM ID ranges corresponding to the HTM triangles overlapping the given ellipse.
struct htm_idshtm_s2cpoly_ids (struct htm_ids *ids, const struct htm_s2cpoly *poly, int level, size_t maxranges, enum htm_errcode *err)
 Returns a list of HTM ID ranges corresponding to the HTM triangles overlapping the given spherical convex polygon.
int64_t htm_idtodec (int64_t id)
 Converts an HTM ID as returned by the various indexing functions to decimal form.

Variables

struct htm_v3 v
 Position.
void * payload
 Pointer to payload.
struct htm_tri __attribute__

Detailed Description

Minimalistic functions and types for HTM indexing.

This software is based on work by A. Szalay, T. Budavari, G. Fekete at The Johns Hopkins University, and Jim Gray, Microsoft Research. See the following links for more information:

http://voservices.net/spherical/ http://adsabs.harvard.edu/abs/2010PASP..122.1375B

Authors:
Serge Monkewitz

Definition in file htm.h.


Variable Documentation

void* payload

Pointer to payload.

Definition at line 66 of file htm.h.

struct htm_v3 v

Position.

Definition at line 65 of file htm.h.

Referenced by htm_s2cpoly_hull(), and htm_varint_len().