Skip to content

Commit bb108e4

Browse files
committed
fix: only display msid & TMA
1 parent 28b8350 commit bb108e4

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/coord_buffer_cli/utils.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def buffer_polygon(coords, buffer_size_nm):
5959
gdf = gpd.GeoDataFrame(geometry=[Polygon(coords)], crs=f"EPSG:{DEFAULT_EPSG}")
6060
gdf = gdf.to_crs(epsg=METRIC_EPSG)
6161
buffered = gdf.buffer(
62-
distance=buffer_size_nm * BUFFER_MULTIPLIER, single_sided=True, join_style=2
62+
distance=buffer_size_nm * BUFFER_MULTIPLIER,
63+
single_sided=True,
64+
join_style="mitre",
6365
)
6466
return buffered.to_crs(epsg=DEFAULT_EPSG)
6567

@@ -86,9 +88,10 @@ def read_coords(filename):
8688

8789
def list_coords_from_db():
8890
query = """
89-
SELECT typeofarea, msid, nameofarea, positionindicator
91+
SELECT msid, nameofarea
9092
FROM aip_data
91-
ORDER BY typeofarea, nameofarea, positionindicator;
93+
WHERE typeofarea = 'TMAW'
94+
ORDER BY nameofarea;
9295
"""
9396
with psycopg.connect(**DB_PARAMS) as conn:
9497
with conn.cursor() as cur:
@@ -99,9 +102,7 @@ def list_coords_from_db():
99102

100103
print(
101104
tabulate(
102-
rows,
103-
headers=["Type of Area", "MSID", "Name of Area", "ICAO"],
104-
tablefmt="pretty",
105+
rows, headers=["MSID", "TMA"], tablefmt="pretty", colalign=("left",)
105106
)
106107
)
107108
return rows

0 commit comments

Comments
 (0)