From 26a7690a346ebbcaa16edb51c3b3d568d656d35f Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Wed, 5 Jun 2024 20:48:27 -0400 Subject: [PATCH] Change column names --- lidar/filling.py | 18 +++++++++--------- lidar/slicing.py | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lidar/filling.py b/lidar/filling.py index 691a1ca..e2b5871 100644 --- a/lidar/filling.py +++ b/lidar/filling.py @@ -157,7 +157,7 @@ def write_dep_csv(dep_list, csv_file): """ csv = open(csv_file, "w") header = ( - "region-id" + "region_id" + "," + "count" + "," @@ -165,19 +165,19 @@ def write_dep_csv(dep_list, csv_file): + "," + "volume" + "," - + "avg-depth" + + "avg_depth" + "," - + "max-depth" + + "max_depth" + "," - + "min-elev" + + "min_elev" + "," - + "max-elev" + + "max_elev" + "," + "perimeter" + "," - + "major-axis" + + "major_axis" + "," - + "minor-axis" + + "minor_axis" + "," + "elongatedness" + "," @@ -185,7 +185,7 @@ def write_dep_csv(dep_list, csv_file): + "," + "orientation" + "," - + "area-bbox-ratio" + + "area_bbox_ratio" ) csv.write(header + "\n") @@ -376,7 +376,7 @@ def ExtractSinks( print("Converting raster to vector ...") polygonize(out_region, out_vec_file) - gdf = join_csv_to_gdf(out_vec_file, out_csv_file, "id", "region-id") + gdf = join_csv_to_gdf(out_vec_file, out_csv_file, "id", "region_id") gdf.drop(columns=["id"], inplace=True) gdf.to_file(out_gpkg, driver="GPKG") diff --git a/lidar/slicing.py b/lidar/slicing.py index d32a879..0633f2a 100644 --- a/lidar/slicing.py +++ b/lidar/slicing.py @@ -555,23 +555,23 @@ def write_dep_csv(dep_list, csv_file): + "," + "volume" + "," - + "avg-depth" + + "avg_depth" + "," - + "max-depth" + + "max_depth" + "," - + "min-elev" + + "min_elev" + "," - + "max-elev" + + "max_elev" + "," - + "children-id" + + "children_id" + "," - + "region-id" + + "region_id" + "," + "perimeter" + "," - + "major-axis" + + "major_axis" + "," - + "minor-axis" + + "minor_axis" + "," + "elongatedness" + "," @@ -579,7 +579,7 @@ def write_dep_csv(dep_list, csv_file): + "," + "orientation" + "," - + "area-bbox-ratio" + + "area_bbox_ratio" ) csv.write(header + "\n") for dep in dep_list: