{"library":"polygon-geohasher","title":"polygon-geohasher","description":"A lightweight wrapper over Shapely that returns the set of geohashes that form a Polygon. Current version is 0.0.2. The library has low release cadence (last release in 2023). It converts polygons to geohashes and vice versa, with optimizations like bbox gating and prepared geometry predicates.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install polygon-geohasher"],"cli":null},"imports":["from polygon_geohasher import polygon_to_geohashes","from polygon_geohasher import geohash_to_polygon","from polygon_geohasher import geohashes_to_polygon"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from shapely.geometry import Polygon\nfrom polygon_geohasher import polygon_to_geohashes, geohash_to_polygon, geohashes_to_polygon\n\n# Create a simple polygon (a square near London)\npolygon = Polygon([(-0.1, 51.5), (-0.1, 51.6), (0.1, 51.6), (0.1, 51.5)])\n\n# Convert polygon to geohashes (default precision 5)\ngeohashes = polygon_to_geohashes(polygon, precision=5)\nprint('Geohashes:', geohashes[:5], '...')  # prints first 5\n\n# Convert single geohash to polygon (bounding box)\nif geohashes:\n    poly = geohash_to_polygon(geohashes[0])\n    print('Polygon from geohash:', poly.wkt)\n\n# Convert list of geohashes to polygon\npoly_union = geohashes_to_polygon(list(geohashes))\nprint('Union polygon:', poly_union.wkt)","lang":"python","description":"Basic usage: create polygon, convert to geohashes, convert back.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}