# HG changeset patch # User Andrew # Date 1663059420 14400 # Tue Sep 13 04:57:00 2022 -0400 # Node ID e2014747c2c3386a50db30dc3fadd34c21edd3ba # Parent 315fb9054556891f5e6fa1f324a70193e7e69724 Don't return null for pop figures, but a dummy figure, if there aren't any available. Tweak lat/lon adjustment. For EEIII I should really make a formula based on the curvature of the Earth and the map, as these tweaks are hacky, but this is good enough for now. diff --git a/src/main/java/DBObjects/CityDB.java b/src/main/java/DBObjects/CityDB.java --- a/src/main/java/DBObjects/CityDB.java +++ b/src/main/java/DBObjects/CityDB.java @@ -118,14 +118,22 @@ if (beforeOrAfter == TimePreference.BEFORE) { if (closestBefore != null) return new AnnualPopFigure(closestBefore); - else + else if (closestAfter != null) return new AnnualPopFigure(closestAfter); //couldn't find on or before, give the closest we've got + else { + logger.warn("Could not find pop figures for " + this.name); + return new AnnualPopFigure(year, 100); //not available + } } else { if (closestAfter != null) return new AnnualPopFigure(closestAfter); - else + else if (closestBefore != null) return new AnnualPopFigure(closestBefore); //couldn't find on or after, give the closest we've got + else { + logger.warn("Could not find pop figures for " + this.name); + return new AnnualPopFigure(year, 100); //not available + } } } diff --git a/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java b/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java --- a/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java +++ b/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java @@ -68,12 +68,15 @@ if (city.getCountry().getName().equals("Portugal")) { this.cORDS = new CORDS(city.getLongitude() + 0.15, city.getLatitude() - 0.125); } - else if (city.getCountry().getName().equals("United Kingdom")) { + else if (city.getCountry().getName().equals("United Kingdom") && !city.getName().equals("Valletta")) { this.cORDS = new CORDS(city.getLongitude() + 0.1, city.getLatitude() - 0.2); } else if (city.getCountry().getName().equals("Spain")) { this.cORDS = new CORDS(city.getLongitude(), city.getLatitude() - 0.2); } + else if (city.getCountry().getName().equals("Netherlands") || city.getCountry().getName().equals("Belgium")) { + this.cORDS = new CORDS(city.getLongitude() - 0.2, city.getLatitude() - 0.3); + } else { this.cORDS = new CORDS(city.getLongitude() - 0.1, city.getLatitude() - 0.2); }