manage files in xyz tile format
Project description
xyztilefile
Samples
Basic usage sample.
from xyztilefile import *
xyz = calc_xyz_from_lonlat
x, y, z = calc_xyz_from_lonlat(135.0,35.0,15)
test_txt = XYZTileFile("./tile_sample/{z}/{x}/{y}.txt")
txt = test_txt.get(*xyz(135.0,35.0,15))
test_txt.set(x,y,z,txt+"\nNew line is added")
test_txt.save(x,y,z)
Usage sample of XYZTileManager
from xyztilefile import *
xyz = calc_xyz_from_lonlat
test_json = XYZTileManager("https://raw.githubusercontent.com/aDAVISk/xyztilefile/dev/tile_sample/{z}/{x}/{y}.json", "./tile_sample2/{z}/{x}/{y}.json")
data = test_json.get(*xyz(135.0,35.0,15))
XYZTileManager first check the locally saved cache which is the second argument. If such local file is missing, then XYZTileManager will try to retrieve data from the online source which is the first argument.
please check './test/' for more sample codes
currently supported file formats
-
txt : encoding must be UTF-8
-
json : encoding must be UTF-8
-
png : with skit-image (tested with
./test/test_png.py
) -
npy : with numpy (tested with
./test/test_npy.py
) -
pickle/pkl : only for local file with extra keyword setting at the initialization
XYZTileFile(basepath, allow_pickle=True)
(tested with./test/test_pickle.py
) -
(generic : this format is basic but your customization is needed.)
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 Distributions
Built Distribution
Hashes for xyztilefile-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9f88c942b2360afa3024ccc2f577ea2084e438218af87438929555a0c7317a5 |
|
MD5 | 6bb9a1fdcbeb5d69ba0c0ad0f0e5c82e |
|
BLAKE2b-256 | 47c948748f0c2dda40590f5b396101edced575784bd0731fa0d019c29ee58101 |