Appearantly incoherent values returned by queries

58 views
Skip to first unread message

Luca Carlon

unread,
May 6, 2013, 9:36:03 AM5/6/13
to geon...@googlegroups.com
Hi! While trying out the service I noticed this, but I can't get why it is happening. I tried to retrieve the 5 nearest places to (45.5636111, 12.1886111). I tried this first query:

http://api.geonames.org/findNearby?lat=45.5636111&lng=12.1886111&username=goose&maxRows=5&radius=5&featureCode=PPL

which returns as the fifth result "Cappella", 3.45617Km away. Then I queries this way (which I understood to be fine):

http://api.geonames.org/findNearby?lat=45.5636111&lng=12.1886111&username=goose&maxRows=5&radius=5&featureCode=PPL&featureCode=PPLA3

which returns the same sequence, with the exception of the fifth result "Casa Pontida", 3.48142Km away.
Why wasn't "Cappella" returned as the fifth entry, being closer to the point requested? Isn't the second query only supposed to return also PPLA3 places also?
Thanks!

Luca

Marc Wick

unread,
May 7, 2013, 12:28:36 AM5/7/13
to geon...@googlegroups.com
Hi Luca

Thanks, there was indeed an inconsistency. It has been fixed.

Regards

Marc
> --
> You received this message because you are subscribed to the Google
> Groups "GeoNames" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to geonames+u...@googlegroups.com.
> To post to this group, send email to geon...@googlegroups.com.
> Visit this group at http://groups.google.com/group/geonames?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Luca Carlon

unread,
May 7, 2013, 6:43:59 AM5/7/13
to geon...@googlegroups.com
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

Luca Carlon

unread,
May 10, 2013, 8:39:59 AM5/10/13
to geon...@googlegroups.com
Did something change in this regard? Cause now it seems to behave differently...
Thanks.

Luca

Marc Wick

unread,
May 11, 2013, 1:29:46 AM5/11/13
to geon...@googlegroups.com
Hi Luca

The oscillation between two different kind of results was due to the
fact that not all servers had the same code version.
Now all free api servers have the same version regarding this
functionality. Let me know if you still encounter any problems

Best Regards
> <http://groups.google.com/group/geonames?hl=en>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
Reply all
Reply to author
Forward
0 new messages