{
  "id": 6798971,
  "title": "Matching Blood Donors by GPS: The Geospatial Query Design Behind GeoBlood",
  "url": "https://urgent.news/2026/09/11/matching-blood-donors-by-gps-the-geospatial-query-design-behind",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-11T21:08:37.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/obaid03/matching-blood-donors-by-gps-the-geospatial-query-design-behind-geoblood-26dg"
  },
  "original_language": "en",
  "account": "The naive approach to matching blood donors by GPS fails in several ways. First, it scans the entire collection, resulting in poor performance as the registry grows. Second, it only considers a single blood type, disregarding other valuable donors. Finally, it sorts donors by proximity and stops, potentially missing the most suitable donor. MongoDB's 2dsphere index resolves these issues by modeling the Earth as a sphere and using a Hilbert curve to efficiently locate nearby donors within a specified radius.",
  "summary": "The naive version, and exactly how it fails Every geospatial feature starts life like this: ` js // do not ship this const donors = await Donor.find({ bloodType: 'B-', isAvailable: true }); const nearby = donors .map(d => ({ d, km: haversine(request.coords, d.coords) })) .filter(x => x.km <= 15) .sort((a, b) => a.km - b.km) .slice(0, 20); ` It works. It works on your laptop with 300 seeded…",
  "key_points": [
    "Naive approach scans entire collection, poor performance with growing registry",
    "Ignores multiple blood types, matches only single type",
    "Sorts by proximity and stops, may miss most suitable donor"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}