Japan grid square code (JIS X 0410) utility for Python.
Project description
Japan grid square code (JIS X 0410) utility for Python.
Features
- Supports the meshes below.
1st mesh (jpmesh.FirstMesh class, about 80 km square).
2nd mesh (jpmesh.SecondMesh class, about 10 km square).
3rd mesh (jpmesh.ThirdMesh class, about 1 km square).
1/2 mesh (jpmesh.HalfMesh class, about 500 m square).
1/4 mesh (jpmesh.QuarterMesh class, about 250 m square).
1/8 mesh (jpmesh.OneEighthMesh class, about 125 m square).
- Supports the calculations below.
Mesh border coordinates from mesh codes.
Mesh codes from coordinates.
Consisted of only one file and depends on no other libraries, which enable you to use it portably.
Installation
Choose one from the following.
Run pip install pyjpmesh.
Put jpmesh.py on your project.
Tutorial
Here is an example to get the 1st mesh (about 8 km square) code that a given point belongs to.
from jpmesh import Angle, Coordinate, FirstMesh
coordinate = Coordinate(
lon=Angle.from_degree(140.0), lat=Angle.from_degree(35.0))
mesh = FirstMesh.from_coordinate(coordinate)
print mesh.code # '5240'
Here is another example to get the center point of the given mesh.
from jpmesh import parse_mesh_code
mesh = parse_mesh_code('5339')
mesh_center = mesh.south_west + (mesh.size / 2.0)
print mesh_center.lon.degree, mesh_center.lat.degree # 139.5 35.667
To use other mesh classes (SecondMesh, ThirdMesh, etc.), use those classes instead of FirstMesh.
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
File details
Details for the file pyjpmesh-1.1.0.tar.gz
.
File metadata
- Download URL: pyjpmesh-1.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d809d08c2da233d77e2f2c2328581cfbd8a27d9330cc54fae36af48a5c1efd3 |
|
MD5 | de942a914fa7664224b1d3718aee9464 |
|
BLAKE2b-256 | a44147e77fa9b2c69bfa1c79576f8350b3db6d184ab201ae7d41c4ea98476df3 |