Add 2023 Itasca County Leaf Off Imagery
This commit is contained in:
parent
6d81afb395
commit
c014bacf4b
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
data/plats.geojson
|
||||
satellite/
|
||||
|
|
4
Makefile
4
Makefile
|
@ -1,2 +1,6 @@
|
|||
plats.json: scripts/get_plats.py
|
||||
./scripts/get_plats.py data/plats.geojson
|
||||
|
||||
.PHONY: satellite
|
||||
satellite:
|
||||
./scripts/download_satellite.py
|
||||
|
|
9
map.html
9
map.html
|
@ -68,6 +68,15 @@
|
|||
// maxZoom: 19,
|
||||
// attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
// }).addTo(map);
|
||||
L.tileLayer('./satellite/{z}/{x}/{y}.png', {
|
||||
minNativeZoom: 12,
|
||||
maxNativeZoom: 20,
|
||||
bounds: [
|
||||
[47.517085, -93.427584],
|
||||
[47.457925, -93.340026],
|
||||
],
|
||||
}).addTo(map);
|
||||
|
||||
|
||||
// Make these requests in parallel
|
||||
const track_req_promise = fetch('data/track.geojson');
|
||||
|
|
28
scripts/download_satellite.py
Executable file
28
scripts/download_satellite.py
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell --quiet -p python3 -i python
|
||||
|
||||
# https://svc.pictometry.com/Image/D2B06344-7A2D-5BD0-FC89-DFDDC9888C41/wmts?SERVICE=WMTS&REQUEST=GetCapabilities
|
||||
|
||||
import os
|
||||
import urllib.request
|
||||
|
||||
MAX_ZOOM=20
|
||||
|
||||
current, total = 0, (4 ** (MAX_ZOOM - 11) - 1)//3
|
||||
|
||||
for z in range(12, MAX_ZOOM+1):
|
||||
scale = 2 ** (z - 12)
|
||||
start_x = 985 * scale
|
||||
start_y = 1432 * scale
|
||||
for x in range(start_x, start_x + scale):
|
||||
for y in range(start_y, start_y + scale):
|
||||
current += 1
|
||||
progress = f"[{current:0{len(str(total))}d}/{total}]"
|
||||
url = f"https://svc.pictometry.com/Image/D2B06344-7A2D-5BD0-FC89-DFDDC9888C41/wmts/PICT-MNITAS23-EDVs7UTOVt/default/GoogleMapsCompatible/{z}/{x}/{y}.png"
|
||||
file = os.path.normpath(os.path.join(os.path.dirname(__file__), f"../satellite/{z}/{x}/{y}.png"))
|
||||
os.makedirs(os.path.dirname(file), exist_ok=True)
|
||||
if os.path.isfile(file):
|
||||
print(f"{progress} {file} already exists; skipping")
|
||||
continue
|
||||
print(f"{progress} downloading {file}")
|
||||
urllib.request.urlretrieve(url, file)
|
Loading…
Reference in a new issue