<commit_before># rtree-3d
3D R-Tree in java.

Three dimensional R-Tree in java motivated by spatio-temporal queries. Nodes would be serialized to disk or network storage.  

Status: *pre-alpha*

Progress is being made on this project. I've copied my [rtree 2D implementation](https://github.com/davidmoten/rtree)and beefed it up for 3D. 

* expanded the R* `Selector` and `Splitter` implementations to handle 3 dimensions
* normalized coordinates so they range from 0..1
* added [R language code](src/main/r/source.r) to produce PNG visualizations of tree structure (below) 

Greek Earthquake data
-----------------------
Given the 38,377 data points of greek earthquakes (lat, long, time), the data is scanned to establish the ranges for each coordinate then 
normalized to a [0,1] range. The points are added to an R*-tree with `minChildren`=2 and `maxChildren`=4. Visualization 
of the bounding boxes at nodes by depth is below.

Depth 0:
<img src="https://raw.githubusercontent.com/davidmoten/davidmoten.github.io/master/resources/rtree-3d/plot0.png"/>
<br/>
Depth 1:<commit_msg>add protobuf sample<commit_after># rtree-3d
3D R-Tree in java.

Three dimensional R-Tree in java motivated by spatio-temporal queries. Nodes would be serialized to disk or network storage.  
Particularly interested in large static datasets.

Status: *pre-alpha*

Progress is being made on this project. I've copied my [rtree 2D implementation](https://github.com/davidmoten/rtree)and beefed it up for 3D. 

* expanded the R* `Selector` and `Splitter` implementations to handle 3 dimensions
* normalized coordinates so they range from 0..1
* added [R language code](src/main/r/source.r) to produce PNG visualizations of tree structure (below) 

Greek Earthquake data
-----------------------
Given the 38,377 data points of greek earthquakes (lat, long, time), the data is scanned to establish the ranges for each coordinate then 
normalized to a [0,1] range. The points are added to an R*-tree with `minChildren`=2 and `maxChildren`=4. Visualization 
of the bounding boxes at nodes by depth is below.

Depth 0:
<img src="https://raw.githubusercontent.com/davidmoten/davidmoten.github.io/master/resources/rtree-3d/plot0.png"/>
<br/>
Depth 1:
{'fraction_non_alphanumeric': 0.10576057605760576, 'fraction_numerical': 0.018001800180018002, 'mean_word_length': 4.098623853211009, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1477346', 'n_tokens_mistral': 688, 'n_tokens_neox': 640, 'n_words': 275}