mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-10-02 15:39:03 +02:00
Merge pull request #1179 from fabi321/double-point-cleanup
This commit is contained in:
commit
bf1df8d6df
1 changed files with 17 additions and 1 deletions
|
@ -120,6 +120,20 @@ def remove_extras(entry: dict):
|
||||||
|
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
|
def remove_duplicate_points(entry: dict):
|
||||||
|
"""
|
||||||
|
Removes points from paths that occur twice after each other
|
||||||
|
"""
|
||||||
|
path: list = entry['path']
|
||||||
|
previous: list = path[0]
|
||||||
|
for i in range(len(path)-1, -1, -1):
|
||||||
|
current: list = path[i]
|
||||||
|
if current == previous:
|
||||||
|
path.pop(i)
|
||||||
|
previous = current
|
||||||
|
|
||||||
|
return entry
|
||||||
|
|
||||||
def fix_r_caps(entry: dict):
|
def fix_r_caps(entry: dict):
|
||||||
"""
|
"""
|
||||||
Fixes capitalization of /r/. (/R/place -> /r/place)
|
Fixes capitalization of /r/. (/R/place -> /r/place)
|
||||||
|
@ -298,7 +312,9 @@ def print_(*args, **kwargs):
|
||||||
entry = fix_no_protocol_urls(entry)
|
entry = fix_no_protocol_urls(entry)
|
||||||
print_("Removing extras...")
|
print_("Removing extras...")
|
||||||
entry = remove_extras(entry)
|
entry = remove_extras(entry)
|
||||||
print_("Updating center")
|
print_("Removing duplicate points...")
|
||||||
|
entry = remove_duplicate_points(entry)
|
||||||
|
print_("Updating center...")
|
||||||
entry = update_center(entry)
|
entry = update_center(entry)
|
||||||
print_("Validating...")
|
print_("Validating...")
|
||||||
status_code = validate(entry)
|
status_code = validate(entry)
|
||||||
|
|
Loading…
Reference in a new issue