-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The region matching logic fails when the region ID in the CSV and the corresponding ID in the GeoJSON include any trailing whitespace. This behavior suggests that a preprocessing step, such as whitespace trimming, is being applied to one dataset (either CSV or GeoJSON) but not both, causing the two strings to become mismatched before comparison.
In the provided example, the region ID is present in both files as "San Andres y Providencia " (note the trailing space), yet the tool reports an error.
Steps to Reproduce
-
Use the following data files:
- GeoJSON:
https://raw.githubusercontent.com/go-cart-io/cartogram-web/refs/heads/main/internal/static/cartdata/colombia/Input.json - CSV:
https://raw.githubusercontent.com/go-cart-io/cartogram-web/refs/heads/main/internal/static/cartdata/colombia/data.csv - Note: Both files contain the ID
"San Andres y Providencia "with an identical trailing space.
- GeoJSON:
-
Run the command:
cartogram-linux-amd64 Input.json data.csv --area "Population (people)" -
Observe the output (Error):
ERROR: ID San Andres y Providencia in CSV is not in GeoJSON
Expected Behavior
The tool should successfully find a match because the strings are identical:
"San Andres y Providencia " (from CSV) SHOULD MATCH "San Andres y Providencia " (from GeoJSON).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working