Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix projsync --list-files CSV header #3552

Merged
merged 1 commit into from
Jan 12, 2023
Merged

fix projsync --list-files CSV header #3552

merged 1 commit into from
Jan 12, 2023

Conversation

visr
Copy link
Contributor

@visr visr commented Jan 12, 2023

Running projsync --list-files returns CSV data like this:

filename,source_id,area_of_use,file_size
at_bev_README.txt,,at_bev,3200
at_bev_AT_GIS_GRID.tif,Austria,at_bev,216878

The column order of the header and data don't match, source_id and area_of_use are swapped. We could swap either the header or the data, in this PR I'm swapping the header.

Here you can see the order of the data:

PROJ/src/apps/projsync.cpp

Lines 608 to 626 in c637eff

if (!queriedSourceId.empty() && !foundMatchSourceIdCriterion) {
std::cerr << "Warning: '" << queriedSourceId
<< "' is a unknown value for --source-id." << std::endl;
std::cerr << "Known values are:" << std::endl;
for (const auto &v : source_ids) {
std::cerr << " " << v << std::endl;
}
std::exit(1);
}
if (!queriedAreaOfUse.empty() && !foundMatchAreaOfUseCriterion) {
std::cerr << "Warning: '" << queriedAreaOfUse
<< "' is a unknown value for --area-of-use." << std::endl;
std::cerr << "Known values are:" << std::endl;
for (const auto &v : areas_of_use) {
std::cerr << " " << v << std::endl;
}
std::exit(1);
}

@rouault rouault merged commit 6422f0c into OSGeo:master Jan 12, 2023
@rouault
Copy link
Member

rouault commented Jan 12, 2023

thanks

@visr visr deleted the patch-1 branch January 12, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants