| 109 | } |
| 110 | |
| 111 | void GetUSPostcodes(std::string const & filename, storage::CountryId const & countryId, |
| 112 | storage::CountryInfoGetter const & infoGetter, std::vector<m2::PointD> & valueMapping, |
| 113 | std::vector<ZipIndexValue> & keyValuePairs) |
| 114 | { |
| 115 | // * Get data source from here: https://simplemaps.com/data/us-zips |
| 116 | // "zip","lat","lng","city","state_id","state_name", ... |
| 117 | // * From Nominatim (IDK the origins) https://nominatim.org/data/us_postcodes.csv.gz |
| 118 | |
| 119 | FieldIndices usFieldIndices; |
| 120 | usFieldIndices.m_postcodeIndex = 0; |
| 121 | usFieldIndices.m_latIndex = 1; |
| 122 | usFieldIndices.m_longIndex = 2; |
| 123 | usFieldIndices.m_datasetCount = 3; // actually, there are more fields, but doesn't matter here |
| 124 | |
| 125 | // US dataset may contain complex json values, but doesn't matter for parsing first 3 entries. |
| 126 | GetPostcodes(filename, countryId, usFieldIndices, "," /* separator */, true /* hasHeader */, infoGetter, valueMapping, |
| 127 | keyValuePairs); |
| 128 | } |
| 129 | |
| 130 | bool BuildPostcodePointsImpl(FilesContainerR & container, storage::CountryId const & country, |
| 131 | indexer::PostcodePointsDatasetType type, std::string const & datasetPath, |
no test coverage detected