Skip to content

Commit 3a97c5b

Browse files
kevinelliottclaude
andcommitted
Fetch all station polygons without limit
Removed the .slice(0, 30) limit on polygon fetches. All stations with position data now get their polygons fetched in parallel. This was causing Florida stations (rank 31+) to be missing from longer time windows where more European stations pushed them past the cutoff. Also sort by messagesWithPosition descending so stations with the richest polygon data are fetched first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fcfc81f commit 3a97c5b

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

map/src/components/map/CoverageMap.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,16 @@ export default function CoverageMap() {
110110
const fetchPolygons = useCallback(async () => {
111111
const MARINE_TYPES = new Set(['aiscatcher', 'ais']);
112112

113-
const withPosition = stations.filter((s) => {
114-
if (s.latitude === 0 && s.longitude === 0) return false;
115-
if (s.messagesWithPosition <= 0) return false;
116-
// Transport filter
117-
if (transportFilter === 'aircraft' && MARINE_TYPES.has(s.sourceType)) return false;
118-
if (transportFilter === 'marine' && !MARINE_TYPES.has(s.sourceType)) return false;
119-
return true;
120-
}).slice(0, 30);
113+
const withPosition = stations
114+
.filter((s) => {
115+
if (s.latitude === 0 && s.longitude === 0) return false;
116+
if (s.messagesWithPosition <= 0) return false;
117+
if (transportFilter === 'aircraft' && MARINE_TYPES.has(s.sourceType)) return false;
118+
if (transportFilter === 'marine' && !MARINE_TYPES.has(s.sourceType)) return false;
119+
return true;
120+
})
121+
// Sort by messagesWithPosition so stations with most polygon data are fetched first
122+
.sort((a, b) => b.messagesWithPosition - a.messagesWithPosition);
121123

122124
const polygons: CoveragePolygon[] = [];
123125

0 commit comments

Comments
 (0)