- HTM

   HTM Implementation

Tested Platforms
Related developments - HTM users.


    The HTM Implementation has evolved a lot over the past few years. Initially, Alex Szalay put together the first C code that generated the complete HTM index and was able to perform most of the querying. Robert Brunner wrote the first C++ version, calling it AstroMap. When we first started to receive 'real' data in 1998, we gathered enough experience to know where the bottlenecks lie. The code was completely redesigned and rewritten in C++ by Peter Kunszt in 1999, based on the initial C implementation, improving the performance by factors up to 00. In 2000/2003 George Fekete proprosed a redesign which would have changed the numbering sequence of the ids. This was not considered a good option but a few modifications were made to simplify the code. Another factor 4 speedup was achieved by this. In the current version partial and full lists have been droped and a set of ranges of ids are returned from an intersection. The current version is 2.1.

    The code should work on every computer with a C/C++ compiler or with JDK1.2 installed for the java version. It has been successfully tested on these platforms.

    There are 3 APIs currently forseen:

    C++ set of classes and a cc_aux c file with c functions
    a Java2 package
    a C# package (tbd)


    Some online documentations is available:

    Programmers Quick Guide
    C++ classes and methods
    Java class documentation (JavaDoc)
    Detailed description


    The HTM code that can be downloaded here has the following functionality:

    • For a given point (x,y,z) on the sphere, return the node name it belongs to up to a given level
    • For a given node name, return the 3 vertex vectors
    • Bit-encode and decode node name into an integer
    • Supports complicated query surfaces on the sphere, returning the node ids for each node fully or partially contained in the query surface

    The documentation is included with each package. If you are interested in very detailed descriptions of the HTM, please read one of the publications or see the online details.

    NOTE: To download - depending on your browser settings - you might have to hold the shift key while clicking on the link you're interested in.

    C++ classes

    C++ classes (2.1), in .tar.gz with makefile also contins visuall c++ project (136K)
    C++ class documentation only (HTML), in .tar.gz (20K)
    C++ class documentation only (HTML), in .zip (27K)

    Java package - Version 3.0.1

    Java htm package htmIndex.jar with examples (68K)
    Java HTML documentation javadocs in a jar file (276K)
    Java HTM source includes build.xml for bulding with ant and jbx Jbuilder project. (276K)

    SQL Server Package Version 2.

    SQL Server DLL and Strored Procedures allows calling of HTM functions inside SQL Server. Includes htmdll_2_0.doc which explains how to use this.

Related Developments

At STScI HTM is used for partitioning the multi terabyte GSC2 catalogue . ShowSky a java tool for plotting images and objects contains HTM plotting features.

The ESA cornerstone mission GAIA is currently studying HTM to partition similations and data. Prototypes have been built on HTM using Java.

The SAADA use HTM for access to astronomical datbases.

William O'Mullane
Last Modified :Tuesday, December 26, 2006 at 3:52:09 PM , $Revision 1.7 $