Skip to main content

Vgrid - A Global Geocoding System based on Vector Tiles

Project description

Vgrid - A Global Geocoding System based on Vector Tiles

Installation:

  • Using pip install (Windows/ Linux):

    pip install vgrid
    
  • Show information of installed vgrid:

    pip show vgrid
    
  • Install the latest version of vgrid:

    pip install vgrid --upgrade
    
  • Visit vgrid on PyPI

Usage - Python:

Import vgrid, initialize Latitude and Longitude for testing:

from vgrid.utils.geocode import mgrs, maidenhead, geohash, olc
latitude, longitude = 10.775275567242561, 106.70679737574993
print(f'Latitude, Longitude: ({latitude}, {longitude})')

MGRS

print('\nMGRS:')
mgrs_precision = 5
mgrs_code = mgrs.toMgrs(latitude, longitude, mgrs_precision)
mgrs_code_to_wgs = mgrs.toWgs(mgrs_code)
print(f'MGRS Code at precision = {mgrs_precision}: {mgrs_code}')
print(f'Convert {mgrs_code} back to WGS84 = {mgrs_code_to_wgs}')

Maidenhead

print('\nMaidenhead:')
maidenhead_precision = 3
maidenhead_code = maidenhead.toMaiden(latitude, longitude, maidenhead_precision)
maidenGrid = maidenhead.maidenGrid(maidenhead_code)
print(f'Maidenhead Code at precision = {maidenhead_precision}: {maidenhead_code}')
print(f'Convert {maidenhead_code} to center and cell in WGS84 = {maidenGrid}')

Geohash

print('\nGeohash:')
geohash_precision = 12
geohash_code = geohash.encode(latitude, longitude, geohash_precision)
geohash_decode = geohash.decode(geohash_code, False)
print(f'Geohash Code at precision = {geohash_precision}: {geohash_code}')
print(f'Decode {geohash_code} to center in WGS84 = {geohash_decode}')

OLC

print('\nOpen Location Code (OLC):')
olc_precision = 10
olc_code = olc.encode(latitude, longitude, olc_precision)
olc_decode = olc.decode(olc_code)
print(f'OLC at precision = {olc_precision}: {olc_code}')
print(f'Decode {olc_code} to center and cell in WGS84 = {olc_decode}')

Command line for creating geocoding grid in shapefile format

> geohashgrid -p 1 -o geohash_1.shp (p = [1..12])
> maidenheadgrid -p 1 -o maidenhead_1.shp (p = [1, 2, 3, 4])
> olcgrid -p 1 -o olc_1.shp (p = [2,4,8])
> gzd -o gzd.shp (Create Grid Zone Designators - used by MGRS)
> mgrsgrid -o mgrs_32648.shp -cellsize 100000 -epsg 32648 (Create MGRS Grid with cell size 100km x 100km at UTM zone 48N)  

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

vgrid-1.0.7.tar.gz (61.6 kB view details)

Uploaded Source

Built Distribution

vgrid-1.0.7-py3-none-any.whl (71.4 kB view details)

Uploaded Python 3

File details

Details for the file vgrid-1.0.7.tar.gz.

File metadata

  • Download URL: vgrid-1.0.7.tar.gz
  • Upload date:
  • Size: 61.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for vgrid-1.0.7.tar.gz
Algorithm Hash digest
SHA256 6172f92b3417053bb56b1ed379a67ebad2c362ba51819a18ef0fb028d16f651d
MD5 0e0e65b3384573eb888d7944a010f4c7
BLAKE2b-256 c598d9be68f4f77036352db926055a7d9e077a69de5386b8ca528fc0a3da162a

See more details on using hashes here.

File details

Details for the file vgrid-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: vgrid-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 71.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for vgrid-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5df7239ad07709627cf9b378d8e36dc997255955f0e1858f3869cab89dd790f2
MD5 e1d166e68d91b36b41b9e7bf032ec34c
BLAKE2b-256 527b7395c5a206307d8bb4c98dfb2a34ba347604bfa5b44cd61ce3b3c66260a2

See more details on using hashes here.

Supported by

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