sysoppl / Cities-Skylines-heightmap-generator

A heightmap generator for Cities: Skylines
https://heightmap.skydark.pl/
176 stars 53 forks source link

Vector Tiles | MapBox exceed API requests - self host instead #21

Closed sysoppl closed 1 week ago

sysoppl commented 3 years ago

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

PLEASE REFRESH WEBSITE IF IT SHOWS NO MAP!

sysoppl commented 3 years ago

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

sysoppl commented 3 years ago

For now I will continue to host this service

nonta1234 commented 3 years ago

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

nonta1234 commented 3 years ago

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.

sysoppl commented 3 years ago

Hey, thank you for your effort!

sysoppl commented 2 years ago

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 commented 2 years ago

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

nonta1234 commented 2 years ago

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.

sysoppl commented 2 years ago

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

nonta1234 commented 2 years ago

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

sysoppl commented 2 years ago

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

nonta1234 commented 2 years ago

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.

sysoppl commented 2 years ago

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 commented 2 years ago

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

123ysys commented 6 months ago

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?

sixeyeco commented 2 weeks ago

Instructions to host it yourself: https://pinter.org/archives/15848

It worked for quite a while until the map generator code itself broke.... https://github.com/sysoppl/Cities-Skylines-heightmap-generator/issues/110

But, by the time "you" read this the Map code here might be working again.

sysoppl commented 1 week ago

fixed:

I tested this quickly and looks like everything is working and I'm able to download maps. If any issues occur please open new issue.