Download analytics/risk_proximity.sql from MoxieB/bsiq: direct link, hf CLI and curl.
- Browser
- Download file 713 Bytes
-
https://huggingface.co/spaces/MoxieB/bsiq/resolve/main/analytics/risk_proximity.sql
- Command line
-
hf download hf://spaces/MoxieB/bsiq/analytics/risk_proximity.sql
-
curl -L -o risk_proximity.sql https://huggingface.co/spaces/MoxieB/bsiq/resolve/main/analytics/risk_proximity.sql
713 Bytes
| -- Week 3: proximity analysis — events within 200 km of MAREA. | |
| -- Depends on bronze.usgs_raw (and optional silver.seismic_events) and MAREA geometry. | |
| -- Run in BigQuery console or via scheduled query. | |
| -- Placeholder: uncomment and adapt when Bronze and MAREA are wired. | |
| /* | |
| WITH marea AS ( | |
| SELECT ST_GEOGFROMTEXT('LINESTRING(-75.98 36.85, -2.99 43.38)') AS geom | |
| ), | |
| events_with_dist AS ( | |
| SELECT | |
| id, | |
| time, | |
| mag, | |
| lat, | |
| lon, | |
| ST_DISTANCE(ST_GEOGPOINT(lon, lat), (SELECT geom FROM marea)) / 1000 AS distance_km | |
| FROM bronze.usgs_raw | |
| ) | |
| SELECT * FROM events_with_dist WHERE distance_km <= 200; | |
| */ | |
| -- Stub for Week 1–2: show structure only. | |
| SELECT 1 AS placeholder; | |