# xyztilefile
### Samples
#### Basic usage sample.
```Python
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
```Python
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.)
Raw data
{
"_id": null,
"home_page": "",
"name": "xyztilefile",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "xyztilefile xyz-tile xyztile",
"author": "Akito Davis Kawamura",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/c6/f7/2c5be3b167b5a0823f866a603a785555bf30d9e1318e99a48e29047a5538/xyztilefile-0.3.3.tar.gz",
"platform": null,
"description": "# xyztilefile\r\n\r\n### Samples\r\n#### Basic usage sample.\r\n```Python\r\nfrom xyztilefile import *\r\nxyz = calc_xyz_from_lonlat\r\n\r\nx, y, z = calc_xyz_from_lonlat(135.0,35.0,15)\r\n\r\ntest_txt = XYZTileFile(\"./tile_sample/{z}/{x}/{y}.txt\")\r\ntxt = test_txt.get(*xyz(135.0,35.0,15))\r\ntest_txt.set(x,y,z,txt+\"\\nNew line is added\")\r\ntest_txt.save(x,y,z)\r\n```\r\n\r\n#### Usage sample of XYZTileManager\r\n```Python\r\nfrom xyztilefile import *\r\nxyz = calc_xyz_from_lonlat\r\n\r\ntest_json = XYZTileManager(\"https://raw.githubusercontent.com/aDAVISk/xyztilefile/dev/tile_sample/{z}/{x}/{y}.json\", \"./tile_sample2/{z}/{x}/{y}.json\")\r\ndata = test_json.get(*xyz(135.0,35.0,15))\r\n```\r\nXYZTileManager 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.\r\n\r\n\r\n\r\nplease check './test/' for more sample codes\r\n\r\n### currently supported file formats\r\n- txt : encoding must be UTF-8 \r\n- json : encoding must be UTF-8\r\n- png : with skit-image (tested with `./test/test_png.py`)\r\n- npy : with numpy (tested with `./test/test_npy.py`)\r\n- pickle/pkl : only for local file with extra keyword setting at the initialization `XYZTileFile(basepath, allow_pickle=True)` (tested with `./test/test_pickle.py`)\r\n \r\n- (generic : this format is basic but your customization is needed.)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "manage files in xyz tile format",
"version": "0.3.3",
"project_urls": null,
"split_keywords": [
"xyztilefile",
"xyz-tile",
"xyztile"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b1da34d0c3f72786ce9df5edeaf4701082b768dc5834d9684597a3d9258940c1",
"md5": "4ee917d8661288fdf867c481701f3640",
"sha256": "5f88821e99f654f12f50d3bd8f0ff737b88f610ca2e64e5dda7130ba182a45c8"
},
"downloads": -1,
"filename": "xyztilefile-0.3.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4ee917d8661288fdf867c481701f3640",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10327,
"upload_time": "2024-03-02T01:54:57",
"upload_time_iso_8601": "2024-03-02T01:54:57.054193Z",
"url": "https://files.pythonhosted.org/packages/b1/da/34d0c3f72786ce9df5edeaf4701082b768dc5834d9684597a3d9258940c1/xyztilefile-0.3.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c6f72c5be3b167b5a0823f866a603a785555bf30d9e1318e99a48e29047a5538",
"md5": "a0b0a9546f0d779137657aceef021f76",
"sha256": "49569b553c88f6da1c36262ed4558149bebe55fab49738fee66e9a8fcb507cd9"
},
"downloads": -1,
"filename": "xyztilefile-0.3.3.tar.gz",
"has_sig": false,
"md5_digest": "a0b0a9546f0d779137657aceef021f76",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8773,
"upload_time": "2024-03-02T01:54:58",
"upload_time_iso_8601": "2024-03-02T01:54:58.740197Z",
"url": "https://files.pythonhosted.org/packages/c6/f7/2c5be3b167b5a0823f866a603a785555bf30d9e1318e99a48e29047a5538/xyztilefile-0.3.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-02 01:54:58",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "xyztilefile"
}