The Tiny HTM Library
|
Minimalistic HTM indexing implementation. More...
Go to the source code of this file.
Functions | |
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_ids * | htm_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_ids * | htm_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_ids * | htm_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. | |
int64_t | htm_tree_s2circle_count (const struct htm_tree *tree, const struct htm_v3 *center, double radius, enum htm_errcode *err) |
Returns the number of points in tree that are inside the spherical circle with the given center and radius. | |
int64_t | htm_tree_s2ellipse_count (const struct htm_tree *tree, const struct htm_s2ellipse *ellipse, enum htm_errcode *err) |
Returns the number of points in tree that are inside the given spherical ellipse. | |
int64_t | htm_tree_s2cpoly_count (const struct htm_tree *tree, const struct htm_s2cpoly *poly, enum htm_errcode *err) |
Returns the number of points in tree that are inside the given spherical convex polygon. | |
struct htm_range | htm_tree_s2circle_range (const struct htm_tree *tree, const struct htm_v3 *center, double radius, enum htm_errcode *err) |
Returns a lower and upper bound on the number of points in tree that are inside the spherical circle with the given center and radius. | |
struct htm_range | htm_tree_s2ellipse_range (const struct htm_tree *tree, const struct htm_s2ellipse *ellipse, enum htm_errcode *err) |
Returns a lower and upper bound on the number of points in tree that are inside the given spherical ellipse. | |
struct htm_range | htm_tree_s2cpoly_range (const struct htm_tree *tree, const struct htm_s2cpoly *poly, enum htm_errcode *err) |
Returns a lower and upper bound on the number of points in tree that are inside the given spherical convex polygon. | |
Variables | |
enum _htm_cov | HTM_ALIGNED |
Minimalistic HTM indexing implementation.
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
Definition in file htm.c.
int64_t htm_tree_s2circle_count | ( | const struct htm_tree * | tree, |
const struct htm_v3 * | center, | ||
double | radius, | ||
enum htm_errcode * | err | ||
) |
Returns the number of points in tree
that are inside the spherical circle with the given center and radius.
If an error occurs, the return value is negative, and *err
is set to an error code describing the reason for the failure.
Definition at line 1582 of file htm.c.
References htm_tree::count, count, htm_tree::entries, HTM_CONTAINS, HTM_EINV, HTM_ENULLPTR, HTM_INSIDE, HTM_INTERSECT, HTM_OK, HTM_RAD_PER_DEG, htm_tree_s2circle_scan(), htm_v3_dist2(), htm_varint_decode(), htm_varint_nfollow(), index, htm_tree::indexfd, htm_tree::leafthresh, htm_tree::root, root, and htm_tree_entry::v.
struct htm_range htm_tree_s2circle_range | ( | const struct htm_tree * | tree, |
const struct htm_v3 * | center, | ||
double | radius, | ||
enum htm_errcode * | err | ||
) | [read] |
Returns a lower and upper bound on the number of points in tree
that are inside the spherical circle with the given center and radius.
If an error occurs, the returned range will contain an upper bound below the lower bound, and *err
is set to an error code describing the reason for the failure.
Definition at line 1943 of file htm.c.
References HTM_CONTAINS, HTM_EINV, HTM_ENULLPTR, HTM_INSIDE, HTM_INTERSECT, HTM_OK, HTM_RAD_PER_DEG, htm_tree_s2circle_scan(), htm_varint_decode(), htm_varint_nfollow(), htm_range::max, htm_range::min, and root.
int64_t htm_tree_s2cpoly_count | ( | const struct htm_tree * | tree, |
const struct htm_s2cpoly * | poly, | ||
enum htm_errcode * | err | ||
) |
Returns the number of points in tree
that are inside the given spherical convex polygon.
If an error occurs, the return value is negative, and *err
is set to an error code describing the reason for the failure.
Definition at line 1813 of file htm.c.
References count, htm_tree::entries, HTM_CONTAINS, HTM_EINV, HTM_ENOMEM, HTM_ENULLPTR, HTM_INSIDE, HTM_INTERSECT, HTM_OK, htm_s2cpoly_cv3(), htm_tree_s2cpoly_scan(), htm_varint_decode(), htm_varint_nfollow(), index, htm_tree::indexfd, htm_tree::leafthresh, htm_s2cpoly::n, htm_tree::root, root, and htm_tree_entry::v.
struct htm_range htm_tree_s2cpoly_range | ( | const struct htm_tree * | tree, |
const struct htm_s2cpoly * | poly, | ||
enum htm_errcode * | err | ||
) | [read] |
Returns a lower and upper bound on the number of points in tree
that are inside the given spherical convex polygon.
If an error occurs, the returned range will contain an upper bound below the lower bound, and *err
is set to an error code describing the reason for the failure.
Definition at line 2164 of file htm.c.
References HTM_CONTAINS, HTM_EINV, HTM_ENOMEM, HTM_ENULLPTR, HTM_INSIDE, HTM_INTERSECT, HTM_OK, htm_tree_s2cpoly_scan(), htm_varint_decode(), htm_varint_nfollow(), htm_range::max, htm_range::min, htm_s2cpoly::n, and root.
int64_t htm_tree_s2ellipse_count | ( | const struct htm_tree * | tree, |
const struct htm_s2ellipse * | ellipse, | ||
enum htm_errcode * | err | ||
) |
Returns the number of points in tree
that are inside the given spherical ellipse.
If an error occurs, the return value is negative, and *err
is set to an error code describing the reason for the failure.
Definition at line 1703 of file htm.c.
References count, htm_tree::entries, HTM_CONTAINS, HTM_EINV, HTM_ENULLPTR, HTM_INSIDE, HTM_INTERSECT, HTM_OK, htm_s2ellipse_cv3(), htm_tree_s2ellipse_scan(), htm_varint_decode(), htm_varint_nfollow(), index, htm_tree::indexfd, htm_tree::leafthresh, htm_tree::root, root, and htm_tree_entry::v.
struct htm_range htm_tree_s2ellipse_range | ( | const struct htm_tree * | tree, |
const struct htm_s2ellipse * | ellipse, | ||
enum htm_errcode * | err | ||
) | [read] |
Returns a lower and upper bound on the number of points in tree
that are inside the given spherical ellipse.
If an error occurs, the returned range will contain an upper bound below the lower bound, and *err
is set to an error code describing the reason for the failure.
Definition at line 2060 of file htm.c.
References HTM_CONTAINS, HTM_EINV, HTM_ENULLPTR, HTM_INSIDE, HTM_INTERSECT, HTM_OK, htm_tree_s2ellipse_scan(), htm_varint_decode(), htm_varint_nfollow(), htm_range::max, htm_range::min, and root.