Cities-Skylines-heightmap-generator icon indicating copy to clipboard operation
Cities-Skylines-heightmap-generator copied to clipboard

Vector Tiles | MapBox exceed API requests - self host instead

Open sysoppl opened this issue 3 years ago • 15 comments

We are using free tier of MapBox API, and it has limits which now exceeds.

PLEASE REFRESH WEBSITE IF IT SHOWS NO MAP!

sysoppl avatar Sep 20 '21 08:09 sysoppl

MapBox is now charging me for API requests which is not good image

sysoppl avatar Sep 20 '21 08:09 sysoppl

For now I will continue to host this service

sysoppl avatar Sep 20 '21 08:09 sysoppl

I'm not sure if it's good, but I suggest using multiple people's tokens.

nonta1234 avatar Sep 24 '21 01:09 nonta1234

Hi sysoppl I'm trying to avoid making requests to the API by caching the downloaded Vector Tiles and loading it from the cache next time.

nonta1234 avatar Sep 26 '21 06:09 nonta1234

Hey, thank you for your effort!

sysoppl avatar Sep 26 '21 09:09 sysoppl

image image

This is very big issue right now. I might close this project due to too much api requests it is generating now. Waiting for any feedback from you guys

sysoppl avatar Oct 13 '21 08:10 sysoppl

https://github.com/maputnik/osm-liberty https://github.com/openmaptiles/openmaptiles

These two seems to be good to get rid of mapbox. Any help with implementing them will be great

sysoppl avatar Oct 13 '21 10:10 sysoppl

Hi The fact that many requests despite the built-in cache control means that users are often downloading new regions. After all, I think that it is necessary to create a mirror site with another access token or replace the access token regularly.

nonta1234 avatar Oct 13 '21 10:10 nonta1234

I just created 4 tokens that will be used for one week, but that's not ideal - it will be painful to create new mail every month... I just found self-hosted solution (https://github.com/sysoppl/Cities-Skylines-heightmap-generator/issues/21#issuecomment-942142427), but IDK if it can be implemented - so help wanted :)

I can host everything - I've got plenty of space and power on new server

sysoppl avatar Oct 13 '21 10:10 sysoppl

Oh...that's true. Would you like to stop using vector tiles and consider using OSM?

nonta1234 avatar Oct 13 '21 10:10 nonta1234

If that is possible - yes. As I read in https://github.com/openmaptiles/openmaptiles I can create vector tiles for all globe with docker, so it should be easy for me as I mainly use docker and selfhost everything. Next question is how to use these files with this heightmap generator

sysoppl avatar Oct 13 '21 10:10 sysoppl

Vector Tiles are only used to extract the water area, so you don't currently need files for all layers.

http://hydro.iis.u-tokyo.ac.jp/~yamadai/OSM_water/v2.0_2021Feb/OSM_WaterLayer.pbf

Because the size is too large as it is, if you can tiling the data on the above sites, you can manage it in a smaller size. I don't know the difference between OSM data and Mapbox Vector Tile specifications, but I can load it as long as I have tiles.

nonta1234 avatar Oct 13 '21 11:10 nonta1234

So i generated some tiles and will upload here later, what else can I do, any ideas? Map is not working again, so this need to be implemented asap

sysoppl avatar Oct 22 '21 06:10 sysoppl

Map was not working again, so another API key was send to trash

Here are tiles generated by openmaptiles (https://github.com/openmaptiles/openmaptiles): https://heightmap.skydark.pl/tiles.zip

sysoppl avatar Oct 22 '21 15:10 sysoppl

Seems that the API cost is a huge problem to site owner. I just registered my mapbox account and is going to self-hosting. How can I replica your website on my windows 10?

123ysys avatar Apr 04 '24 11:04 123ysys