Thanks!
Now I tried a different query:
$ curl --get "
http://api.geonames.org/findNearby?lat=10.0&lng=10.0&username=myUsername&style=full&radius=15&maxRows=1&featureCode=PPL"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames>
<geoname>
<toponymName>Birim</toponymName>
<name>Birim</name>
<lat>10.06209</lat>
<lng>9.99703</lng>
<geonameId>2347078</geonameId>
<countryCode>NG</countryCode>
<countryName>Nigeria</countryName>
<fcl>P</fcl>
<fcode>PPL</fcode>
<fclName>city, village,...</fclName>
<fcodeName>populated place</fcodeName>
<population/>
<alternateNames>Birim</alternateNames>
<elevation>0</elevation>
<continentCode>AF</continentCode>
<adminCode1 ISO3166-2="BA">46</adminCode1>
<adminName1>Bauchi State</adminName1>
<adminCode2/>
<adminName2/>
<alternateName lang="en">Birim</alternateName>
<timezone dstOffset="1.0" gmtOffset="1.0">Africa/Lagos</timezone>
<distance>6.91183</distance>
</geoname>
</geonames>
This might be correct. Then, if I query by 5Km instead of 15Km, I would expect to get nothing as the distance of the nearest is less than 7Km:
$ curl --get "
http://api.geonames.org/findNearby?lat=10.0&lng=10.0&username=myUsername&style=full&radius=5&maxRows=1&featureCode=PPL"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames>
<geoname>
<toponymName>Birim</toponymName>
<name>Birim</name>
<lat>10.06209</lat>
<lng>9.99703</lng>
<geonameId>2347078</geonameId>
<countryCode>NG</countryCode>
<countryName>Nigeria</countryName>
<fcl>P</fcl>
<fcode>PPL</fcode>
<fclName>city, village,...</fclName>
<fcodeName>populated place</fcodeName>
<population/>
<alternateNames>Birim</alternateNames>
<elevation>0</elevation>
<continentCode>AF</continentCode>
<adminCode1 ISO3166-2="BA">46</adminCode1>
<adminName1>Bauchi State</adminName1>
<adminCode2/>
<adminName2/>
<alternateName lang="en">Birim</alternateName>
<timezone dstOffset="1.0" gmtOffset="1.0">Africa/Lagos</timezone>
<distance>0</distance>
</geoname>
</geonames>
which seems strange as the distance is now reported to be 0Km. Also, approx 50% of the times I get no result instead (which might be consistent). Maybe something I got wrong from the docs?
Thanks.
Luca