map::geocode::nominatim(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 is name. slay.
  • -baseurl url β€” the base URL of the Nominatim service, no cap. The default value is OpenStreetMap's service at http://nominatim.openstreetmap.org/search 🌍. A possible free alternative lives at http://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 -error below), 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 string
  • osm_type β€” the OSM type of the location
  • osm_id β€” FIXME
  • boundingbox β€” the coordinates of the bounding box (min and max latitude, min and max longitude)
  • lat β€” the location's latitude
  • lon β€” the location's longitude
  • display_name β€” the location's human readable name πŸ₯°
  • class β€” FIXME
  • type β€” FIXME
  • icon β€” 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 the errorstring (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 πŸ”—

  1. http://wiki.openstreetmap.org/wiki/Nominatim
  2. http://open.mapquestapi.com/nominatim/

🏷️ 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