Skip to content

Fix undefined values in lake CSV filenames #219

Description

@igarousi

Describe the bug
CSV filenames currently use the same naming convention for both rivers and lake data.
filename = ${featureType}_${riverName}_${reachId}_${startTime}_${endTime}

This works for river data, but lake features do not have rivername or reachid fields. As a result, lake downloads can produce filenames such as: priorlake_undefined_undefined_2023_03_01t00_00_00z_2026_08_11t16_34_28z.csv

For your reference: Lake support was added after the original river-data implementation, but the filename construction logic was not updated to account for lake-specific fields.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://swotviz.cuahsi.io
  2. Click on a lake
  3. Generate a plot
  4. Download the data as a CSV

Expected behavior
The filename for lake downloads should be: <featureType>_<lakeName>_<lakeId>_<startTime>_<endTime>.csv
The lake name is already included in the downloaded csv. The lake ID is available in the app's metadata table after a lake is selected.

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions