Skip to content

Commit

Permalink
Include all columns, not just type
Browse files Browse the repository at this point in the history
  • Loading branch information
spilth committed Sep 27, 2023
1 parent 0b81819 commit ba455b3
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,38 @@ def post_merge_gpx_tracks():
app.logger.info("%i files submitted for %s output", len(files), output_format)
app.logger.info("%f kilobytes received", request.content_length / 1024)

columns = [
"name",
"cmt",
"desc",
"src",
"link1_href",
"link1_text",
"link1_type",
"link2_href",
"link2_text",
"link2_type",
"number",
"type",
"geometry",
]

merged_tracks = geopandas.GeoDataFrame(
columns=["name", "type", "geometry"], geometry="geometry"
columns=columns,
geometry="geometry",
)

for filename in files:
tracks = geopandas.read_file(filename, layer="tracks")
merged_tracks = pandas.concat(
[merged_tracks, tracks[["name", "type", "geometry"]]]
[
merged_tracks,
tracks[columns],
]
)

merged_tracks["number"] = pandas.to_numeric(merged_tracks["number"])

with tempfile.TemporaryDirectory() as temp_dir:
merged_file = Path(temp_dir) / f"merged.{extension}"

Expand Down

0 comments on commit ba455b3

Please sign in to comment.