Catch the edge case where a space is returned both as an Erfa and a Chaostreff by SMW
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
1e74b33477
commit
aa842979e9
1 changed files with 15 additions and 9 deletions
|
@ -560,15 +560,6 @@ def create_svg(ns, bbox):
|
||||||
ts.append((xt*scalex - origin[0], origin[1] - yt*scaley))
|
ts.append((xt*scalex - origin[0], origin[1] - yt*scaley))
|
||||||
shapes_countries.append((name, ts))
|
shapes_countries.append((name, ts))
|
||||||
|
|
||||||
chaostreffs = {}
|
|
||||||
with open(ns.cache_directory.chaostreff_info, 'r') as f:
|
|
||||||
ctdata = json.load(f)
|
|
||||||
for city, location in ctdata.items():
|
|
||||||
if location is None:
|
|
||||||
continue
|
|
||||||
xt, yt = transformer.transform(*location)
|
|
||||||
chaostreffs[city] = (xt*scalex - origin[0], origin[1] - yt*scaley)
|
|
||||||
|
|
||||||
erfas = {}
|
erfas = {}
|
||||||
with open(ns.cache_directory.erfa_info, 'r') as f:
|
with open(ns.cache_directory.erfa_info, 'r') as f:
|
||||||
ctdata = json.load(f)
|
ctdata = json.load(f)
|
||||||
|
@ -578,6 +569,21 @@ def create_svg(ns, bbox):
|
||||||
xt, yt = transformer.transform(*location)
|
xt, yt = transformer.transform(*location)
|
||||||
erfas[city] = (xt*scalex - origin[0], origin[1] - yt*scaley)
|
erfas[city] = (xt*scalex - origin[0], origin[1] - yt*scaley)
|
||||||
|
|
||||||
|
chaostreffs = {}
|
||||||
|
with open(ns.cache_directory.chaostreff_info, 'r') as f:
|
||||||
|
ctdata = json.load(f)
|
||||||
|
for city, location in ctdata.items():
|
||||||
|
if location is None:
|
||||||
|
continue
|
||||||
|
if city in erfas:
|
||||||
|
# There is an edge case where when a space changed states between Erfa and Chaostreff, the
|
||||||
|
# Semantic MediaWiki engine returns this space as both an Erfa and a Chaostreff, resulting
|
||||||
|
# in glitches in the rendering. As a workaround, here we simply assume that it's an Erfa.
|
||||||
|
continue
|
||||||
|
xt, yt = transformer.transform(*location)
|
||||||
|
chaostreffs[city] = (xt*scalex - origin[0], origin[1] - yt*scaley)
|
||||||
|
|
||||||
|
|
||||||
rectbox = [0, 0, svg_box[0], svg_box[1]]
|
rectbox = [0, 0, svg_box[0], svg_box[1]]
|
||||||
for name, shape in shapes_states + shapes_countries:
|
for name, shape in shapes_states + shapes_countries:
|
||||||
for lon, lat in shape:
|
for lon, lat in shape:
|
||||||
|
|
Loading…
Reference in a new issue