2017 © Pedro Peláez
 

library spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

image

josue/spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

  • Friday, April 7, 2017
  • by josue.0
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Installation

Using Composer, just add it to your composer.json by running:, (*1)

composer require josue/spatial-hash-table

Usage

Example, (*2)

Alt Test case graph, (*3)

<?php

use SpatialHashTable\BiHashTable;
use SpatialHashTable\SupportedGeometries\Edge;
use SpatialHashTable\SupportedGeometries\Point;

$b = new BiHashTable(1);

$b->addElement(new Edge(new Point(-1.5, -1), new Point( -0.5, -0.5), 100));
$b->addElement(new Edge(new Point(1.25, 1.5), new Point( 0.5, 0.75), 200));
$b->addElement(new Edge(new Point(1.75, 1.75), new Point( 1.75, 1.25), 300));
$b->addElement(new Point(0.5, 0.5, 400));


echo json_encode($b->getAllElementsInCircle(new Point(0,0)));

And the output is:, (*4)

{
  "100": {
    "id": 100,
    "p1": {
      "id": 0,
      "x": -1.5,
      "y": -1
    },
    "p2": {
      "id": 0,
      "x": -0.5,
      "y": -0.5
    }
  },
  "200": {
    "id": 200,
    "p1": {
      "id": 0,
      "x": 1.25,
      "y": 1.5
    },
    "p2": {
      "id": 0,
      "x": 0.5,
      "y": 0.75
    }
  },
  "400": {
    "id": 400,
    "x": 0.5,
    "y": 0.5
  }
}

The Versions

07/04 2017

dev-master

9999999-dev https://github.com/j05u3/spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

  Sources   Download

MIT

The Requires

  • php >=7.0.15

 

by Avatar josue.0

distance bounds spatial hash table 2d-hash table spatial query

07/04 2017

v0.0.5

0.0.5.0 https://github.com/j05u3/spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

  Sources   Download

MIT

The Requires

  • php >=7.0.15

 

by Avatar josue.0

distance bounds spatial hash table 2d-hash table spatial query

01/04 2017

v0.0.4

0.0.4.0 https://github.com/j05u3/spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

  Sources   Download

MIT

The Requires

  • php >=7.0.15

 

by Avatar josue.0

distance bounds spatial hash table 2d-hash table spatial query

01/04 2017

v0.0.3

0.0.3.0 https://github.com/j05u3/spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

  Sources   Download

MIT

The Requires

  • php >=7.0.15

 

by Avatar josue.0

distance bounds spatial hash table 2d-hash table spatial query

01/04 2017

v0.0.2

0.0.2.0 https://github.com/j05u3/spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

  Sources   Download

MIT

The Requires

  • php >=7.0.15

 

by Avatar josue.0

distance bounds spatial hash table 2d-hash table spatial query

01/04 2017

v0.0.1

0.0.1.0 https://github.com/j05u3/spatial-hash-table

2D hash table for fast edges-touching-circle retrieval

  Sources   Download

MIT

The Requires

  • php >=7.0.15

 

by Avatar josue.0

distance bounds spatial hash table 2d-hash table spatial query