Add support for FEA

This commit is contained in:
Ian Renton
2026-08-31 09:39:05 +01:00
parent df684a601d
commit bc326388ac
15 changed files with 83 additions and 19 deletions
+3
View File
@@ -246,6 +246,9 @@ sig_ref_data_providers:
- class: "DME"
enabled: true
- class: "FEA"
enabled: true
- class: "KRMNPA"
enabled: true
+7 -1
View File
@@ -147,9 +147,15 @@ SIGS = [
SIG(
name="DME",
comment_names=["DME"],
description="Diplomas de Municipios Españoles",
description="Diploma Municipios de España",
ref_regex=r"\d{4,5}",
),
SIG(
name="FEA",
comment_names=["FEA"],
description="Diploma Faros de España",
ref_regex=r"([DE]|FEA)\-\d{4}(\.\d)?",
),
SIG(
name="DTMBA",
comment_names=["DTMBA"],
+50
View File
@@ -0,0 +1,50 @@
from io import BytesIO
from time import sleep
import pdfplumber
from data.sig_ref import SIGRef
from providers.sigrefdata.file_download_sig_ref_data_provider import FileDownloadSIGRefDataProvider
class FEA(FileDownloadSIGRefDataProvider):
"""SIG ref data provider for Diploma Faros de España"""
POLL_INTERVAL_DAYS = 30
SIG = "FEA"
DATA_URL = "http://ea5ol.net/Lista%20Faros.pdf"
def __init__(self, provider_config):
super().__init__(self.SIG, provider_config, self.DATA_URL, self.POLL_INTERVAL_DAYS)
def _http_response_to_data(self, http_response):
new_data = []
# Use PDFPlumber to extract the tables in the PDF
with pdfplumber.open(BytesIO(http_response.content)) as pdf:
all_rows = []
for page_number, page in enumerate(pdf.pages, start=1):
tables = page.extract_tables()
for table_number, table in enumerate(tables, start=1):
if not table:
continue
rows = [row for row in table if any(cell and cell.strip() for cell in row)]
all_rows.extend(rows)
for row in all_rows:
if not "REF" in row[0] and not "\n" in row[0]:
new_data.append(SIGRef(sig=self.SIG, id=row[0].strip(), name=row[1].strip(), ref_type="Lighthouse"))
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
# the data in this case
if self._stop_event.is_set():
break
# Very short pause. This will extend the time to handle sig refs by a few seconds but will ensure some time
# is available for other threads e.g. the web server.
sleep(0.001)
return new_data
+2 -1
View File
@@ -20,4 +20,5 @@ geopandas~=0.13.2
simplejson~=4.1.1
cachetools~=7.1.6
fastkml~=1.4.0
ruff~=0.16.3
ruff~=0.16.3
pdfplumber~=0.11.10
+1
View File
@@ -852,6 +852,7 @@ components:
- WAB
- WAI
- DME
- FEA
- DTMBA
- Toilets
example: POTA
+3
View File
@@ -364,6 +364,7 @@ const SIG_ICONS = {
"WAB": "fa-table-cells-large",
"WAI": "fa-table-cells-large",
"DME": "fa-building",
"FEA": "fa-house-flood-water",
"Tiles": "fa-square",
"DTMBA": "fa-masks-theater",
"Toilets": "fa-toilet"
@@ -392,6 +393,8 @@ const SIG_NAMES = {
"WWTOTA": "Towers on the Air",
"WAB": "Worked All Britain",
"WAI": "Worked All Ireland",
"DME": "Diploma Municipios de España",
"FEA": "Diploma Faros de España",
"Tiles": "Tiles on the Air",
"DTMBA": "Diploma Teatri Musei e Belle Arti",
"TOTA": "Toilets on the Air"
+2 -2
View File
@@ -102,8 +102,8 @@
on the Air (SIOTA), World Castles Award (WCA), New Zealand on the Air (ZLOTA), Keith Roget Memorial National
Parks Award (KRMNPA), South Australia National Parks and Conservation Parks Award (SANPCPA), Wainwrights on the
Air (WOTA), Beaches on the Air (BOTA), Lagos y Lagunas On the Air (LLOTA), Towers on the Air, Tiles on
the Air, Worked All Britain (WAB), Worked All Ireland (WAI), el Diploma Municipios de España (DME), Diploma
Teatri Musei e Belle Arti (DTMBA) and Toilets on the Air.</p>
the Air, Worked All Britain (WAB), Worked All Ireland (WAI), el Diploma Municipios de España (DME), el Diploma
Faros de España (FEA), il Diploma Teatri Musei e Belle Arti (DTMBA) and Toilets on the Air.</p>
<p>As of the time of writing in June 2026, I think Spothole captures essentially all outdoor radio programmes
that have a defined reference list, and almost certainly those that have a spotting/alerting API. If you know of
one I've missed, please let me know!</p>
+1 -1
View File
@@ -76,7 +76,7 @@
</div>
<script src="/static/js/add-spot.js?v=1788163223"></script>
<script src="/static/js/add-spot.js?v=1788165546"></script>
<script>$(document).ready(function () {
$("#nav-link-add-spot").addClass("active");
}); <!-- highlight active page in nav --></script>
+1 -1
View File
@@ -84,7 +84,7 @@
</div>
<script src="/static/js/alerts.js?v=1788163223"></script>
<script src="/static/js/alerts.js?v=1788165546"></script>
<script>$(document).ready(function () {
$("#nav-link-alerts").addClass("active");
}); <!-- highlight active page in nav --></script>
+2 -2
View File
@@ -76,8 +76,8 @@
</div>
<script src="/static/js/spotsbandsandmap.js?v=1788163223"></script>
<script src="/static/js/bands.js?v=1788163223"></script>
<script src="/static/js/spotsbandsandmap.js?v=1788165546"></script>
<script src="/static/js/bands.js?v=1788165546"></script>
<script>$(document).ready(function () {
$("#nav-link-bands").addClass("active");
}); <!-- highlight active page in nav --></script>
+5 -5
View File
@@ -1,6 +1,6 @@
{% extends "skeleton.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/css/style.css?v=1788163223" type="text/css">
<link rel="stylesheet" href="/static/css/style.css?v=1788165546" type="text/css">
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
@@ -15,10 +15,10 @@
window.fetchEventSource = fetchEventSource;
</script>
<script src="/static/js/utils.js?v=1788163223"></script>
<script src="/static/js/ui-ham.js?v=1788163223"></script>
<script src="/static/js/geo.js?v=1788163223"></script>
<script src="/static/js/common.js?v=1788163223"></script>
<script src="/static/js/utils.js?v=1788165546"></script>
<script src="/static/js/ui-ham.js?v=1788165546"></script>
<script src="/static/js/geo.js?v=1788165546"></script>
<script src="/static/js/common.js?v=1788165546"></script>
{% end %}
{% block body %}
<div class="container">
+1 -1
View File
@@ -284,7 +284,7 @@
</div>
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
<script src="/static/js/conditions.js?v=1788163223"></script>
<script src="/static/js/conditions.js?v=1788165546"></script>
<script>$(document).ready(function () {
$("#nav-link-conditions").addClass("active");
}); <!-- highlight active page in nav --></script>
+2 -2
View File
@@ -113,8 +113,8 @@
const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}";
</script>
<script src="/static/js/spotsbandsandmap.js?v=1788163223"></script>
<script src="/static/js/map.js?v=1788163223"></script>
<script src="/static/js/spotsbandsandmap.js?v=1788165545"></script>
<script src="/static/js/map.js?v=1788165545"></script>
<script>$(document).ready(function () {
$("#nav-link-map").addClass("active");
}); <!-- highlight active page in nav --></script>
+2 -2
View File
@@ -113,8 +113,8 @@
</div>
<script src="/static/js/spotsbandsandmap.js?v=1788163223"></script>
<script src="/static/js/spots.js?v=1788163223"></script>
<script src="/static/js/spotsbandsandmap.js?v=1788165545"></script>
<script src="/static/js/spots.js?v=1788165545"></script>
<script>$(document).ready(function () {
$("#nav-link-spots").addClass("active");
}); <!-- highlight active page in nav --></script>
+1 -1
View File
@@ -86,7 +86,7 @@
</div>
</div>
<script src="/static/js/status.js?v=1788163223"></script>
<script src="/static/js/status.js?v=1788165546"></script>
<script>
$(document).ready(function () {
$("#nav-link-status").addClass("active");