Geometry

Java library for computational geometry.

License

License

Categories

Categories

Geo Business Logic Libraries Geospatial
GroupId

GroupId

io.github.ejif.geometry
ArtifactId

ArtifactId

geometry
Last Version

Last Version

0.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

Geometry
Java library for computational geometry.
Project URL

Project URL

https://github.com/ejif/geometry.git
Source Code Management

Source Code Management

https://github.com/ejif/geometry.git

Download geometry

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.ejif.geometry/geometry/ -->
<dependency>
    <groupId>io.github.ejif.geometry</groupId>
    <artifactId>geometry</artifactId>
    <version>0.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.ejif.geometry/geometry/
implementation 'io.github.ejif.geometry:geometry:0.0.2'
// https://jarcasting.com/artifacts/io.github.ejif.geometry/geometry/
implementation ("io.github.ejif.geometry:geometry:0.0.2")
'io.github.ejif.geometry:geometry:jar:0.0.2'
<dependency org="io.github.ejif.geometry" name="geometry" rev="0.0.2">
  <artifact name="geometry" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.ejif.geometry', module='geometry', version='0.0.2')
)
libraryDependencies += "io.github.ejif.geometry" % "geometry" % "0.0.2"
[io.github.ejif.geometry/geometry "0.0.2"]

Dependencies

compile (3)

Group / Artifact Type Version
com.google.guava : guava jar 27.1-jre
org.projectlombok : lombok jar 1.18.6
org.slf4j : slf4j-api jar 1.7.25

test (3)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 1.2.3
junit : junit jar 4.12
org.assertj : assertj-core jar 3.11.0

Project Modules

There are no modules declared in this project.

Geometry

Point location

This Java library provides an efficient algorithm for point location: given N points and O(N log N) preprocessing time, the algorithm can find the closest point to a given query point in O(log N) time. The library uses Fortune's algorithm to construct a Voronoi diagram, and a trapezoidal map to answer point location queries in O(log N) expected time. (The construction of the trapezoidal map involves inserting edges in a randomized order, so the runtime is expected O(log N) for all inputs.)

Usage:

    import io.github.ejif.geometry.Point;
    import io.github.ejif.geometry.algorithm.PointSet;

    List<Point> points = /* points */
    Point query = /* query point */
    PointSet pointSet = new PointSet(points);
    Point closestPoint = pointSet.findClosestPoint(query);

This library is extensively tested for both randomized point configurations and discrete point configurations with collinear and concyclic points. There are no arbitrary floating point scale requirements (e.g. checks for whether two points are within EPSILON = 1e-6), so this library supports points at any scale.

Maven

The geometry library is published at the following Maven coordinates. See the Github releases page for the latest version.

    <dependency>
        <groupId>io.github.ejif.geometry</groupId>
        <artifactId>geometry</artifactId>
        <version>{version}</version>
    </dependency>

Versions

Version
0.0.2
0.0.1