From df8a001203e9e936ae5bae4e06f5631d87fb3ada Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 22 May 2022 20:31:19 +0200 Subject: Geodata - geo forms: new forms - many adaptations --- ishtar_common/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ishtar_common/utils.py') diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 3202afede..2a41ab0aa 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -2355,3 +2355,11 @@ def get_eta(current, total, base_time, current_time): if eta < 1: return "-" return f"{int(eta // 3600):02d}:{int(eta % 3600 // 60):02d}:{int(eta % 60):02d}" + + +RE_NUMBER = r"[+-]?\d+(?:\.\d*)?" +RE_COORDS = r"(" + RE_NUMBER + r") (" + RE_NUMBER + r")" + + +def reverse_coordinates(wkt): + return re.sub(RE_COORDS, r"\2 \1", wkt) -- cgit v1.2.3