diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-05-22 20:31:19 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:21:00 +0100 |
commit | df8a001203e9e936ae5bae4e06f5631d87fb3ada (patch) | |
tree | b7bece5905a4a433cbde9132bec669669f1c8ea0 /ishtar_common/utils.py | |
parent | 3ff82007369b115406c2f2effbdfb13188167bb7 (diff) | |
download | Ishtar-df8a001203e9e936ae5bae4e06f5631d87fb3ada.tar.bz2 Ishtar-df8a001203e9e936ae5bae4e06f5631d87fb3ada.zip |
Geodata - geo forms: new forms - many adaptations
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
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) |