NSG Common Python Library
Project description
NSG Common Library
NSG common library.
A Python 3 library that contains the basic objects and schemas that NSG tile caches, or NSG components would need to adhere to.
Motivation
We wanted a library to contain common geospatial objects and commonly used functions to be used acrossed NSG python geospatial libraries and tools.
Build status
Sample Code
Example of calculating resolution width and height:
from nsg.common.spatial_reference_system import SpatialReferenceSystem
from nsg.tile_cache.tile_scheme import calc_resolutions
resolution_width, resolution_height = calc_resolutions(bounding_box=SpatialReferenceSystem.NSG_WORLD_GEODETIC.world_bounding_box,
tile_size=(256, 256),
zoom_level=1,
tile_scheme=SpatialReferenceSystem.NSG_WORLD_GEODETIC.tile_scheme)
Installation
pip install nsglib
Common NSG objects
Some examples of NSG objects include (but not limited to):
- SpatialReferenceSystem
- BoundingBox
- Coordinate
The most common Spatial Reference Systems that are defined are
EPSG:4326, EPSG:3395, and EPSG:3857.
These Spatial Reference Systems can be easily accessed by using the Python Enum:
SpatialReferenceSystem.NSG_WORLD_GEODETIC
,
SpatialReferenceSystem.NSG_WORLD_MERCATOR
, SpatialReferenceSystem.WEB_MERCATOR
The bounding box defines an object that holds the extent information in a particular Coordinate Reference System.
A Coordinate is an geographical location on a map. They can be used for Coordinate Reference System coordinates or tile coordinates.
Tile Cache NSG Objects
Some examples of Tile Cache objects include(but not limited to):
- Tile
- TileScheme
- AbstractTileCache
A Tile has a coordinate location (row, colum, zoom level) and a source. The coordinate location describes where to place the tile. The source is the tile data in bytes (the jpeg, png, or vector-tile data).
A Tile Scheme is how the world is divided up into tiles based on zoom level.
There is also an implementation included called ZoomTimesTwo
which is a tile
scheme implementation of a common convention where a tile set's tile matrix
doubles width and height between successive zoom levels.
Tile Scheme class also includes functions for calculating the resolution and scale denominator.
An AbstractTileCache are the basic functions that a tile cache should include. Some example tile caches are Compact Cache V2, GeoPackage, and File based Cache.
License
MIT
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
File details
Details for the file nsglib-2.0.0.0.tar.gz
.
File metadata
- Download URL: nsglib-2.0.0.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d4fab723271e773fe4cce181f2f647de8d8e640c5f49791b6e77b0907f149f8 |
|
MD5 | b3e2f4a41ee85166de2b8d3aadcdbdb5 |
|
BLAKE2b-256 | 46f850e7d42218ff7861b22fd4933baa6964907cc151e58955002da9e6dc7c81 |
File details
Details for the file nsglib-2.0.0.0-py3-none-any.whl
.
File metadata
- Download URL: nsglib-2.0.0.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c2f650db5da95726eab6923a667f3c3af10f5b7aeabaec326c20cf13772331b |
|
MD5 | 053b282e23f26a15033818fb0ab31b7e |
|
BLAKE2b-256 | 1ffeaaf3161631244c48411eb91f76a6e33716659230779a800dc3e2ae4b4635 |