cl-geonames
A Common Lisp wrapper around the geonames web service.

Depends on: drakma, cl-json, s-xml

Repository: https://github.com/nlamirault/cl-geonames

License: LLGPL

Quick assessment (2024-10-20)

So, a few quick changes:

The secure equivalent would be, for example,

https://secure.geonames.org/timezoneJSON?lat=47.01&lng=10.2&username=demo_by_david_mullen

For metering purposes, you are advised to create a GeoNames user account:

GeoNames user account demo_by_david_mullen

After creating the account, you need to click the link to enable the free service.

Are we there yet? I'm lost and in dire need of geospatial services

For example, to search a postal code:

? (cl-geonames:geo-postal-code-search "97233" "") (:|geonames| (:|totalResultsCount| "3") (:|code| (:|postalcode| "97233") (:|name| "Portland") (:|countryCode| "US") (:|lat| "45.51421") (:|lng| "-122.49849") ((:|adminCode1| :ISO3166-2 "OR") "OR") (:|adminName1| "Oregon") (:|adminCode2| "051") (:|adminName2| "Multnomah") :|adminCode3| :|adminName3|) (:|code| (:|postalcode| "972 33") (:|name| "Luleå") (:|countryCode| "SE") (:|lat| "65.58415") (:|lng| "22.15465") ((:|adminCode1| :ISO3166-2 "BD") "BD") (:|adminName1| "Norrbotten") (:|adminCode2| "2580") (:|adminName2| "Luleå") :|adminCode3| :|adminName3|) (:|code| (:|postalcode| "97233") (:|name| "Schoelcher") (:|countryCode| "MQ") (:|lat| "14.61774") (:|lng| "-61.099") (:|adminCode1| "MQ") (:|adminName1| "Martinique") (:|adminCode2| "972") (:|adminName2| "Martinique") (:|adminCode3| "9721") (:|adminName3| "Arrondissement de Fort-de-France")))

Or, to get timezone information:

? (cl-geonames:geo-timezone "44.8391224692125" "-0.585060840409772") (:|geonames| ((:|timezone| :|tzversion| "tzdata2024a") (:|countryCode| "FR") (:|countryName| "France") (:|lat| "44.8391224692125") (:|lng| "-0.585060840409772") (:|timezoneId| "Europe/Paris") (:|dstOffset| "2.0") (:|gmtOffset| "1.0") (:|rawOffset| "1.0") (:|time| "2024-10-20 20:45") (:|sunrise| "2024-10-20 08:24") (:|sunset| "2024-10-20 19:08")))

See more examples on the project page [archived snapshot].


Topics: Geospatial, Web API