@mytec: feat: Phase 3.0 Architecture Refactor ✅
Major refactoring of RFCP backend: - Modular propagation models (8 models) - SharedMemoryManager for terrain data - ProcessPoolExecutor parallel processing - WebSocket progress streaming - Building filtering pipeline (351k → 15k) - 82 unit tests Performance: Standard preset 38s → 5s (7.6x speedup) Known issue: Detailed preset timeout (fix in 3.1.0)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import numpy as np
|
||||
from typing import List, Tuple, Optional
|
||||
from dataclasses import dataclass
|
||||
@@ -24,7 +25,10 @@ class StreetCanyonService:
|
||||
Loss increases at corners/turns.
|
||||
"""
|
||||
|
||||
OVERPASS_URL = "https://overpass-api.de/api/interpreter"
|
||||
OVERPASS_URLS = [
|
||||
"https://overpass-api.de/api/interpreter",
|
||||
"https://overpass.kumi.systems/api/interpreter",
|
||||
]
|
||||
|
||||
# Default street widths by type
|
||||
STREET_WIDTHS = {
|
||||
@@ -88,14 +92,24 @@ class StreetCanyonService:
|
||||
out skel qt;
|
||||
"""
|
||||
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=60.0) as client:
|
||||
response = await client.post(self.OVERPASS_URL, data={"data": query})
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
except Exception as e:
|
||||
print(f"[Streets] Fetch error: {e}")
|
||||
return []
|
||||
data = None
|
||||
max_retries = 3
|
||||
for attempt in range(max_retries):
|
||||
url = self.OVERPASS_URLS[attempt % len(self.OVERPASS_URLS)]
|
||||
try:
|
||||
timeout = 60.0 * (attempt + 1)
|
||||
async with httpx.AsyncClient(timeout=timeout) as client:
|
||||
response = await client.post(url, data={"data": query})
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"[Streets] Overpass attempt {attempt + 1}/{max_retries} failed ({url}): {e}")
|
||||
if attempt < max_retries - 1:
|
||||
await asyncio.sleep(2 ** attempt)
|
||||
else:
|
||||
print(f"[Streets] All {max_retries} attempts failed")
|
||||
return []
|
||||
|
||||
streets = self._parse_streets(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user