# Geohash Generator
Geohash Generator is a python module that provides function for converting geojson and shapefile to geohash.
## Feature
- [x] Convert from Geojson to Geohash
- [x] Convert from Shapefile to Geohash
- [x] 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}")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Helfi-Pangestu-Labs/geohash-generator/",
"name": "geohash-generator",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "geohash,geojson,convert,geohash-generator,shapefile converter,geojson converter",
"author": "Helfi Pangestu",
"author_email": "hellfipangestu@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/48/64/10177b20f611b563201d514b0cee372d064267752d4894a53e354737f80d/geohash-generator-0.1.0.tar.gz",
"platform": null,
"description": "# Geohash Generator\nGeohash Generator is a python module that provides function for converting geojson and shapefile to geohash. \n\n## Feature\n- [x] Convert from Geojson to Geohash\n- [x] Convert from Shapefile to Geohash\n- [x] Convert from Geohash to Geojson\n- [ ] Do you have any idea for other feature?\n\n## Reqruiements\n- Python: 2.x, 3.x\n\n## Installation\n```\npip install geohash-generator\n```\n\n## Usage\n### Convert from Geojson to Geohash\n```\nfrom geohash_generator.geohash_generator import generate\nimport os\n\n# Init Variable\nthis_script_dir = os.path.dirname(os.path.realpath(__file__))\nsource_path = os.path.join(\n this_script_dir,\n 'example.geojson'\n)\nmin_level_precision=2\nmax_level_precision=7\nfile_type=\"geojson\"\n\n# Convert Geojson to Geohash\nconvert_geojson_to_geohash = generate(\n source_path=source_path,\n min_level_precision=min_level_precision,\n max_level_precision=max_level_precision,\n file_type=file_type,\n)\n\n# Print result\nprint(f\"convert_geojson_to_geohash: {convert_geojson_to_geohash}\")\n```\n\n### Convert from Shapefile to Geohash\n```\nfrom geohash_generator.geohash_generator import generate\nimport os\n\n# Init Variable\nthis_script_dir = os.path.dirname(os.path.realpath(__file__))\nsource_path = os.path.join(\n this_script_dir,\n 'example.shp'\n)\nmin_level_precision=2\nmax_level_precision=7\nfile_type=\"shapefile\"\n\n# Convert Shapefile to Geohash\nconvert_shapefile_to_geohash = generate(\n source_path=source_path,\n min_level_precision=min_level_precision,\n max_level_precision=max_level_precision,\n file_type=file_type,\n)\n\n# Print result\nprint(f\"convert_shapefile_to_geohash: {convert_shapefile_to_geohash}\")\n```\n\n### Convert from Geohash to Geojson\n```\nfrom geohash_generator.geohash_generator import geohash_to_geojson\nimport os\n\n# Init Variable\nthis_script_dir = os.path.dirname(os.path.realpath(__file__))\nsource_path = os.path.join(\n this_script_dir,\n 'geohash_example.txt'\n)\n\n# Convert Geohash to Geojson\nconvert_geohash_to_geojson = geohash_to_geojson(source_path=source_path)\n\n# Print Result\nprint(f\"convert_geohash_to_geojson: {convert_geohash_to_geojson}\")\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Geohash Generator is a python module that provides function for converting geojson and shapefile to geohash.",
"version": "0.1.0",
"project_urls": {
"Download": "https://github.com/Helfi-Pangestu-Labs/geohash-generator/archive/main.tar.gz",
"Homepage": "https://github.com/Helfi-Pangestu-Labs/geohash-generator/"
},
"split_keywords": [
"geohash",
"geojson",
"convert",
"geohash-generator",
"shapefile converter",
"geojson converter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9ec8ea2b861c4551696377f1d207af7d6b7279b40a0b07adf19fb1ea8c960d44",
"md5": "3b27777aa0b93659203f8c6be8be850b",
"sha256": "2cd2a725b1430b2a6ccb78fd75918ff4310010e333ca9f37585e6446d1d47fa0"
},
"downloads": -1,
"filename": "geohash_generator-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3b27777aa0b93659203f8c6be8be850b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9207,
"upload_time": "2023-08-28T10:05:37",
"upload_time_iso_8601": "2023-08-28T10:05:37.225023Z",
"url": "https://files.pythonhosted.org/packages/9e/c8/ea2b861c4551696377f1d207af7d6b7279b40a0b07adf19fb1ea8c960d44/geohash_generator-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "486410177b20f611b563201d514b0cee372d064267752d4894a53e354737f80d",
"md5": "7a6072b835d8b7f572de1c836154a377",
"sha256": "cd580725acd1dcef42ace48dfc23248b765f33039323db7014ce7ed948fed7d1"
},
"downloads": -1,
"filename": "geohash-generator-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7a6072b835d8b7f572de1c836154a377",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7223,
"upload_time": "2023-08-28T10:05:38",
"upload_time_iso_8601": "2023-08-28T10:05:38.665876Z",
"url": "https://files.pythonhosted.org/packages/48/64/10177b20f611b563201d514b0cee372d064267752d4894a53e354737f80d/geohash-generator-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-28 10:05:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Helfi-Pangestu-Labs",
"github_project": "geohash-generator",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "geohash-generator"
}