Git Product home page Git Product logo

archery's Introduction

Archery

Overview

Archery is a two-dimensional R-Tree written in Scala. The implementation is immutable: adding and removing points from the tree produces a new tree, leaving the old one untouched. Due to structural sharing this operation is quite efficient.

The name "archery" is a corruption of the word "R-Tree".

travis-ci.org codecov.io

Example Usage

import archery._

// create some entries
val alice = Entry(Point(9.12F, -4.9F), "alice")
val bob = Entry(Point(2.3F, 4.6F), "bob")
val candice = Entry(Point(4.7F, -1.9F), "candice")
val doug = Entry(Point(5.5F, -3.2F), "doug")

// build a tree with three points
val tree1: RTree[String] = RTree(alice, bob, candice)

// add "doug"
val tree2: RTree[String] = tree1.insert(doug)

// remove "bob"
val tree3: RTree[String] = tree2.remove(bob)

// search from (0,-4) to (10,6), will find "doug"
val bbox: Box = Box(0F, -4F, 10F, 6F)
val results: Seq[Entry[String]] = tree3.search(bbox)

// we can also just ask how many matching entries exist
val n: Int = tree3.count(bbox)
assert(results.length == n)

Contributing

If you find something that seems like a bug in Archery, or see confusing behavior, or find a place where the documentation or library could be better, please open an issue.

Pull requests are gladly accepted. The preferred strategy is to open an issue or pull request where the feature can be discussed. We can use the PR to collaborate on, and will merge it once everyone agrees on the change, the tests and docs are updated, etc.

Building Archery

Building this project requires SBT 0.13.x.

After you launch SBT, you can run the following commands:

  • compile compile the project.
  • test run the tests.
  • scalastyle run the style-checking.
  • benchmark/run run the included timing benchmarks.
  • console load a scala REPL with archery on the classpath.

(Travis automatically runs test and scalastyle, so any issues should also be detected when a pull request is opened.)

You can generate coverage statistics manually by running the following command from the command-line:

$ sbt clean coverage test coverageReport

Open core/target/scala-2.11/scoverage-report/index.html in a web browser to see local coverage.

Tests are written with ScalaTest and use the excellent ScalaCheck library for automated specification-based testing.

Test coverage is measured using sbt-scoverage and tracked at codecov.io.

The benchmarks are written against Rex Kerr's excellent library Thyme.

License

Archery is available to you under the MIT license. See the COPYING file for details.

Credits

Archery is maintained by Erik Osheim.

Copyright (c) 2013-2015 Meetup Inc.

archery's People

Contributors

joshmarcus avatar kurnevsky avatar matfax avatar non avatar softprops avatar sporritt avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.