TkinterMapView icon indicating copy to clipboard operation
TkinterMapView copied to clipboard

Get other Tile Servers and Overlay Tile Servers to work with Registration key input to function if needed

Open nopypi opened this issue 3 years ago • 13 comments

https://wiki.openstreetmap.org/wiki/Tile_servers

It would be EXTREMELY useful if you could get many of these additional Tile Servers to work and Overlay Tile Servers. Also if you could add a function to enter in whatever registration key or whatnot in order to use these Tile Servers that require registration would be absolutely amazing.

nopypi avatar May 09 '22 19:05 nopypi

Also if there was a way to enable functionality to add the legend that these overlay tile servers provide, would be extremely useful.

nopypi avatar May 09 '22 19:05 nopypi

Which tile server is not working for you? For the ones that are not free to use, I don't know how the registration works, I think that depends on the provider. But for some providers you just pass the registration key in the url.

TomSchimansky avatar May 09 '22 19:05 TomSchimansky

This is my code of getting the tile image from the url:

url = self.tile_server.replace("{x}", str(x)).replace("{y}", str(y)).replace("{z}", str(zoom))
image = Image.open(requests.get(url, stream=True).raw)

tkintermapview/map_widget.py line 419

You can download the repository and try to modify the requests.get method and pass some sort of key you need for you're provider. But I don't know if I can build a universal method of passing registration that works for all providers.

TomSchimansky avatar May 09 '22 19:05 TomSchimansky

And how do I get a legend from a specific tile server? Do all tile servers provide a legend?

TomSchimansky avatar May 09 '22 19:05 TomSchimansky

wow that's the fastest response i've ever seen on github! I'm very interested in this stuff, so maybe i'll try to help get some of it to work here.

Tile servers you have listed that do not work for me are : They show some sort of comment error self.map_widget.set_tile_server("https://tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png") # detailed hiking self.map_widget.set_tile_server("https://tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png") # no labels

Legend: Yea I have no idea how to get that to work or import them but i'll try to look into it, would be cool.

I see, so i'll try registering for one of them and then convert their tile server they give me with that converter you showed.

Another question ... do you think it's possible to get the tile server from google earth to work? https://gis.stackexchange.com/questions/190850/tile-server-overlay-in-google-earth

Do you know how I could create an overlay map tiles to go on top of the google satellite one?

nopypi avatar May 09 '22 20:05 nopypi

I think you're correct as well the auth goes at the end. https://docs.mapbox.com/data/tilesets/guides/vector-tiles-introduction/

getting mapbox to work would open this application to a ton of elements and easy customization.

nopypi avatar May 09 '22 20:05 nopypi

More Info on how to customize mapbox stuff tile overlay: https://www.e-education.psu.edu/geog865/node/321

nopypi avatar May 09 '22 20:05 nopypi

More on creating overlay on top of google map: https://gist.github.com/donmccurdy/1d3998a37c73e9435b5503e5f37457be

nopypi avatar May 09 '22 20:05 nopypi

I will look into this, the two tile servers that don't work seem to be out of order I think.

TomSchimansky avatar May 09 '22 21:05 TomSchimansky

Tool for exporting offline maps: https://www.bluemarblegeo.com/knowledgebase/global-mapper-23/Formats/Google_Maps_Tiles.htm

nopypi avatar May 09 '22 21:05 nopypi

I will look into this, the two tile servers that don't work seem to be out of order I think.

Thanks man, yea overall I think what i'm looking at is expanding your program here to do more. A lot of it is a pipedream. I'm looking to basically import all my own symbols and provide battlelines and all that stuff for DCS (digital combat simulator) I just need to overlay stuff on top of Google Satellite one.

nopypi avatar May 09 '22 21:05 nopypi

also I found these just by going through the entire alphabet. I think you can just use a radio button to switch between one map without labels and one map with labels:

#map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=t&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google night #map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=p&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google terrain, labels #map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=r&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google broad map, labels #map_widget.set_tile_server("https://mt0.google.com/vt/lyrs=y&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22) # google satellite, labels

#map_widget.set_overlay_tile_server("https://mt0.google.com/vt/lyrs=h&hl=en&x={x}&y={y}&z={z}&s=Ga") # google label overlay

nopypi avatar May 09 '22 21:05 nopypi

I found an absolute gold mine as well !

https://github.com/geopandas/xyzservices/blob/main/provider_sources/leaflet-providers-parsed.json

TONS of tile servers ... and you can use some of them as overlay instead as well

nopypi avatar May 09 '22 22:05 nopypi