fix: explicitly cast geometry to SRID 4326 in ST_Distance_Sphere to prevent SRID mismatch errors permanently

This commit is contained in:
Tazyeuu
2026-06-11 02:10:33 +07:00
parent 14120dc683
commit e7d437f201
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ $blankCount = $pdo->query("
WHERE NOT EXISTS (
SELECT 1
FROM rumah_ibadah ri
WHERE ST_Distance_Sphere(w.geom, ri.geom) <= ri.radius_bantuan_meter
WHERE ST_Distance_Sphere(ST_SRID(w.geom, 4326), ST_SRID(ri.geom, 4326)) <= ri.radius_bantuan_meter
)
")->fetch();
$blankSpot = (int)($blankCount['cnt'] ?? 0);