A GeoHash-based Mallorca discretization looks like:
The smallest geo-hashes are of length 7. Notice that the resulted geo-hash set is optimized, if all children of a certain geo-hash are present in the original set, the children are replaced with the parent.
How to use it?
<dependency> <groupId>io.github.adrianulbona</groupId> <artifactId>jts-discretizer</artifactId> <version>0.1.0</version> </dependency>
Geometry geometry = ... DiscretizerFactory factory = new DiscretizerFactoryImpl(); Set<GeoHash> geoHashes = factory.discretizer(geometry).apply(geometry, 7);