Skip to content

Commit

Permalink
Change column names
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Jun 6, 2024
1 parent bad5670 commit 26a7690
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions lidar/filling.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,35 +157,35 @@ def write_dep_csv(dep_list, csv_file):
"""
csv = open(csv_file, "w")
header = (
"region-id"
"region_id"
+ ","
+ "count"
+ ","
+ "area"
+ ","
+ "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"
+ ","
+ "eccentricity"
+ ","
+ "orientation"
+ ","
+ "area-bbox-ratio"
+ "area_bbox_ratio"
)

csv.write(header + "\n")
Expand Down Expand Up @@ -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")

Expand Down
18 changes: 9 additions & 9 deletions lidar/slicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,31 +555,31 @@ 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"
+ ","
+ "eccentricity"
+ ","
+ "orientation"
+ ","
+ "area-bbox-ratio"
+ "area_bbox_ratio"
)
csv.write(header + "\n")
for dep in dep_list:
Expand Down

0 comments on commit 26a7690

Please sign in to comment.