map::geocode::nominatim(3tcl)
π NAME π
map::geocode::nominatim β bestie, this is the one that resolves geographical names using a Nominatim service πΊοΈβ¨
β¨ SYNOPSIS β¨
package require Tcl 8.6 9
package require http
package require json
package require uri
package require snit
package require map::geocode::nominatim ?0.3?
::map::geocode::nominatim requestor ?-baseurl url? ?-callback callback? ?-error error callback?
$cmdprefix result
$cmdprefix errorstring
requestor search query
πΈ DESCRIPTION πΈ
Okay so listen π«Ά this package hands you a whole class for talking to geocoding services β but specifically the ones that speak the Nominatim interface (peep the References if you wanna go read up on it, iykyk).
π API π
β¨ OPTIONS β¨
::map::geocode::nominatim requestor ?-baseurl url? ?-callback callback? ?-error error callback?β this bad boy creates a geocoding request object named requestor, and that object is gonna be sending all its requests over to the Nominatim server. The result of the command isname. slay.-baseurl urlβ the base URL of the Nominatim service, no cap. The default value is OpenStreetMap's service athttp://nominatim.openstreetmap.org/searchπ. A possible free alternative lives athttp://open.mapquestapi.com//nominatim/v1/search(yes that double slash is really in there, don't @ me, I'm just the messenger π).-callback cmdprefixβ a command prefix that gets invoked when search results become available. The default setting (which is active when you didn't specify anything at object creation) is to print the result (see below) to stdout. The result of the command prefix is ignored, lowkey. Errors thrown by the command prefix get caught, and they cause the invocation of the error callback (see option-errorbelow), with the error message as the argument.
The signature of the command prefix is:
$cmdprefix result
So the result is a list of dictionaries, one item per hit π―. Each dictionary will have the following entries:
place_idβ the place ID (FIXME: what's this? π honestly same bestie)licenceβ the data licence stringosm_typeβ the OSM type of the locationosm_idβ FIXMEboundingboxβ the coordinates of the bounding box (min and max latitude, min and max longitude)latβ the location's latitudelonβ the location's longitudedisplay_nameβ the location's human readable name π₯°classβ FIXMEtypeβ FIXMEiconβ FIXME
-error cmdprefixβ a command prefix that gets invoked when we encounter errors. Typically these are HTTP errors, so like, the vibe check failed π. The default setting (active when nothing was specified on object creation) is to print theerrorstring(see below) to stderr. The result of the command prefix is ignored. Errors thrown by the command prefix are passed to higher levels.
The signature of the command prefix is:
$cmdprefix errorstring
π¦ METHODS π¦
requestor search queryβ this method returns a list of dictionaries, one item per hit, for the specified query. it's giving exactly what it says on the tin π
π REFERENCES π
π·οΈ KEYWORDS π·οΈ
geocoding, http, location, map, nominatim, server, url
okay that's the whole page bestie, you ate that π This lil cutie is from tcllib, version 0.3, and it's the map::geocode::nominatim(3tcl) page β go forth and geocode, main character πβ¨π¦
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms