File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
domain/src/main/java/com/stop/domain/usecase/route Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -148,23 +148,23 @@ internal class GetLastTransportTimeUseCaseImpl @Inject constructor(
148
148
busStations : List <BusStationInfo >,
149
149
): String {
150
150
val originLongitude = correctLongitudeValue(transportIdRequest.coordinate.longitude)
151
- val originLatitude = correctLatitudeValue(transportIdRequest.coordinate.longitude )
151
+ val originLatitude = correctLatitudeValue(transportIdRequest.coordinate.latitude )
152
152
var closestStation: BusStationInfo ? = null
153
- var closestDistance = 0
153
+ var closestDistance = 0.0
154
154
155
155
busStations.filter {
156
156
it.stationName == transportIdRequest.stationName
157
157
}.map {
158
158
if (closestStation == null ) {
159
159
closestStation = it
160
- val x = abs(originLongitude - correctLongitudeValue(it.longitude))
161
- val y = abs(originLatitude - correctLatitudeValue(it.latitude))
160
+ val x = abs(originLongitude - correctLongitudeValue(it.longitude)).toDouble()
161
+ val y = abs(originLatitude - correctLatitudeValue(it.latitude)).toDouble()
162
162
closestDistance = x * x + y * y
163
163
return @map
164
164
}
165
165
166
- val x = abs(originLongitude - correctLongitudeValue(it.longitude))
167
- val y = abs(originLatitude - correctLatitudeValue(it.latitude))
166
+ val x = abs(originLongitude - correctLongitudeValue(it.longitude)).toDouble()
167
+ val y = abs(originLatitude - correctLatitudeValue(it.latitude)).toDouble()
168
168
val distance = x * x + y * y
169
169
170
170
if (distance < closestDistance) {
You can’t perform that action at this time.
0 commit comments