From df23fa6320d23558cc8ba169bae408049e79d283 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Wed, 4 Sep 2024 11:46:38 +0800 Subject: [PATCH] Change python example from Toner to Terrarium tiles on AWS [#440] (#441) --- python/examples/create_raster_example.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/python/examples/create_raster_example.py b/python/examples/create_raster_example.py index ea9bde0..8725549 100644 --- a/python/examples/create_raster_example.py +++ b/python/examples/create_raster_example.py @@ -6,17 +6,13 @@ from pmtiles.writer import Writer acc = 0 -with open("stamen_toner_maxzoom3.pmtiles", "wb") as f: +with open("terrarium_z0-3.pmtiles", "wb") as f: writer = Writer(f) for tileid in range(0, zxy_to_tileid(4, 0, 0)): acc += 1 z, x, y = tileid_to_zxy(tileid) - req = Request(f"https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png") - req.add_header( - "User-Agent", - "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0", - ) + req = Request(f"https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png") with urlopen(req) as f: writer.write_tile(tileid, f.read()) @@ -35,6 +31,6 @@ with open("stamen_toner_maxzoom3.pmtiles", "wb") as f: "center_lat_e7": 0, }, { - "attribution": 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.' + "attribution": 'Tilezen Joerd: Attribution' }, )