Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrianulbona/jts-discretizer
https://github.com/adrianulbona/jts-discretizer
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adrianulbona/jts-discretizer
- Owner: adrianulbona
- License: apache-2.0
- Created: 2016-12-26T19:17:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-22T19:49:20.000Z (almost 8 years ago)
- Last Synced: 2024-10-13T00:10:55.551Z (2 months ago)
- Language: Java
- Homepage:
- Size: 996 KB
- Stars: 35
- Watchers: 7
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jts-discretizer
[![Build Status](https://travis-ci.org/adrianulbona/jts-discretizer.svg?branch=master)](https://travis-ci.org/adrianulbona/jts-discretizer)
[![Coverage Status](https://coveralls.io/repos/github/adrianulbona/jts-discretizer/badge.svg)](https://coveralls.io/github/adrianulbona/jts-discretizer)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.adrianulbona/jts-discretizer/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.adrianulbona/jts-discretizer)This is a tiny Java 8 library able to convert [JTS](https://en.wikipedia.org/wiki/JTS_Topology_Suite) geometries to a set of [GeoHashes](https://en.wikipedia.org/wiki/Geohash) with arbitrary precision (<12).
A GeoHash-based Mallorca discretization looks like:
![alt tag](https://github.com/adrianulbona/jts-discretizer/raw/master/img/polygon.png)
The precision used is 7 - notice that the GeoHash set is reduced if all children of a certain GeoHash are present.
## Maven:
```xmlio.github.adrianulbona
jts-discretizer
0.1.0```
## Code sample:
```java
final Geometry geometry = ...
final DiscretizerFactory discretizerFactory = new DiscretizerFactoryImpl();
final GeometryDiscretizer discretizer = discretizerFactory.discretizer(geometry);
final Set geoHashes = discretizer.apply(geometry, 7);
```