From bf19d4222658235e131c5d8fdea0161978b2ea1a Mon Sep 17 00:00:00 2001 From: Oleg Koretsky Date: Fri, 3 Nov 2023 10:45:39 +0200 Subject: [PATCH] Add workaround for Brouter GeoJSON array bug Sometimes it returns GeoJSON where some array elements are not separated by comma. --- .../track/brouter/logic/GetTrackFromBRouterWebUseCase.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ua/com/radiokot/osmanddisplay/features/track/brouter/logic/GetTrackFromBRouterWebUseCase.kt b/app/src/main/java/ua/com/radiokot/osmanddisplay/features/track/brouter/logic/GetTrackFromBRouterWebUseCase.kt index dd9abb3..eb0ff7b 100644 --- a/app/src/main/java/ua/com/radiokot/osmanddisplay/features/track/brouter/logic/GetTrackFromBRouterWebUseCase.kt +++ b/app/src/main/java/ua/com/radiokot/osmanddisplay/features/track/brouter/logic/GetTrackFromBRouterWebUseCase.kt @@ -75,7 +75,10 @@ class GetTrackFromBRouterWebUseCase( } body.string() + // Workaround for Brouter GeoJSON bug + // when some array elements are not separated by comma. + .replace("\\}\\s*\\{\\s*\"".toRegex(), "},{\"") } .toSingle() .subscribeOn(Schedulers.io()) -} \ No newline at end of file +}