Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for H3 #22

Merged
merged 33 commits into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6050e65
Add h3 dependency, add GeoCoord to Point and Shapelike
willcohen Jul 2, 2018
7ae48d6
Create h3 ns, add initial h3 functions
willcohen Jul 2, 2018
b135f33
Add ring and ring-cells functions
willcohen Jul 2, 2018
b63975e
Add h3 tests
willcohen Jul 2, 2018
be05fe6
Add description of h3 to README
willcohen Jul 2, 2018
688d47d
Add multi-polygon to h3
willcohen Jul 3, 2018
b879eb6
Add edges to h3
willcohen Jul 3, 2018
541483b
Add pentagon check to h3
willcohen Jul 3, 2018
3b74fcc
Update README based on added h3 functionality
willcohen Jul 3, 2018
ea6ac20
Put edges into a clj vector
willcohen Jul 3, 2018
4bd7d43
Add type hinting for string and long h3 cells
willcohen Jul 3, 2018
76d9dc9
Modify H3Index to include to-string and to-long
willcohen Jul 4, 2018
affc488
Move Polygonal protocol to h3
willcohen Jul 11, 2018
97914ac
Add is-valid? to h3
willcohen Jul 11, 2018
b0586b8
Add neighbors? to h3
willcohen Jul 11, 2018
4934343
Modify ring functions to use hexRing functions instead of kRing
willcohen Jul 11, 2018
1e4a05d
Add type hint on latitude/longitude
willcohen Jul 11, 2018
f68cf99
Add polygons function to geo.jts
willcohen Jul 11, 2018
8336481
Fix multipolygon/polygon SRIDs
willcohen Jul 11, 2018
71690cf
Add polyfill to h3 protocol so it can operate on multipolygons
willcohen Jul 11, 2018
9d0ade0
Have h3 boundary return a polygon instead of a linearring
willcohen Jul 12, 2018
80a536b
Split geometrycollection into geometries
willcohen Jul 16, 2018
11ef4b8
Extend GeoJSONFeatures to JTS Geometry and GeometryCollection
willcohen Jul 16, 2018
8a88b4b
Refactor to-jts helper function names
willcohen Jul 16, 2018
fc41c63
Add test for h3->pt
willcohen Jul 16, 2018
f670ffa
Refactor h3 tests to use var for h3 identifier
willcohen Jul 16, 2018
422a793
Prep for 2.1.0 RC
worace Jul 18, 2018
8f0f0c2
Merge branch 'h3' into release/2.1.0
worace Jul 18, 2018
b13252d
Use mapv
willcohen Jul 20, 2018
90644ea
Use kRing/kRingDistances instead of hexRing/hexRange (since h3 3.0.6)
willcohen Jul 20, 2018
435719e
Check polyfill and uncompact size to reduce memory errors on polyfill
willcohen Jul 20, 2018
5f91f3c
Modify pt->h3 to use long by default, and add pt->h3-address
willcohen Jul 20, 2018
099c935
Handle empty shapes in polyfill
willcohen Jul 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ coordinates, distances, and polygon intersections. We think this library will
be particularly useful in concert with our [rich API of geospatial
information](http://developer.factual.com/).

We unify four open-source JVM geospatial libraries: The [JTS topology
We unify five open-source JVM geospatial libraries: The [JTS topology
suite](https://github.com/locationtech/jts),
[spatial4j](https://github.com/spatial4j/spatial4j),
[geohash-java](https://github.com/kungfoo/geohash-java), and
[proj4j](https://github.com/locationtech/geotrellis/tree/master/proj4). Clojure
[geohash-java](https://github.com/kungfoo/geohash-java),
[proj4j](https://github.com/locationtech/geotrellis/tree/master/proj4),
and [h3](https://github.com/uber/h3-java). Clojure
protocols allow these libraries' disparate representations of points, shapes,
and spatial reference systems to interoperate, so you can, for instance, ask
whether a JTS point is within a geohash, whether a geohash intersects a
Expand Down Expand Up @@ -172,6 +173,9 @@ box intersections, bounded-space partitioning, and so on.
Wrapper for the locationtech JTS spatial library. Constructors for points,
coordinate sequences, rings, polygons, multipolygons, and so on.

Given a certain geometry, can transform using proj4j to a different coordinate
reference system.

## geo.geohash

Defines geohashes using the ch.hsr.geohash library, and extends them to support
Expand All @@ -195,6 +199,27 @@ Helper functions for dealing with common geospatial serialization formats.
Use these to read and write from WKT, GeoJSON, WKB in byte and in hex string
formats, and EWKB in byte and in hex string formats.

## geo.crs

Helper functions for dealing with transforms between coordinate reference
systems. Can create transformations used in the geo.jts namespace.

## geo.h3

Defines hexagonal cells using the com.uber.h3 library. Extends H3's GeoCoord
to support the Point protocol.

Given a certain H3 cell, can compute surrounding rings, get the boundary in JTS format,
or get the resolution.

Given a Shapelike geometry, can polyfill a list of H3 cells at a given level of resolution.

Given a list of H3 cells, can compact the list to remove redundant cells, uncompact the list
to a desired resolution, or merge contiguous cells into a JTS multipolygon.

Can create unidirectional edges based on different configurations of cells, and can check
for the 12 pentagonal cells at each resolution.

IO functions return JTS Geometries.

# Tests
Expand Down
3 changes: 2 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(defproject
factual/geo "2.0.0-rc-3"
factual/geo "2.1.0-rc-0"
:url "https://github.com/factual/geo"
:license {:name "Eclipse Public License - v 1.0"
:url "http://www.eclipse.org/legal/epl-v10.html"
Expand All @@ -9,6 +9,7 @@
:dependencies
[[org.clojure/math.numeric-tower "0.0.4"]
[ch.hsr/geohash "1.3.0"]
[com.uber/h3 "3.0.3"]
[org.locationtech.geotrellis/geotrellis-proj4_2.11 "1.2.1"]
[org.locationtech.spatial4j/spatial4j "0.7"]
[org.locationtech.jts/jts-core "1.15.1"]
Expand Down
Loading