I've been having a lot of fun over the last few days playing the map puzzles created by the Map Puzzle Factory. However I have been a little frustrated by the Japanese place-names used in the puzzles. I therefore decided to try to create my own map jigsaw puzzle using a map in which the place-names are displayed in English.
My Scrambled City game is a simple map of the City of London. Press the 'Scramble' button and all the map-tiles will be scrambled. All you have to do then is re-arrange the map-tiles and put them back in their correct positions.
If you want to create your own version of the map you just need to remix the Glitch page of my Scrambled City game and change the 25 map-tile URLs to the OSM map-tiles for the part of the world which you wish to map.
My map consists of 25 scrambled OpenStreetMap map-tiles. To download the URLs automatically for an area I wrote a little Python script to grab the map-tile image addresses from OpenStreetMap:
def generate_tile_urls(x_start, y_start, z, num_tiles=5):If you want to create your own map you can adjust the x_start and y-start coordinates in this Python script. This will allow you to download the map-tile URLs for a 5x5 grid starting at your preferred position.
base_url = "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
urls = []
for x in range(x_start, x_start + num_tiles):
for y in range(y_start, y_start + num_tiles):
url = base_url.format(z=z, x=x, y=y)
urls.append(url)
return urls
x_start = 32748 # starting x-coordinate
y_start = 21787 # starting y-coordinate
z = 16 # zoom level
tile_urls = generate_tile_urls(x_start, y_start, z)
for url in tile_urls:
print(url)
https://tile.openstreetmap.org/{z}/{x}/{y}.png
No comments:
Post a Comment