From 772636df63f3fad1f5c30b623ea1a5b003495353 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 01:00:16 +0000 Subject: [PATCH] =?UTF-8?q?=E8=BF=91=E5=82=8D=E3=83=90=E3=82=B9=E5=81=9C?= =?UTF-8?q?=E3=81=AE=E7=B5=9E=E3=82=8A=E8=BE=BC=E3=81=BF=E3=82=92=E4=BB=B6?= =?UTF-8?q?=E6=95=B0=E3=81=AE=E4=B8=8A=E9=99=90=E3=82=88=E3=82=8A=E5=85=88?= =?UTF-8?q?=E3=81=AB=E8=A1=8C=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_bus_stops_near_stations は半径以内のバス停を距離順に limit_per_station 件へ切り詰めてから、路線を引けるか (かつ路線が有効か) を見ていた。移行前の SQL が LATERAL 側で LIMIT を掛けてから lines を JOIN していたのをそのまま 写したものだが、路線を引けないバス停や廃止路線のバス停が上限の枠を埋めると、 その分だけ採用件数が減る。 先に路線で絞り、有効なものが limit_per_station 件そろった時点で打ち切る。 座標の順・距離順という並びは変わらない。 あわせて index::within_radius と docs/nearby-bus-stops.md の、絞り込みと 上限の順序を述べた記述を実装に合わせた。 --- docs/nearby-bus-stops.md | 2 +- src/index.rs | 2 +- src/repository.rs | 30 ++++++++++++++---------------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/docs/nearby-bus-stops.md b/docs/nearby-bus-stops.md index b99c87ae..6f370751 100644 --- a/docs/nearby-bus-stops.md +++ b/docs/nearby-bus-stops.md @@ -125,5 +125,5 @@ async fn get_nearby_bus_lines(&self, ref_lat: f64, ref_lon: f64) -> Result