Geocoding¶
Geocoding converts coordinates to street addresses for use in alert templates. Static map providers generate map images embedded in alerts.
Address Geocoding¶
Provider¶
[geocoding]
provider = "none" # none, nominatim, photon, or google
provider_url = "" # URL of your Nominatim or Photon instance
forward_only = false # Disable reverse geocoding
cache_detail = 3 # Decimal places for cache key (3 or 4)
Nominatim (Recommended)¶
Nominatim is a free, self-hosted geocoding service. Use the Docker image for a local instance:
Tip
Self-hosting Nominatim avoids rate limits and is much faster than public instances.
Photon¶
Photon is another self-hostable geocoder:
Google¶
Multiple API keys can be provided — Poracle will cycle through them:
Address Format¶
Customize how addresses are constructed for the {{addr}} DTS variable:
[locale]
address_format = "" # default: country-idiomatic formattedAddress
# address_format = "{{{streetName}}} {{streetNumber}}" # street line only (old default)
address_include_country = false
See [locale] for the available fields and helpers.
Street Intersections¶
Fill the {{intersection}} DTS field with the nearest street intersection using GeoNames. Register one or more free GeoNames usernames:
Results are cached with the address cache, but each uncached lookup uses a GeoNames credit.
Failures¶
The geocoder has a circuit breaker. After repeated failures, lookups are skipped for a cooldown period, so alerts go out without an address instead of waiting. Tune it with [tuning] geocoding_* (see [tuning]).
Static Maps¶
Provider¶
[geocoding]
static_provider = "none" # none, tileservercache, rampardos, google, osm, mapbox
static_provider_url = "" # Public provider URL (used in alerts)
static_internal_url = "" # Optional private URL for PoracleNG's own tileserver calls
static_key = [""] # API keys (google, osm/MapQuest, mapbox)
Map Dimensions¶
Used by the google, osm and mapbox providers. Tileserver sizes are set in tileserver_settings below.
TileserverCache (Recommended)¶
SwiftTileserverCache provides high-quality, customizable map tiles:
Rampardos, a newer tileserver written by Unown, uses the same protocol. Templates for it are in tileserver_templates/rampardos/ in the PoracleNG repository:
If the public URL in static_provider_url goes through a proxy such as Cloudflare, set static_internal_url to a direct internal address. PoracleNG then uses it for its own requests, while alerts still contain the public URL.
Time-of-Day Styles¶
Use different map styles based on time of day:
[geocoding]
day_style = "osm-bright"
dawn_style = "osm-liberty"
dusk_style = "osm-liberty"
night_style = "dark-matter"
Reference these in DTS templates with #(style).
Per-Type Settings¶
Override map settings for specific alert types:
[geocoding.tileserver_settings.default]
type = "staticMap" # staticMap or multiStaticMap
width = 500
height = 250
zoom = 15
pregenerate = true
include_stops = false
[geocoding.tileserver_settings.monster]
type = "staticMap"
include_stops = true
[geocoding.tileserver_settings.raid]
width = 600
height = 300
Map types include monster, raid, egg, quest, lure, invasion, gym, nest, maxbattle, showcase, weatherchange, location and questsummary. Per-type entries can also set ttl (seconds). See [geocoding] for the full list and [geocoding.static_map_type].
Google Maps¶
OpenStreetMap (MapQuest)¶
The osm provider renders through the MapQuest static map API and needs a MapQuest key: