I'm getting an error when trying to check the population using the Java API. I did find the documentation for this error but it's not detailed enough for me to understand how to fix it.
I search for a place by name:
Code:
ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
searchCriteria.setName(candidatePlace);
List<Toponym> hits = check.getToponyms();
Then I loop through the hits list, checking whether each one is an exact name match...
Code:
if (testing.getName().equals(candidatePlace)) {...
And whether it's in a hashset of acceptable feature codes that I created...
Code:
if (acceptableClasses.contains(testing.getFeatureCode())) {...
And that all works fine. But when I want to check whether the population is big enough, seemingly in a very similar way, it doesn't work.
Code:
if (testing.getPopulation() > 10000) {...
This throws
Code:
org.geonames.InsufficientStyleException: population not supported by style MEDIUM
What is "style MEDIUM" in this context? Is there something wrong with the way I've retrieved the list of candidate Toponyms?