Một chút vọc vạch về
mapbox
mapbox.com
https://studio.mapbox.com/tilesets/
Studio upload limits 20 uploads / month
300 MB / upload
Uploading data via our APIs allows you to bypass these limits. Use Mapbox Tiling Service for vector data or Uploads API for raster data.
https://studio.mapbox.com/tilesets/soiqualang.601ynxwc
https://docs.mapbox.com/help/troubleshooting/uploads/
pip install mapbox
from mapbox import Uploader
u = Uploader(access_token="pk.YOUR_ACCESS_TOKEN") # handles authentication
tileset = 'soiqualang.760e11_120227e7' # name your tileset
# url = u.stage(open('hoenn_full_route2_modified.tif', 'rb', encoding='cp437', errors='ignore')) # upload happens here
url = u.stage(open('hoenn_full_route2_modified.tif', 'rb')) # upload happens here
fname='hoenn_full_route2_modified.tif'
u.create(url, tileset, name=fname) # starts the tiling job
Thêm tham số
token
access_token="pk.YOUR_ACCESS_TOKEN"
Phải vô tạo token mới có quyền upload
u = Uploader(access_token="pk.YOUR_ACCESS_TOKEN") # handles authentication
https://www.mapbox.com/account/access-tokens
https://mapbox-mapbox.readthedocs-hosted.com/en/latest/access_tokens.html
Bổ sung
param
encoding='cp437'
url = u.stage(open('hoenn_full_route2_modified.tif', encoding='cp437')) # upload happens here
Thêm mode
'rb'
url = u.stage(open('hoenn_full_route2_modified.tif', 'rb', encoding='cp437', errors='ignore'))
Bỏ các
param
`encoding='cp437', errors='ignore'
url = u.stage(open('hoenn_full_route2_modified.tif', 'rb'))
Upload thành công file 450Mb
(Vượt quá giới hạn upload qua web của mapbox
)
https://studio.mapbox.com/tilesets/soiqualang.760e11_120227e7
https://gist.github.com/robinkraft/872b85b56f7ed8551cb08908b33a224f