Boucle du Hainaut : application de réalité augmentée (v46)
PWA three.js + LocAR : pylônes et câbles de la ligne 380 kV sur le tracé projeté, à l'échelle réelle, cachés par le relief (SPW 10 m), les obstacles LiDAR (1/2/4 m) et les bâtiments OpenStreetMap. Photo avant/après, calage de la vue, mini-carte, hors-ligne complet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
3662fd4993
3571 files changed
+83668
No files matched your search
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Découpe les bâtiments OpenStreetMap (réponse Overpass JSON, `out geom tags`) en dalles de 1 km
|
||||
pour l'app AR Boucle du Hainaut (www/data/bat/).
|
||||
|
||||
Usage : python3 tools/build_building_tiles.py corridor.json www/data/bat
|
||||
|
||||
Projection : identique à l'app (équirectangulaire, R = 6371008.8 m, LAT0 = 50.6°).
|
||||
Chaque bâtiment est rangé dans la dalle qui contient le centre de son emprise.
|
||||
Hauteur : tag `height` si présent, sinon `building:levels` × 3 m + 2 m de toiture,
|
||||
sinon une valeur par défaut selon le type de bâtiment.
|
||||
Données © contributeurs OpenStreetMap, licence ODbL.
|
||||
"""
|
||||
import json, math, os, sys, re, datetime
|
||||
|
||||
R = 6371008.8
|
||||
K = math.cos(math.radians(50.6))
|
||||
TILE = 1000
|
||||
|
||||
DEFAULT_H = {
|
||||
'house': 8, 'detached': 8, 'semidetached_house': 8, 'terrace': 8, 'residential': 9, 'bungalow': 5,
|
||||
'apartments': 13, 'farm': 8, 'farm_auxiliary': 7, 'barn': 9, 'stable': 6, 'cowshed': 6,
|
||||
'garage': 3, 'garages': 3, 'carport': 3, 'shed': 3, 'hut': 3, 'greenhouse': 3, 'roof': 4, 'kiosk': 3,
|
||||
'industrial': 11, 'warehouse': 11, 'commercial': 10, 'retail': 8, 'office': 12, 'school': 10,
|
||||
'church': 20, 'chapel': 8, 'cathedral': 30, 'public': 10, 'hospital': 15, 'yes': 7,
|
||||
}
|
||||
|
||||
def proj(lon, lat):
|
||||
return R * K * math.radians(lon), R * math.radians(lat)
|
||||
|
||||
def num(v):
|
||||
m = re.match(r'\s*([0-9]+(?:[.,][0-9]+)?)', v or '')
|
||||
return float(m.group(1).replace(',', '.')) if m else None
|
||||
|
||||
def height(tags):
|
||||
h = num(tags.get('height'))
|
||||
if h and 2 <= h <= 200:
|
||||
return h
|
||||
lv = num(tags.get('building:levels'))
|
||||
if lv and 0 < lv < 60:
|
||||
return lv * 3 + 2
|
||||
return DEFAULT_H.get(tags.get('building'), 7)
|
||||
|
||||
def rings(el):
|
||||
if el['type'] == 'way' and 'geometry' in el:
|
||||
yield el['geometry']
|
||||
elif el['type'] == 'relation':
|
||||
for m in el.get('members', []):
|
||||
if m.get('role') == 'outer' and 'geometry' in m:
|
||||
yield m['geometry']
|
||||
|
||||
def main(src, out):
|
||||
data = json.load(open(src))
|
||||
tiles = {}
|
||||
n = 0
|
||||
for el in data['elements']:
|
||||
tags = el.get('tags', {})
|
||||
if tags.get('building') in (None, 'no') or tags.get('location') == 'underground':
|
||||
continue
|
||||
h = round(height(tags), 1)
|
||||
for g in rings(el):
|
||||
pts = [proj(p['lon'], p['lat']) for p in g]
|
||||
if len(pts) > 1 and pts[0] == pts[-1]:
|
||||
pts = pts[:-1]
|
||||
if len(pts) < 3:
|
||||
continue
|
||||
cx = sum(p[0] for p in pts) / len(pts); cy = sum(p[1] for p in pts) / len(pts)
|
||||
kx, ky = math.floor(cx / TILE), math.floor(cy / TILE)
|
||||
ox, oy = kx * TILE, ky * TILE
|
||||
flat = []
|
||||
for x, y in pts:
|
||||
flat += [round((x - ox) * 10), round((y - oy) * 10)] # décimètres depuis le coin SO
|
||||
t = tiles.setdefault(f'{kx}_{ky}', {'h': [], 'p': []})
|
||||
t['h'].append(h); t['p'].append(flat)
|
||||
n += 1
|
||||
os.makedirs(out, exist_ok=True)
|
||||
for f in os.listdir(out):
|
||||
if f.endswith('.json'):
|
||||
os.remove(os.path.join(out, f))
|
||||
total = 0
|
||||
for key, t in tiles.items():
|
||||
with open(os.path.join(out, key + '.json'), 'w') as fh:
|
||||
json.dump(t, fh, separators=(',', ':'))
|
||||
total += os.path.getsize(os.path.join(out, key + '.json'))
|
||||
meta = {
|
||||
'tiles': sorted(tiles), 'tileSize': TILE, 'buildings': n, 'bytes': total,
|
||||
'build': datetime.datetime.now().strftime('%Y%m%d%H%M'), # version des données (URL des dalles)
|
||||
'source': '© contributeurs OpenStreetMap (ODbL), extrait Geofabrik',
|
||||
'date': data.get('osm3s', {}).get('timestamp_osm_base') or datetime.date.today().isoformat(),
|
||||
'units': 'décimètres depuis le coin sud-ouest de la dalle, projection équirectangulaire LAT0=50.6',
|
||||
}
|
||||
with open(os.path.join(out, 'index.json'), 'w') as fh:
|
||||
json.dump(meta, fh, separators=(',', ':'), ensure_ascii=False)
|
||||
print(f'{n} bâtiments, {len(tiles)} dalles')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1], sys.argv[2])
|
||||
@@ -0,0 +1,362 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Relief LiDAR → dalles pour l'app AR Boucle du Hainaut.
|
||||
|
||||
Sources :
|
||||
- Wallonie : SPW, Relief de la Wallonie 2021-2022, MNS et MNT 1 m (GeoTIFF EPSG:3812), fichiers province
|
||||
de Hainaut téléchargés en entier (raw/lidar/*.zip). Licence CC-BY 4.0.
|
||||
- Flandre (petite partie du couloir près d'Avelgem) : Digitaal Vlaanderen, DHMV II DSM/DTM 1 m (WCS, EPSG:31370).
|
||||
Modellicentie gratis hergebruik v1.0.
|
||||
|
||||
Étape A (une fois) : lit les deux ZIP en parallèle, bande par bande, et garde pour le couloir :
|
||||
- ndsm_1m.u8 : hauteur au-dessus du sol (MNS − MNT) par pas de 0,2 m (0–50,8 m), 255 = pas de donnée ;
|
||||
- mnt_10m.f4 : altitude du terrain moyennée par carrés de 10 m.
|
||||
Étape B : dalles de 1 km dans la projection de l'app (équirectangulaire, LAT0 = 50,6°) :
|
||||
- www/data/lidar/{1m,2m,4m}/{kx}_{ky}.png : PNG gris 8 bits, valeur × 0,2 m, max des pixels sources couverts
|
||||
(prudent pour masquer), hauteurs < 1 m mises à 0 ; ligne 0 = bord nord ;
|
||||
- www/data/terrain/{kx}_{ky}.png : 100 × 100 px (10 m), altitude en décimètres = R × 256 + G.
|
||||
|
||||
Usage : python3 -I tools/build_lidar_tiles.py raw/lidar www/data [--follow]
|
||||
(--follow : les ZIP sont encore en cours de téléchargement ; on attend les octets manquants.)
|
||||
"""
|
||||
import sys, os, io, json, math, struct, time, zlib, datetime, urllib.request
|
||||
import numpy as np
|
||||
import imagecodecs, pyproj, tifffile
|
||||
from PIL import Image
|
||||
|
||||
R = 6371008.8
|
||||
K = math.cos(math.radians(50.6))
|
||||
TILE = 1000
|
||||
BUF = 3700 # m autour du tracé (couloir de 3 km + marge d'une demi-dalle)
|
||||
STEP = 0.2 # m par niveau de gris
|
||||
MIN_H = 1.0 # m : en dessous, considéré comme sol
|
||||
NODATA = 255
|
||||
X0, Y0 = 542248.5, 667581.5 # coin haut-gauche de la grille SPW 1 m (EPSG:3812)
|
||||
|
||||
WAL = pyproj.Transformer.from_crs(4326, 3812, always_xy=True)
|
||||
FLA = pyproj.Transformer.from_crs(4326, 31370, always_xy=True)
|
||||
|
||||
|
||||
def app_proj(lon, lat):
|
||||
return R * K * math.radians(lon), R * math.radians(lat)
|
||||
|
||||
|
||||
def app_unproj(X, Y):
|
||||
return np.degrees(X / (R * K)), np.degrees(Y / R)
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- couloir
|
||||
def corridor_tiles(trace):
|
||||
pts = np.array([app_proj(lo, la) for la, lo in trace])
|
||||
dense = []
|
||||
for a, b in zip(pts, pts[1:]):
|
||||
n = max(1, int(np.hypot(*(b - a)) / 50))
|
||||
for k in range(n):
|
||||
dense.append(a + (b - a) * k / n)
|
||||
dense = np.array(dense + [pts[-1]])
|
||||
kx0, ky0 = np.floor((dense.min(0) - BUF) / TILE).astype(int)
|
||||
kx1, ky1 = np.floor((dense.max(0) + BUF) / TILE).astype(int)
|
||||
keys = []
|
||||
for kx in range(kx0, kx1 + 1):
|
||||
for ky in range(ky0, ky1 + 1):
|
||||
c = np.array([(kx + 0.5) * TILE, (ky + 0.5) * TILE])
|
||||
if np.min(np.hypot(*(dense - c).T)) < 3000 + TILE * 0.71:
|
||||
keys.append((kx, ky))
|
||||
return keys
|
||||
|
||||
|
||||
def window_3812(keys):
|
||||
xs, ys = [], []
|
||||
for kx, ky in keys:
|
||||
for X in (kx * TILE, (kx + 1) * TILE):
|
||||
for Y in (ky * TILE, (ky + 1) * TILE):
|
||||
lon, lat = app_unproj(X, Y)
|
||||
x, y = WAL.transform(lon, lat)
|
||||
xs.append(x); ys.append(y)
|
||||
m = 20
|
||||
c0 = int((min(xs) - m - X0)); c1 = int(math.ceil(max(xs) + m - X0))
|
||||
r0 = int((Y0 - max(ys) - m)); r1 = int(math.ceil(Y0 - min(ys) + m))
|
||||
return r0, r1, c0, c1
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- lecture des ZIP SPW
|
||||
class GrowingFile:
|
||||
"""Fichier en cours de téléchargement : attend les octets manquants (mode --follow)."""
|
||||
def __init__(self, path, follow, done_flag):
|
||||
self.f = open(path, 'rb'); self.follow = follow; self.done_flag = done_flag
|
||||
|
||||
def read(self, n):
|
||||
while True:
|
||||
d = self.f.read(n)
|
||||
if d or not self.follow or self.done_flag():
|
||||
return d
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
def strips(path, follow=False, done_flag=lambda: True):
|
||||
"""Générateur : (index de bande, lignes float32 de la bande) d'un ZIP SPW (un BigTIFF LZW en bandes)."""
|
||||
src = GrowingFile(path, follow, done_flag)
|
||||
buf = b''
|
||||
|
||||
def need(n):
|
||||
nonlocal buf
|
||||
while len(buf) < n:
|
||||
c = src.read(1 << 20)
|
||||
if not c:
|
||||
raise EOFError(path)
|
||||
buf += c
|
||||
while True:
|
||||
need(30); assert buf[:4] == b'PK\x03\x04'
|
||||
cs = struct.unpack('<I', buf[18:22])[0]
|
||||
nl, el = struct.unpack('<HH', buf[26:30]); need(30 + nl + el)
|
||||
name = buf[30:30 + nl].decode(); extra = buf[30 + nl:30 + nl + el]
|
||||
if cs == 0xFFFFFFFF:
|
||||
p = 0
|
||||
while p < len(extra):
|
||||
hid, hs = struct.unpack('<HH', extra[p:p + 4])
|
||||
if hid == 1:
|
||||
_, cs = struct.unpack('<QQ', extra[p + 4:p + 20])
|
||||
p += 4 + hs
|
||||
buf = buf[30 + nl + el:]
|
||||
if name.lower().endswith('.tif'):
|
||||
break
|
||||
need(cs); buf = buf[cs:]
|
||||
dec = zlib.decompressobj(-15)
|
||||
U = bytearray(); base = 0
|
||||
|
||||
def fill(upto):
|
||||
nonlocal buf, base
|
||||
while base + len(U) < upto:
|
||||
if buf:
|
||||
U.extend(dec.decompress(buf)); buf = b''
|
||||
else:
|
||||
c = src.read(1 << 22)
|
||||
if not c:
|
||||
raise EOFError(path)
|
||||
U.extend(dec.decompress(c))
|
||||
|
||||
def get(off, n):
|
||||
fill(off + n); return bytes(U[off - base:off - base + n])
|
||||
fill(65536)
|
||||
h = bytes(U[:65536]); assert h[2:4] == b'+\x00'
|
||||
ifd = struct.unpack('<Q', h[8:16])[0]; n = struct.unpack('<Q', h[ifd:ifd + 8])[0]; tags = {}
|
||||
for k in range(n):
|
||||
e = h[ifd + 8 + k * 20:ifd + 28 + k * 20]
|
||||
tag, typ, cnt = struct.unpack('<HHQ', e[:12]); tags[tag] = (typ, cnt, e[12:20])
|
||||
W = struct.unpack('<I', tags[256][2][:4])[0]; H = struct.unpack('<I', tags[257][2][:4])[0]
|
||||
rps = struct.unpack('<H', tags[278][2][:2])[0]
|
||||
|
||||
def arr(tag, fmt, sz):
|
||||
typ, cnt, v = tags[tag]
|
||||
if cnt * sz <= 8:
|
||||
return struct.unpack('<%d%s' % (cnt, fmt), v[:cnt * sz])
|
||||
off = struct.unpack('<Q', v)[0]
|
||||
return struct.unpack('<%d%s' % (cnt, fmt), get(off, cnt * sz))
|
||||
tie = arr(33922, 'd', 8); offs = arr(273, 'Q', 8); sizes = arr(279, 'Q', 8)
|
||||
assert abs(tie[3] - X0) < 1e-6 and abs(tie[4] - Y0) < 1e-6, tie
|
||||
yield W, H, rps
|
||||
s = 0
|
||||
while True:
|
||||
raw = get(offs[s], sizes[s])
|
||||
d = imagecodecs.lzw_decode(raw)
|
||||
nrows = min(rps, H - s * rps)
|
||||
yield s, np.frombuffer(d, dtype='<f4')[:nrows * W].reshape(nrows, W)
|
||||
cut = offs[s] - base
|
||||
if cut > 0:
|
||||
del U[:cut]; base += cut
|
||||
s += 1
|
||||
|
||||
|
||||
def step_a(raw, work, win, follow):
|
||||
r0, r1, c0, c1 = win
|
||||
nd_path = os.path.join(work, 'ndsm_1m.u8'); mt_path = os.path.join(work, 'mnt_10m.f4')
|
||||
meta_path = os.path.join(work, 'window.json')
|
||||
if os.path.exists(meta_path) and json.load(open(meta_path)).get('win') == list(win):
|
||||
print('étape A déjà faite', flush=True); return
|
||||
rows, cols = r1 - r0, c1 - c0
|
||||
nd = np.memmap(nd_path, dtype=np.uint8, mode='w+', shape=(rows, cols))
|
||||
mt_sum = np.zeros(((rows + 9) // 10, (cols + 9) // 10), np.float64)
|
||||
mt_n = np.zeros_like(mt_sum)
|
||||
done = lambda name: (lambda: 'done' in open(os.path.join(raw, name)).read())
|
||||
gs = strips(os.path.join(raw, 'MNS_1M_HAINAUT.zip'), follow, done('dl_mns.log'))
|
||||
gt = strips(os.path.join(raw, 'MNT_1M_HAINAUT.zip'), follow, done('dl_mnt.log'))
|
||||
W, H, rps = next(gs); assert next(gt) == (W, H, rps)
|
||||
t0 = time.time()
|
||||
for (s, a), (s2, b) in zip(gs, gt):
|
||||
assert s == s2
|
||||
y_a = s * rps
|
||||
if y_a + len(a) <= r0:
|
||||
continue
|
||||
if y_a >= r1:
|
||||
break
|
||||
lo = max(r0, y_a); hi = min(r1, y_a + len(a))
|
||||
A = a[lo - y_a:hi - y_a, c0:c1]; B = b[lo - y_a:hi - y_a, c0:c1]
|
||||
ok = (A > -1000) & (B > -1000)
|
||||
h = np.where(ok, np.clip(np.round((A - B) / STEP), 0, 254), NODATA).astype(np.uint8)
|
||||
nd[lo - r0:hi - r0] = h
|
||||
# MNT 10 m : moyenne des pixels valides par carré de 10 × 10
|
||||
rr = (np.arange(lo, hi) - r0) // 10
|
||||
starts = np.arange(0, cols, 10)
|
||||
Bv = np.where(B > -1000, B, 0.0).astype(np.float64); Bn = (B > -1000).astype(np.float64)
|
||||
for k, r in enumerate(rr):
|
||||
mt_sum[r] += np.add.reduceat(Bv[k], starts); mt_n[r] += np.add.reduceat(Bn[k], starts)
|
||||
if s % 200 == 0:
|
||||
print(f' bande {s} (ligne {hi - r0}/{rows}) {time.time() - t0:.0f} s', flush=True)
|
||||
nd.flush()
|
||||
mt = np.where(mt_n > 0, mt_sum / np.maximum(mt_n, 1), np.nan).astype(np.float32)
|
||||
mt.tofile(mt_path)
|
||||
json.dump({'win': list(win), 'mnt_shape': list(mt.shape)}, open(meta_path, 'w'))
|
||||
print(f'étape A finie en {time.time() - t0:.0f} s', flush=True)
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- Flandre (WCS)
|
||||
def fla_window(coverage, x0, y0, x1, y1):
|
||||
url = ('https://geo.api.vlaanderen.be/DHMV/wcs?service=WCS&version=2.0.1&request=GetCoverage'
|
||||
f'&coverageId={coverage}&format=image/tiff&subset=x({x0},{x1})&subset=y({y0},{y1})')
|
||||
for attempt in range(2):
|
||||
try:
|
||||
data = urllib.request.urlopen(urllib.request.Request(url, headers={'User-Agent': 'bdh-ar-lidar/1.0'}), timeout=120).read()
|
||||
i = data.find(b'II*\x00')
|
||||
return tifffile.imread(io.BytesIO(data[i:])).astype(np.float32)
|
||||
except Exception as e:
|
||||
print(' WCS Flandre', coverage, e, flush=True); time.sleep(5)
|
||||
raise RuntimeError('WCS Flandre')
|
||||
|
||||
|
||||
class Flanders:
|
||||
"""nDSM et MNT 1 m flamands autour d'une dalle (chargés à la demande)."""
|
||||
def get(self, lon, lat):
|
||||
x, y = FLA.transform(lon, lat)
|
||||
x0, x1 = int(np.floor(x.min())) - 4, int(np.ceil(x.max())) + 4
|
||||
y0, y1 = int(np.floor(y.min())) - 4, int(np.ceil(y.max())) + 4
|
||||
try:
|
||||
dsm = fla_window('DHMVII_DSM_1m', x0, y0, x1, y1)
|
||||
dtm = fla_window('DHMVII_DTM_1m', x0, y0, x1, y1)
|
||||
except RuntimeError:
|
||||
return None # hors de la Flandre (autre province, France…) : pas de donnée, considéré comme sol
|
||||
ok = (dsm > -1000) & (dtm > -1000)
|
||||
nd = np.where(ok, np.clip(np.round((dsm - dtm) / STEP), 0, 254), NODATA).astype(np.uint8)
|
||||
cols = np.clip((x - x0).astype(int), 0, nd.shape[1] - 1)
|
||||
rows = np.clip((y1 - y).astype(int), 0, nd.shape[0] - 1)
|
||||
return nd, dtm, rows, cols
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- étape B
|
||||
def maxpool(a, k):
|
||||
"""Maximum glissant k × k (ancré en haut à gauche), en ignorant NODATA."""
|
||||
if k == 1:
|
||||
return a
|
||||
v = np.where(a == NODATA, 0, a)
|
||||
out = v.copy()
|
||||
for dy in range(k):
|
||||
for dx in range(k):
|
||||
if dx or dy:
|
||||
out[:v.shape[0] - dy, :v.shape[1] - dx] = np.maximum(out[:v.shape[0] - dy, :v.shape[1] - dx], v[dy:, dx:])
|
||||
out[a == NODATA] = NODATA
|
||||
return out
|
||||
|
||||
|
||||
def save_png(path, img, mode):
|
||||
buf = io.BytesIO()
|
||||
Image.fromarray(img, mode).save(buf, 'PNG', optimize=True)
|
||||
data = buf.getvalue()
|
||||
open(path, 'wb').write(data)
|
||||
return len(data)
|
||||
|
||||
|
||||
def step_b(work, out, keys, win):
|
||||
r0, r1, c0, c1 = win
|
||||
nd = np.memmap(os.path.join(work, 'ndsm_1m.u8'), dtype=np.uint8, mode='r', shape=(r1 - r0, c1 - c0))
|
||||
meta = json.load(open(os.path.join(work, 'window.json')))
|
||||
mt = np.fromfile(os.path.join(work, 'mnt_10m.f4'), dtype=np.float32).reshape(meta['mnt_shape'])
|
||||
fla = Flanders()
|
||||
build = datetime.datetime.now().strftime('%Y%m%d%H%M')
|
||||
stats = {}
|
||||
for res in (1, 2, 4):
|
||||
d = os.path.join(out, 'lidar', f'{res}m'); os.makedirs(d, exist_ok=True)
|
||||
for f in os.listdir(d):
|
||||
os.remove(os.path.join(d, f))
|
||||
stats[res] = {'tiles': [], 'bytes': 0}
|
||||
dt = os.path.join(out, 'terrain'); os.makedirs(dt, exist_ok=True)
|
||||
for f in os.listdir(dt):
|
||||
os.remove(os.path.join(dt, f))
|
||||
tstats = {'tiles': [], 'bytes': 0}
|
||||
t0 = time.time()
|
||||
for n, (kx, ky) in enumerate(keys):
|
||||
key = f'{kx}_{ky}'
|
||||
# Grille 1 m (centres de pixels), ligne 0 = nord
|
||||
i = np.arange(1000) + 0.5
|
||||
X = kx * TILE + i[None, :]; Y = (ky + 1) * TILE - i[:, None]
|
||||
lon, lat = app_unproj(np.broadcast_to(X, (1000, 1000)), np.broadcast_to(Y, (1000, 1000)))
|
||||
x, y = WAL.transform(lon, lat)
|
||||
rows = np.floor(Y0 - y).astype(int) - r0; cols = np.floor(x - X0).astype(int) - c0
|
||||
rr0, rr1 = rows.min() - 4, rows.max() + 5; cc0, cc1 = cols.min() - 4, cols.max() + 5
|
||||
win_a = np.array(nd[max(rr0, 0):rr1, max(cc0, 0):cc1])
|
||||
if rr0 < 0 or cc0 < 0:
|
||||
pad = np.full((rr1 - rr0, cc1 - cc0), NODATA, np.uint8)
|
||||
pad[max(rr0, 0) - rr0:max(rr0, 0) - rr0 + win_a.shape[0], max(cc0, 0) - cc0:max(cc0, 0) - cc0 + win_a.shape[1]] = win_a
|
||||
win_a = pad
|
||||
lr, lc = rows - rr0, cols - cc0
|
||||
need_fla = bool((win_a[lr, lc] == NODATA).any())
|
||||
fl = fla.get(lon, lat) if need_fla else None
|
||||
if need_fla:
|
||||
print(f' {key} : complété par la Flandre' if fl is not None else f' {key} : zone sans données (hors Wallonie et Flandre)', flush=True)
|
||||
for res in (1, 2, 4):
|
||||
pooled = maxpool(win_a, res)
|
||||
# pixel de sortie res m : max des res × res pixels 1 m couverts (coin nord-ouest)
|
||||
s = slice(0, 1000, res)
|
||||
img = pooled[lr[s, s], lc[s, s]]
|
||||
if fl is not None:
|
||||
fnd, _, frows, fcols = fl
|
||||
fp = maxpool(fnd, res)[frows[s, s], fcols[s, s]]
|
||||
img = np.where(img == NODATA, fp, img)
|
||||
img = np.where(img == NODATA, 0, img).astype(np.uint8)
|
||||
img[img < MIN_H / STEP] = 0
|
||||
if img.any():
|
||||
stats[res]['bytes'] += save_png(os.path.join(out, 'lidar', f'{res}m', key + '.png'), img, 'L')
|
||||
stats[res]['tiles'].append(key)
|
||||
# Terrain 10 m
|
||||
s10 = slice(5, 1000, 10)
|
||||
tr = np.clip(((Y0 - y[s10, s10]) - r0) // 10, 0, mt.shape[0] - 1).astype(int)
|
||||
tc = np.clip(((x[s10, s10] - X0) - c0) // 10, 0, mt.shape[1] - 1).astype(int)
|
||||
alt = mt[tr, tc]
|
||||
if fl is not None:
|
||||
_, fdtm, frows, fcols = fl
|
||||
fa = fdtm[frows[s10, s10], fcols[s10, s10]]
|
||||
alt = np.where(np.isnan(alt) & (fa > -1000), fa, alt)
|
||||
if not np.isnan(alt).all():
|
||||
alt = np.where(np.isnan(alt), np.nanmean(alt), alt)
|
||||
dm = np.clip(np.round(alt * 10), 0, 65535).astype(np.uint16)
|
||||
rgb = np.zeros((100, 100, 3), np.uint8); rgb[..., 0] = dm >> 8; rgb[..., 1] = dm & 255
|
||||
tstats['bytes'] += save_png(os.path.join(dt, key + '.png'), rgb, 'RGB')
|
||||
tstats['tiles'].append(key)
|
||||
if n % 25 == 0:
|
||||
print(f' dalle {n + 1}/{len(keys)} {key}{" (Flandre)" if need_fla else ""} {time.time() - t0:.0f} s', flush=True)
|
||||
src_w = ('Service public de Wallonie (SPW) - Relief de la Wallonie - MNS et MNT 1 m 2021-2022, CC-BY 4.0 '
|
||||
'(https://geodata.wallonie.be/id/e82665e2-4f89-4b7b-87a0-e77a4d4d9c5b, '
|
||||
'https://geodata.wallonie.be/id/fe13bc84-e371-46ca-9632-8ad4139f1ee5)')
|
||||
src_f = 'Bron: Digitaal Vlaanderen - DHMV II DSM/DTM 1 m (Modellicentie gratis hergebruik v1.0)'
|
||||
for res in (1, 2, 4):
|
||||
json.dump({'tiles': stats[res]['tiles'], 'tileSize': TILE, 'res': res, 'px': TILE // res, 'step': STEP,
|
||||
'minHeight': MIN_H, 'bytes': stats[res]['bytes'], 'build': build,
|
||||
'source': [src_w, src_f], 'units': 'gris × 0,2 m = hauteur au-dessus du sol (max des pixels 1 m couverts), ligne 0 = nord'},
|
||||
open(os.path.join(out, 'lidar', f'{res}m', 'index.json'), 'w'))
|
||||
print(f'{res} m : {len(stats[res]["tiles"])} dalles, {stats[res]["bytes"] / 1e6:.1f} Mo', flush=True)
|
||||
json.dump({'tiles': tstats['tiles'], 'tileSize': TILE, 'res': 10, 'px': 100, 'bytes': tstats['bytes'], 'build': build,
|
||||
'source': [src_w, src_f], 'units': 'altitude (m, DNG) × 10 = R × 256 + G, ligne 0 = nord'},
|
||||
open(os.path.join(dt, 'index.json'), 'w'))
|
||||
print(f'terrain 10 m : {len(tstats["tiles"])} dalles, {tstats["bytes"] / 1e6:.1f} Mo', flush=True)
|
||||
|
||||
|
||||
def main(raw, out, follow=False):
|
||||
trace = json.load(open(os.path.join(out, 'trace.json')))['line']
|
||||
keys = corridor_tiles(trace)
|
||||
win = window_3812(keys)
|
||||
print(f'{len(keys)} dalles, fenêtre SPW lignes {win[0]}–{win[1]}, colonnes {win[2]}–{win[3]}', flush=True)
|
||||
work = os.path.join(raw, 'work'); os.makedirs(work, exist_ok=True)
|
||||
step_a(raw, work, win, follow)
|
||||
step_b(work, out, keys, win)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = [a for a in sys.argv[1:] if not a.startswith('--')]
|
||||
main(*args, follow='--follow' in sys.argv)
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Extrait les bâtiments du couloir depuis un fichier OpenStreetMap .osm.pbf (ex. Geofabrik
|
||||
belgium-latest.osm.pbf) — bien plus rapide que les requêtes Overpass de fetch_osm_buildings.py.
|
||||
Écrit un JSON au format Overpass (`out geom tags`) lisible par build_building_tiles.py.
|
||||
|
||||
Usage : python3 tools/extract_osm_buildings_pbf.py belgium.osm.pbf www/data/trace.json corridor.json [buffer_m]
|
||||
Nécessite pyosmium (pip install osmium). Données © contributeurs OpenStreetMap (ODbL).
|
||||
"""
|
||||
import json, math, os, sys
|
||||
import osmium
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from fetch_osm_buildings import cells_for, DLAT, DLON # même couloir que la version Overpass
|
||||
|
||||
|
||||
def main(pbf, trace_path, out, buf=3000):
|
||||
line = json.load(open(trace_path))['line']
|
||||
cells = set(cells_for(line, float(buf)))
|
||||
print(f'{len(cells)} cellules', flush=True)
|
||||
elements, n = [], 0
|
||||
fp = (osmium.FileProcessor(pbf)
|
||||
.with_filter(osmium.filter.KeyFilter('building'))
|
||||
.with_areas()
|
||||
.with_filter(osmium.filter.EntityFilter(osmium.osm.AREA)))
|
||||
for a in fp:
|
||||
n += 1
|
||||
tags = dict(a.tags)
|
||||
if tags.get('building') in (None, 'no'):
|
||||
continue
|
||||
rings = []
|
||||
try:
|
||||
for r in a.outer_rings():
|
||||
rings.append([{'lat': p.lat, 'lon': p.lon} for p in r])
|
||||
except osmium.InvalidLocationError:
|
||||
continue
|
||||
if not rings:
|
||||
continue
|
||||
p0 = rings[0][0]
|
||||
if (math.floor(p0['lat'] / DLAT), math.floor(p0['lon'] / DLON)) not in cells:
|
||||
continue
|
||||
oid = a.orig_id()
|
||||
if a.from_way():
|
||||
elements.append({'type': 'way', 'id': oid, 'tags': tags, 'geometry': rings[0]})
|
||||
else:
|
||||
elements.append({'type': 'relation', 'id': oid, 'tags': tags,
|
||||
'members': [{'type': 'way', 'role': 'outer', 'geometry': g} for g in rings]})
|
||||
stamp = osmium.io.Reader(pbf, osmium.osm.osm_entity_bits.NOTHING).header().get('osmosis_replication_timestamp')
|
||||
json.dump({'osm3s': {'timestamp_osm_base': stamp}, 'elements': elements}, open(out, 'w'))
|
||||
print(f'{n} bâtiments lus, {len(elements)} dans le couloir → {out}', flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(*sys.argv[1:])
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Télécharge les bâtiments OpenStreetMap dans un couloir autour du tracé, par cellules de ~2 km
|
||||
(requêtes Overpass petites, avec relances), puis fusionne le tout en un JSON au format Overpass.
|
||||
|
||||
Usage : python3 tools/fetch_osm_buildings.py www/data/trace.json OUT_DIR [buffer_m]
|
||||
→ OUT_DIR/cells/*.json et OUT_DIR/corridor.json
|
||||
Données © contributeurs OpenStreetMap (ODbL).
|
||||
"""
|
||||
import json, math, os, sys, time, urllib.parse, urllib.request
|
||||
|
||||
SERVERS = ['https://overpass-api.de/api/interpreter', 'https://overpass.kumi.systems/api/interpreter',
|
||||
'https://overpass.private.coffee/api/interpreter']
|
||||
DLAT, DLON = 0.02, 0.03
|
||||
R = 6371008.8
|
||||
K = math.cos(math.radians(50.6))
|
||||
|
||||
def proj(lat, lon):
|
||||
return R * K * math.radians(lon), R * math.radians(lat)
|
||||
|
||||
def seg_dist(p, a, b):
|
||||
dx, dy = b[0] - a[0], b[1] - a[1]
|
||||
l2 = dx * dx + dy * dy
|
||||
t = max(0, min(1, ((p[0] - a[0]) * dx + (p[1] - a[1]) * dy) / l2)) if l2 else 0
|
||||
return math.hypot(p[0] - a[0] - t * dx, p[1] - a[1] - t * dy)
|
||||
|
||||
def cells_for(line, buf):
|
||||
pts = [proj(la, lo) for la, lo in line[::5]] + [proj(*line[-1])]
|
||||
la0, la1 = min(p[0] for p in line) - 0.05, max(p[0] for p in line) + 0.05
|
||||
lo0, lo1 = min(p[1] for p in line) - 0.07, max(p[1] for p in line) + 0.07
|
||||
out = []
|
||||
i = math.floor(la0 / DLAT)
|
||||
while i * DLAT < la1:
|
||||
j = math.floor(lo0 / DLON)
|
||||
while j * DLON < lo1:
|
||||
c = proj((i + 0.5) * DLAT, (j + 0.5) * DLON)
|
||||
d = min(seg_dist(c, pts[k], pts[k + 1]) for k in range(len(pts) - 1))
|
||||
if d < buf + 1600:
|
||||
out.append((i, j))
|
||||
j += 1
|
||||
i += 1
|
||||
return out
|
||||
|
||||
def fetch(i, j):
|
||||
s, w, n, e = i * DLAT, j * DLON, (i + 1) * DLAT, (j + 1) * DLON
|
||||
q = f'[out:json][timeout:180];(way["building"]({s},{w},{n},{e});relation["building"]({s},{w},{n},{e}););out geom tags qt;'
|
||||
data = urllib.parse.urlencode({'data': q}).encode()
|
||||
for attempt in range(12):
|
||||
url = SERVERS[attempt % len(SERVERS)]
|
||||
try:
|
||||
req = urllib.request.Request(url, data=data, headers={'User-Agent': 'bdh-ar-extract/1.0'})
|
||||
with urllib.request.urlopen(req, timeout=240) as r:
|
||||
body = r.read()
|
||||
d = json.loads(body)
|
||||
if 'remark' in d and 'error' in d['remark'].lower():
|
||||
raise RuntimeError(d['remark'][:120])
|
||||
return d
|
||||
except Exception as ex:
|
||||
print(f' cellule {i},{j} essai {attempt + 1} ({url.split("/")[2]}) : {str(ex)[:100]}', flush=True)
|
||||
time.sleep(min(60, 10 + attempt * 10))
|
||||
raise RuntimeError(f'cellule {i},{j} : échec')
|
||||
|
||||
def main(trace_path, out, buf=3000):
|
||||
line = json.load(open(trace_path))['line']
|
||||
cdir = os.path.join(out, 'cells')
|
||||
os.makedirs(cdir, exist_ok=True)
|
||||
cells = cells_for(line, float(buf))
|
||||
print(f'{len(cells)} cellules', flush=True)
|
||||
for k, (i, j) in enumerate(cells):
|
||||
f = os.path.join(cdir, f'{i}_{j}.json')
|
||||
if os.path.exists(f):
|
||||
continue
|
||||
d = fetch(i, j)
|
||||
json.dump(d, open(f, 'w'))
|
||||
print(f'[{k + 1}/{len(cells)}] {i},{j} : {len(d["elements"])} bâtiments', flush=True)
|
||||
time.sleep(2)
|
||||
seen, elements, stamp = set(), [], None
|
||||
for f in sorted(os.listdir(cdir)):
|
||||
d = json.load(open(os.path.join(cdir, f)))
|
||||
stamp = stamp or d.get('osm3s', {}).get('timestamp_osm_base')
|
||||
for el in d['elements']:
|
||||
key = (el['type'], el['id'])
|
||||
if key not in seen:
|
||||
seen.add(key); elements.append(el)
|
||||
json.dump({'osm3s': {'timestamp_osm_base': stamp}, 'elements': elements}, open(os.path.join(out, 'corridor.json'), 'w'))
|
||||
print(f'fusion : {len(elements)} bâtiments', flush=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(*sys.argv[1:])
|
||||
@@ -0,0 +1,142 @@
|
||||
"""Génère le logo (2 pylônes dans un champ, câbles correctement accrochés) en SVG."""
|
||||
import sys
|
||||
|
||||
def f(v): return f"{v:.2f}"
|
||||
|
||||
# --- géométrie d'un pylône en unités (0 = sol, 1 = sommet), x relatif à l'axe ---
|
||||
LEG = [(0.0, 0.21), (0.55, 0.075), (0.86, 0.055)] # (hauteur, demi-largeur)
|
||||
def half(h):
|
||||
for (h0, w0), (h1, w1) in zip(LEG, LEG[1:]):
|
||||
if h <= h1:
|
||||
return w0 + (w1 - w0) * (h - h0) / (h1 - h0)
|
||||
return 0.055 * (1 - (h - 0.86) / 0.14)
|
||||
|
||||
ARMS = [(0.60, 0.33), (0.80, 0.28)] # (hauteur du bras, portée)
|
||||
INS = 0.075 # longueur de la chaîne d'isolateurs
|
||||
PEAK = 1.0
|
||||
|
||||
def attach_points(base, H):
|
||||
"""Points où les câbles s'accrochent : sommet (câble de garde) + bas des 4 isolateurs."""
|
||||
bx, by = base
|
||||
pts = [(bx, by - PEAK * H)]
|
||||
for h, reach in ARMS:
|
||||
for side in (-1, 1):
|
||||
pts.append((bx + side * reach * H, by - h * H + INS * H))
|
||||
return pts
|
||||
|
||||
def pylon(base, H, color):
|
||||
bx, by = base
|
||||
P = lambda x, h: (bx + x * H, by - h * H)
|
||||
sw = max(H * 0.024, 1.3)
|
||||
out = []
|
||||
line = lambda a, b, w=sw: out.append(
|
||||
f'<line x1="{f(a[0])}" y1="{f(a[1])}" x2="{f(b[0])}" y2="{f(b[1])}" stroke-width="{f(w)}"/>')
|
||||
# jambes
|
||||
hs = [0, 0.55, 0.86]
|
||||
for s in (-1, 1):
|
||||
for h0, h1 in zip(hs, hs[1:]):
|
||||
line(P(s * half(h0), h0), P(s * half(h1), h1), sw * 1.5)
|
||||
line(P(s * half(0.86), 0.86), P(0, PEAK), sw * 1.3)
|
||||
# treillis (croisillons + traverses)
|
||||
lev = [0, 0.2, 0.38, 0.53, 0.60, 0.70, 0.80, 0.86]
|
||||
for h0, h1 in zip(lev, lev[1:]):
|
||||
line(P(-half(h0), h0), P(half(h1), h1))
|
||||
line(P(half(h0), h0), P(-half(h1), h1))
|
||||
line(P(-half(h1), h1), P(half(h1), h1))
|
||||
line(P(-half(0.86), 0.86), P(0, 0.94)); line(P(half(0.86), 0.86), P(0, 0.94))
|
||||
# bras (consoles triangulées)
|
||||
for h, reach in ARMS:
|
||||
for s in (-1, 1):
|
||||
w = half(h)
|
||||
tip = P(s * reach, h)
|
||||
line(P(s * w, h), tip, sw * 1.3) # membrure basse
|
||||
line(P(s * w, h + 0.075), tip, sw * 1.3) # membrure haute
|
||||
n = 2
|
||||
for i in range(n):
|
||||
xa = w + (reach - w) * i / n
|
||||
xb = w + (reach - w) * (i + 1) / n
|
||||
ya = h + 0.075 * (1 - i / n)
|
||||
line(P(s * xa, ya), P(s * xb, h))
|
||||
line(P(s * xb, h), P(s * xb, h + 0.075 * (1 - (i + 1) / n)))
|
||||
g = f'<g stroke="{color}" stroke-linecap="round">' + "".join(out) + "</g>"
|
||||
# isolateurs (chaîne de disques)
|
||||
ins = []
|
||||
for h, reach in ARMS:
|
||||
for s in (-1, 1):
|
||||
x, y = P(s * reach, h)
|
||||
ins.append(f'<line x1="{f(x)}" y1="{f(y)}" x2="{f(x)}" y2="{f(y + INS * H)}" '
|
||||
f'stroke="{color}" stroke-width="{f(sw)}"/>')
|
||||
ins.append(f'<rect x="{f(x - H * 0.017)}" y="{f(y + INS * H * 0.12)}" width="{f(H * 0.034)}" height="{f(INS * H * 0.8)}" rx="{f(H * 0.012)}" fill="#9fb3bf" stroke="{color}" stroke-width="{f(sw * 0.5)}"/>')
|
||||
return g + "".join(ins)
|
||||
|
||||
def cable(a, b, sag, w):
|
||||
mx, my = (a[0] + b[0]) / 2, (a[1] + b[1]) / 2 + sag
|
||||
return (f'<path d="M{f(a[0])},{f(a[1])} Q{f(mx)},{f(my)} {f(b[0])},{f(b[1])}" '
|
||||
f'fill="none" stroke="#1f2a33" stroke-width="{f(w)}" stroke-linecap="round"/>')
|
||||
|
||||
def scene():
|
||||
V = (740, 300) # point de fuite (hors cadre, à droite)
|
||||
B0, H0 = (256, 452), 295
|
||||
scales = [1.8, 1.0, 0.5, 0.25] # seul 1.0 est visible ; les autres sont hors du rond
|
||||
pyl = []
|
||||
for s in scales:
|
||||
base = (V[0] + (B0[0] - V[0]) * s, V[1] + (B0[1] - V[1]) * s)
|
||||
pyl.append((base, H0 * s))
|
||||
parts = []
|
||||
# câbles entre pylônes successifs (même point d'accroche -> même point d'accroche)
|
||||
for (b1, h1), (b2, h2) in zip(pyl, pyl[1:]):
|
||||
p1, p2 = attach_points(b1, h1), attach_points(b2, h2)
|
||||
for i, (a, b) in enumerate(zip(p1, p2)):
|
||||
span = ((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) ** 0.5
|
||||
w = 1.6 + 1.6 * (h1 + h2) / (2 * H0) * (0.75 if i == 0 else 1)
|
||||
parts.append(cable(a, b, span * 0.06, min(w, 4.2)))
|
||||
pylons = "".join(pylon(b, h, "#34444f") for b, h in [pyl[1]]) # un seul pylône, centré
|
||||
return pylons, "".join(parts)
|
||||
|
||||
def svg(maskable=False):
|
||||
S = 512
|
||||
c = 256
|
||||
R_out = 196 if maskable else 248 # bord extérieur de l'anneau rouge
|
||||
ring = R_out * 0.15
|
||||
R_in = R_out - ring
|
||||
k = R_in / 214 # la scène est dessinée pour un disque de rayon 214
|
||||
pylons, cables = scene()
|
||||
bar = ring * 0.95
|
||||
d = R_in * 0.7071
|
||||
return f'''<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {S} {S}" width="{S}" height="{S}">
|
||||
<defs>
|
||||
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#1e9bf0"/><stop offset="1" stop-color="#c6ecff"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="field" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#9ed34a"/><stop offset="1" stop-color="#5daa2c"/>
|
||||
</linearGradient>
|
||||
<clipPath id="disc"><circle cx="{c}" cy="{c}" r="{f(R_in + 1)}"/></clipPath>
|
||||
</defs>
|
||||
<rect width="{S}" height="{S}" fill="#ffffff"/>
|
||||
<g clip-path="url(#disc)">
|
||||
<g transform="translate({c} {c}) scale({f(k)}) translate(-256 -256)">
|
||||
<rect x="0" y="0" width="512" height="512" fill="url(#sky)"/>
|
||||
<g fill="#ffffff">
|
||||
<ellipse cx="380" cy="140" rx="46" ry="16"/><circle cx="366" cy="128" r="18"/><circle cx="392" cy="122" r="22"/>
|
||||
<ellipse cx="120" cy="230" rx="40" ry="13"/><circle cx="110" cy="220" r="15"/><circle cx="132" cy="214" r="18"/>
|
||||
</g>
|
||||
<path d="M0,300 C80,276 160,286 240,296 C320,280 420,274 512,290 L512,512 L0,512 Z" fill="#3f8f3a"/>
|
||||
<g fill="#2f7a31">
|
||||
<circle cx="60" cy="296" r="24"/><circle cx="90" cy="286" r="28"/><circle cx="120" cy="298" r="20"/>
|
||||
<circle cx="430" cy="290" r="16"/><circle cx="452" cy="284" r="20"/><circle cx="476" cy="292" r="16"/>
|
||||
</g>
|
||||
<path d="M0,312 C120,298 300,300 512,306 L512,512 L0,512 Z" fill="url(#field)"/>
|
||||
<path d="M0,420 C140,396 360,400 512,412 L512,512 L0,512 Z" fill="#6cbd33" opacity="0.6"/>
|
||||
{pylons}
|
||||
{cables}
|
||||
</g>
|
||||
</g>
|
||||
<circle cx="{c}" cy="{c}" r="{f(R_out - ring / 2)}" fill="none" stroke="#e30613" stroke-width="{f(ring)}"/>
|
||||
<line x1="{f(c - d)}" y1="{f(c - d)}" x2="{f(c + d)}" y2="{f(c + d)}" stroke="#e30613" stroke-width="{f(bar)}"/>
|
||||
</svg>'''
|
||||
|
||||
if __name__ == "__main__":
|
||||
out = sys.argv[1]
|
||||
open(f"{out}/logo.svg", "w").write(svg(False))
|
||||
open(f"{out}/logo-maskable.svg", "w").write(svg(True))
|
||||
@@ -0,0 +1,32 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<defs>
|
||||
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#1e9bf0"/><stop offset="1" stop-color="#c6ecff"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="field" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#9ed34a"/><stop offset="1" stop-color="#5daa2c"/>
|
||||
</linearGradient>
|
||||
<clipPath id="disc"><circle cx="256" cy="256" r="167.60"/></clipPath>
|
||||
</defs>
|
||||
<rect width="512" height="512" fill="#ffffff"/>
|
||||
<g clip-path="url(#disc)">
|
||||
<g transform="translate(256 256) scale(0.78) translate(-256 -256)">
|
||||
<rect x="0" y="0" width="512" height="512" fill="url(#sky)"/>
|
||||
<g fill="#ffffff">
|
||||
<ellipse cx="380" cy="140" rx="46" ry="16"/><circle cx="366" cy="128" r="18"/><circle cx="392" cy="122" r="22"/>
|
||||
<ellipse cx="120" cy="230" rx="40" ry="13"/><circle cx="110" cy="220" r="15"/><circle cx="132" cy="214" r="18"/>
|
||||
</g>
|
||||
<path d="M0,300 C80,276 160,286 240,296 C320,280 420,274 512,290 L512,512 L0,512 Z" fill="#3f8f3a"/>
|
||||
<g fill="#2f7a31">
|
||||
<circle cx="60" cy="296" r="24"/><circle cx="90" cy="286" r="28"/><circle cx="120" cy="298" r="20"/>
|
||||
<circle cx="430" cy="290" r="16"/><circle cx="452" cy="284" r="20"/><circle cx="476" cy="292" r="16"/>
|
||||
</g>
|
||||
<path d="M0,312 C120,298 300,300 512,306 L512,512 L0,512 Z" fill="url(#field)"/>
|
||||
<path d="M0,420 C140,396 360,400 512,412 L512,512 L0,512 Z" fill="#6cbd33" opacity="0.6"/>
|
||||
<g stroke="#34444f" stroke-linecap="round"><line x1="194.05" y1="452.00" x2="233.88" y2="289.75" stroke-width="10.62"/><line x1="233.88" y1="289.75" x2="239.78" y2="198.30" stroke-width="10.62"/><line x1="239.78" y1="198.30" x2="256.00" y2="157.00" stroke-width="9.20"/><line x1="317.95" y1="452.00" x2="278.12" y2="289.75" stroke-width="10.62"/><line x1="278.12" y1="289.75" x2="272.23" y2="198.30" stroke-width="10.62"/><line x1="272.23" y1="198.30" x2="256.00" y2="157.00" stroke-width="9.20"/><line x1="194.05" y1="452.00" x2="303.47" y2="393.00" stroke-width="7.08"/><line x1="317.95" y1="452.00" x2="208.53" y2="393.00" stroke-width="7.08"/><line x1="208.53" y1="393.00" x2="303.47" y2="393.00" stroke-width="7.08"/><line x1="208.53" y1="393.00" x2="290.43" y2="339.90" stroke-width="7.08"/><line x1="303.47" y1="393.00" x2="221.57" y2="339.90" stroke-width="7.08"/><line x1="221.57" y1="339.90" x2="290.43" y2="339.90" stroke-width="7.08"/><line x1="221.57" y1="339.90" x2="279.57" y2="295.65" stroke-width="7.08"/><line x1="290.43" y1="339.90" x2="232.43" y2="295.65" stroke-width="7.08"/><line x1="232.43" y1="295.65" x2="279.57" y2="295.65" stroke-width="7.08"/><line x1="232.43" y1="295.65" x2="277.17" y2="275.00" stroke-width="7.08"/><line x1="279.57" y1="295.65" x2="234.83" y2="275.00" stroke-width="7.08"/><line x1="234.83" y1="275.00" x2="277.17" y2="275.00" stroke-width="7.08"/><line x1="234.83" y1="275.00" x2="275.27" y2="245.50" stroke-width="7.08"/><line x1="277.17" y1="275.00" x2="236.73" y2="245.50" stroke-width="7.08"/><line x1="236.73" y1="245.50" x2="275.27" y2="245.50" stroke-width="7.08"/><line x1="236.73" y1="245.50" x2="273.37" y2="216.00" stroke-width="7.08"/><line x1="275.27" y1="245.50" x2="238.63" y2="216.00" stroke-width="7.08"/><line x1="238.63" y1="216.00" x2="273.37" y2="216.00" stroke-width="7.08"/><line x1="238.63" y1="216.00" x2="272.23" y2="198.30" stroke-width="7.08"/><line x1="273.37" y1="216.00" x2="239.78" y2="198.30" stroke-width="7.08"/><line x1="239.78" y1="198.30" x2="272.23" y2="198.30" stroke-width="7.08"/><line x1="239.78" y1="198.30" x2="256.00" y2="174.70" stroke-width="7.08"/><line x1="272.23" y1="198.30" x2="256.00" y2="174.70" stroke-width="7.08"/><line x1="234.83" y1="275.00" x2="158.65" y2="275.00" stroke-width="9.20"/><line x1="234.83" y1="252.88" x2="158.65" y2="275.00" stroke-width="9.20"/><line x1="234.83" y1="252.88" x2="196.74" y2="275.00" stroke-width="7.08"/><line x1="196.74" y1="275.00" x2="196.74" y2="263.94" stroke-width="7.08"/><line x1="196.74" y1="263.94" x2="158.65" y2="275.00" stroke-width="7.08"/><line x1="158.65" y1="275.00" x2="158.65" y2="275.00" stroke-width="7.08"/><line x1="277.17" y1="275.00" x2="353.35" y2="275.00" stroke-width="9.20"/><line x1="277.17" y1="252.88" x2="353.35" y2="275.00" stroke-width="9.20"/><line x1="277.17" y1="252.88" x2="315.26" y2="275.00" stroke-width="7.08"/><line x1="315.26" y1="275.00" x2="315.26" y2="263.94" stroke-width="7.08"/><line x1="315.26" y1="263.94" x2="353.35" y2="275.00" stroke-width="7.08"/><line x1="353.35" y1="275.00" x2="353.35" y2="275.00" stroke-width="7.08"/><line x1="238.63" y1="216.00" x2="173.40" y2="216.00" stroke-width="9.20"/><line x1="238.63" y1="193.88" x2="173.40" y2="216.00" stroke-width="9.20"/><line x1="238.63" y1="193.88" x2="206.02" y2="216.00" stroke-width="7.08"/><line x1="206.02" y1="216.00" x2="206.02" y2="204.94" stroke-width="7.08"/><line x1="206.02" y1="204.94" x2="173.40" y2="216.00" stroke-width="7.08"/><line x1="173.40" y1="216.00" x2="173.40" y2="216.00" stroke-width="7.08"/><line x1="273.37" y1="216.00" x2="338.60" y2="216.00" stroke-width="9.20"/><line x1="273.37" y1="193.88" x2="338.60" y2="216.00" stroke-width="9.20"/><line x1="273.37" y1="193.88" x2="305.98" y2="216.00" stroke-width="7.08"/><line x1="305.98" y1="216.00" x2="305.98" y2="204.94" stroke-width="7.08"/><line x1="305.98" y1="204.94" x2="338.60" y2="216.00" stroke-width="7.08"/><line x1="338.60" y1="216.00" x2="338.60" y2="216.00" stroke-width="7.08"/></g><line x1="158.65" y1="275.00" x2="158.65" y2="297.12" stroke="#34444f" stroke-width="7.08"/><rect x="153.63" y="277.65" width="10.03" height="17.70" rx="3.54" fill="#9fb3bf" stroke="#34444f" stroke-width="3.54"/><line x1="353.35" y1="275.00" x2="353.35" y2="297.12" stroke="#34444f" stroke-width="7.08"/><rect x="348.34" y="277.65" width="10.03" height="17.70" rx="3.54" fill="#9fb3bf" stroke="#34444f" stroke-width="3.54"/><line x1="173.40" y1="216.00" x2="173.40" y2="238.12" stroke="#34444f" stroke-width="7.08"/><rect x="168.38" y="218.66" width="10.03" height="17.70" rx="3.54" fill="#9fb3bf" stroke="#34444f" stroke-width="3.54"/><line x1="338.60" y1="216.00" x2="338.60" y2="238.12" stroke="#34444f" stroke-width="7.08"/><rect x="333.59" y="218.66" width="10.03" height="17.70" rx="3.54" fill="#9fb3bf" stroke="#34444f" stroke-width="3.54"/>
|
||||
<path d="M-131.20,42.60 Q62.40,124.02 256.00,157.00" fill="none" stroke="#1f2a33" stroke-width="3.28" stroke-linecap="round"/><path d="M-306.43,294.83 Q-73.89,323.88 158.65,297.12" fill="none" stroke="#1f2a33" stroke-width="3.84" stroke-linecap="round"/><path d="M44.03,294.83 Q198.69,314.53 353.35,297.12" fill="none" stroke="#1f2a33" stroke-width="3.84" stroke-linecap="round"/><path d="M-279.88,188.62 Q-53.24,240.73 173.40,238.12" fill="none" stroke="#1f2a33" stroke-width="3.84" stroke-linecap="round"/><path d="M17.48,188.62 Q178.04,232.87 338.60,238.12" fill="none" stroke="#1f2a33" stroke-width="3.84" stroke-linecap="round"/><path d="M256.00,157.00 Q377.00,207.89 498.00,228.50" fill="none" stroke="#1f2a33" stroke-width="2.50" stroke-linecap="round"/><path d="M158.65,297.12 Q303.99,315.28 449.32,298.56" fill="none" stroke="#1f2a33" stroke-width="2.80" stroke-linecap="round"/><path d="M353.35,297.12 Q450.01,309.44 546.67,298.56" fill="none" stroke="#1f2a33" stroke-width="2.80" stroke-linecap="round"/><path d="M173.40,238.12 Q315.05,270.69 456.70,269.06" fill="none" stroke="#1f2a33" stroke-width="2.80" stroke-linecap="round"/><path d="M338.60,238.12 Q438.95,265.78 539.30,269.06" fill="none" stroke="#1f2a33" stroke-width="2.80" stroke-linecap="round"/><path d="M498.00,228.50 Q558.50,253.95 619.00,264.25" fill="none" stroke="#1f2a33" stroke-width="2.05" stroke-linecap="round"/><path d="M449.32,298.56 Q521.99,307.64 594.66,299.28" fill="none" stroke="#1f2a33" stroke-width="2.20" stroke-linecap="round"/><path d="M546.67,298.56 Q595.01,304.72 643.34,299.28" fill="none" stroke="#1f2a33" stroke-width="2.20" stroke-linecap="round"/><path d="M456.70,269.06 Q527.52,285.35 598.35,284.53" fill="none" stroke="#1f2a33" stroke-width="2.20" stroke-linecap="round"/><path d="M539.30,269.06 Q589.47,282.89 639.65,284.53" fill="none" stroke="#1f2a33" stroke-width="2.20" stroke-linecap="round"/>
|
||||
</g>
|
||||
</g>
|
||||
<circle cx="256" cy="256" r="181.30" fill="none" stroke="#e30613" stroke-width="29.40"/>
|
||||
<line x1="138.20" y1="138.20" x2="373.80" y2="373.80" stroke="#e30613" stroke-width="27.93"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.3 KiB |
Reference in new issue
Block a user