flopp / py-staticmaps

A python module to create static map images with markers, geodesic lines, etc.
MIT License
128 stars 17 forks source link

Line: Large Distance over IDL causes problem #37

Closed Jxck-S closed 3 months ago

Jxck-S commented 5 months ago

Mapping a line over the IDL with a significant distance causes the following problem. image

Code used to create, this occurs with Pillow and cairo. SVG not tested

jfk = (40.641766, -73.780968)
hong_kong_airport_coordinates = (22.308046, 113.918480)
first = staticmaps.create_latlng(jfk[0], jfk[1])
sec = staticmaps.create_latlng(hong_kong_airport_coordinates[0], hong_kong_airport_coordinates[1])
line = staticmaps.Line([first, sec])
static_map_context.add_object(line)

image = static_map_context.render_pillow(1920, 1080, attribution=False)
image.save("testproblem"+".png")
Jxck-S commented 5 months ago

You can see the X/y's being output are not connecting properly image

Jxck-S commented 5 months ago

Bug Bountied this. https://x.com/jxck_sweeney/status/1757647752224211074?s=46&t=FtgP2n3lVDy-7UKDHwqlcQ

@FailSpy please contact me as it seems you fixed it. JackHSweeney@protonmail.com

FailSpy commented 5 months ago

@Jxck-S Joined the Ground Control server as FailSpy on Discord. Will reach out to you there.

flopp commented 3 months ago

Fixed by #38 38