Skip to main content

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


Download files

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

Source Distribution

xyztilefile-0.3.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

xyztilefile-0.3.3-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file xyztilefile-0.3.3.tar.gz.

File metadata

  • Download URL: xyztilefile-0.3.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for xyztilefile-0.3.3.tar.gz
Algorithm Hash digest
SHA256 49569b553c88f6da1c36262ed4558149bebe55fab49738fee66e9a8fcb507cd9
MD5 a0b0a9546f0d779137657aceef021f76
BLAKE2b-256 c6f72c5be3b167b5a0823f866a603a785555bf30d9e1318e99a48e29047a5538

See more details on using hashes here.

File details

Details for the file xyztilefile-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: xyztilefile-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for xyztilefile-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5f88821e99f654f12f50d3bd8f0ff737b88f610ca2e64e5dda7130ba182a45c8
MD5 4ee917d8661288fdf867c481701f3640
BLAKE2b-256 b1da34d0c3f72786ce9df5edeaf4701082b768dc5834d9684597a3d9258940c1

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