yakra / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
0 stars 0 forks source link

region_entries.sort(); #211

Open yakra opened 2 years ago

yakra commented 2 years ago

https://github.com/yakra/DataProcessing/blob/869e35c1d4c3cb729b3475619163071c3ecc8d9b/siteupdate/cplusplus/siteupdate.cpp#L565 Does this need to happen? (It does in Python because regions come from dict keys.) In C++, regions are from regions.csv and should already be sorted.

yakra commented 2 years ago
yakra commented 2 years ago

Parts of regions.csv are sorted by name rather than code. Even if it were done uniformly by code, there's no guarantee it would stay that way. E.G.:

AUS-NT;Northern Territory;AUS;OCE;Territory
AUS-NSW;New South Wales;AUS;OCE;State

Instead, kill multiple birds with one stone: Replace both Region::allregions and Region::code_hash with a std::map

yakra commented 2 years ago

std::map may or map not happen. This is worthy enough of having its own issue. Surely can't use std::sort on allregions because regions are immovable. BUT! Should be able to sort the parse_csv "meta-vector". Use a lambda!