MCPcopy Create free account
hub / github.com/comaps/comaps / GetUSPostcodes

Function GetUSPostcodes

generator/postcode_points_builder.cpp:111–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void 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
130bool BuildPostcodePointsImpl(FilesContainerR & container, storage::CountryId const & country,
131 indexer::PostcodePointsDatasetType type, std::string const & datasetPath,

Callers 1

BuildPostcodePointsImplFunction · 0.85

Calls 1

GetPostcodesFunction · 0.85

Tested by

no test coverage detected