VATGER-Nav / mapbuilder

A generation utility for EuroScope Ground Radar and TopSky maps and settings using AIXM and KML
MIT License
3 stars 1 forks source link

ECL: Possibility to create Marker ticks asymmetric #8

Open sergej-singer opened 1 month ago

sergej-singer commented 1 month ago

In cases, when 2 parallel runways are too close to each other, would be more pleasing to draw Marker tick only on the outer sides of the runways, like that: image

sergej-singer commented 1 month ago

Possible implementation by me:

def draw_marker_ticks(rwy_info, at: list, gap: float, length: float, side: int = 0):
    #side: 0 = both, 1 = left, 2 = right

    lines = []
    brg = Brg(rwy_info["bearing"]).invert()
    tick_brg = brg + 90
    for dist in at:
        base = Fix(rwy_info["thr"]).move_to(dist, brg)

        if side == 0:
            lines.extend((str(base.move_to(gap, tick_brg).line_to(length, tick_brg)),
                        str(base.move_to(-gap, tick_brg).line_to(-length, tick_brg))))
        elif side == 1:
            lines.append(str(base.move_to(gap, tick_brg).line_to(length, tick_brg)))
        elif side == 2:
            lines.append(str(base.move_to(-gap, tick_brg).line_to(-length, tick_brg)))
        else:
            msg = f"The value for side can be only 0, 1 or 2. {side} is unknown"
            raise ValueError(msg)

    return "\n".join(lines)
hannesaltmann commented 1 week ago

+1 We would appreciate having this option to generate realistic centerlines at EDDB.