JaroslawWiosna / regionalizer

How to choose the best capital of a state and regions? Divider into regions, especially for administrative purposes
Mozilla Public License 2.0
2 stars 2 forks source link

What is the closest city that is bigger than the specified one? #57

Closed kermit10000000 closed 6 years ago

kermit10000000 commented 6 years ago

Descrpition

Code to determin which closest city next to the determined city is the biggest so we sort the cities by distance and then choose the first one bigger than the city. Then we repeat this step until there is no bigger city left.


Release affected

Yes. It is part of the 0.3.0 release


Priority

HIGH - because it must be done before 0.3.0


Is there possible contributor who could fix the issue

Wojciech Mielczarek


JaroslawWiosna commented 6 years ago

Requirement: method like:

std::string getTheClosestCityThatIsBiggerThanMe
        (const std::vector<City>& vec, std::string cityName);

i.e.:

  1. getTheClosestCityThatIsBiggerThanMe(vec, "Zgierz"); is to return "Lodz"
  2. getTheClosestCityThatIsBiggerThanMe(vec, "Lodz"); is to return "Warszawa"
  3. getTheClosestCityThatIsBiggerThanMe(vec, "Warszawa"); is to return "" (empty string), because it is the biggest City in vector.

By biggest I mean the population NOT Area!


Please, think also about method

std::string getAllBiggestCitiesInOrder
        (const std::vector<City>& vec, std::string cityName);

i.e.:

  1. getAllBiggestCitiesInOrder(vec, "Zgierz"); is to return "Lodz Warszawa"
  2. getAllBiggestCitiesInOrder(vec, "Lodz"); is to return "Warszawa"
  3. getAllBiggestCitiesInOrder(vec, "Warszawa"); is to return "" (empty string), because it is the biggest City in vector.