This is a tiny Java 8 library able to convert JTS geometries to a set of GeoHashes with arbitrary precision (<12).
A GeoHash-based Mallorca discretization looks like:
The precision used is 7 - notice that the GeoHash set is reduced if all children of a certain GeoHash are present.
<dependency>
<groupId>io.github.adrianulbona</groupId>
<artifactId>jts-discretizer</artifactId>
<version>0.1.0</version>
</dependency>
final Geometry geometry = ...
final DiscretizerFactory discretizerFactory = new DiscretizerFactoryImpl();
final GeometryDiscretizer<Geometry> discretizer = discretizerFactory.discretizer(geometry);
final Set<GeoHash> geoHashes = discretizer.apply(geometry, 7);