Geohash Generator is a python module that provides function for converting geojson and shapefile to geohash.
Project description
Geohash Generator
Geohash Generator is a python module that provides function for converting geojson and shapefile to geohash.
Feature
- Convert from Geojson to Geohash
- Convert from Shapefile to Geohash
- Convert from Geohash to Geojson
- Do you have any idea for other feature?
Reqruiements
- Python: 2.x, 3.x
Installation
pip install geohash-generator
Usage
Convert from Geojson to Geohash
from geohash_generator.geohash_generator import generate
import os
# Init Variable
this_script_dir = os.path.dirname(os.path.realpath(__file__))
source_path = os.path.join(
this_script_dir,
'example.geojson'
)
min_level_precision=2
max_level_precision=7
file_type="geojson"
# Convert Geojson to Geohash
convert_geojson_to_geohash = generate(
source_path=source_path,
min_level_precision=min_level_precision,
max_level_precision=max_level_precision,
file_type=file_type,
)
# Print result
print(f"convert_geojson_to_geohash: {convert_geojson_to_geohash}")
Convert from Shapefile to Geohash
from geohash_generator.geohash_generator import generate
import os
# Init Variable
this_script_dir = os.path.dirname(os.path.realpath(__file__))
source_path = os.path.join(
this_script_dir,
'example.shp'
)
min_level_precision=2
max_level_precision=7
file_type="shapefile"
# Convert Shapefile to Geohash
convert_shapefile_to_geohash = generate(
source_path=source_path,
min_level_precision=min_level_precision,
max_level_precision=max_level_precision,
file_type=file_type,
)
# Print result
print(f"convert_shapefile_to_geohash: {convert_shapefile_to_geohash}")
Convert from Geohash to Geojson
from geohash_generator.geohash_generator import geohash_to_geojson
import os
# Init Variable
this_script_dir = os.path.dirname(os.path.realpath(__file__))
source_path = os.path.join(
this_script_dir,
'geohash_example.txt'
)
# Convert Geohash to Geojson
convert_geohash_to_geojson = geohash_to_geojson(source_path=source_path)
# Print Result
print(f"convert_geohash_to_geojson: {convert_geohash_to_geojson}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for geohash_generator-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd2a725b1430b2a6ccb78fd75918ff4310010e333ca9f37585e6446d1d47fa0 |
|
MD5 | 3b27777aa0b93659203f8c6be8be850b |
|
BLAKE2b-256 | 9ec8ea2b861c4551696377f1d207af7d6b7279b40a0b07adf19fb1ea8c960d44 |