Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geohash-generator-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geohash_generator-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file geohash-generator-0.1.0.tar.gz.

File metadata

  • Download URL: geohash-generator-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for geohash-generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd580725acd1dcef42ace48dfc23248b765f33039323db7014ce7ed948fed7d1
MD5 7a6072b835d8b7f572de1c836154a377
BLAKE2b-256 486410177b20f611b563201d514b0cee372d064267752d4894a53e354737f80d

See more details on using hashes here.

File details

Details for the file geohash_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for geohash_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cd2a725b1430b2a6ccb78fd75918ff4310010e333ca9f37585e6446d1d47fa0
MD5 3b27777aa0b93659203f8c6be8be850b
BLAKE2b-256 9ec8ea2b861c4551696377f1d207af7d6b7279b40a0b07adf19fb1ea8c960d44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page