osm-coverage
osm-coverage copied to clipboard
Handle country/regions with same names
trafficstars
While processing region coverage, noticed that the code does not handle duplicate names and the numbers are overwritten over a state with the same name of a different country, eg. Punjab in Pakistan and India.
@planemad I think you would want to include country + region name in the results. So for example, on the region branch, you'd need to do:
var country = findCountry(tile, countryIndex);
var state = findState(tile, stateIndex);
var resultClasses = {};
resultClasses[country] = {};
resultClasses[country][state] = {
"classified": {},
"raw": {}
};
// ....
handleRoad(ft.toGeoJSON(tile[0], tile[1], tile[2]), bbox, resultClasses[country][state]);
This will nest the state/regions under the countries, preventing collision.