On the heels of yesterday’s post about vague or fuzzy geography comes a new package in the same vein: etter is a Python package for (per its tagline) “transform[ing] natural language location queries into structured geographic filters — multilingual, streaming-ready, LLM-agnostic”. etter focuses exclusively on extracting and handling the spatial part of a natural language query and returns a suitable GeoJSON geometry for that; the calling application has to deal with the remaining parts — see the below diagram.

etter (source: etter)etter supports 15 (mostly) a priori qualitative spatial relations that are then operationalised using crisp quantitative values (where applicable): 8 directions, containment, and:
near: Circular buffer from centroid with default value of 5kmalong: Linear buffer along a feature with a default value of 500mleft_bank: Left bank of a linear feature (relative to flow direction) with a default value of 500mright_bank: Right bank of a linear feature (relative to flow direction) with a default value of 500mon_shores_of: Ring buffer around a water boundary, excluding the water body with a default value of 1kmin_the_heart_of: Central area of a geographic feature
Note that while the package deals with mostly qualitative spatial relations, at least for now, it outputs crisp geometries. It could be interesting to incorporate some of the vague geography concepts from yesterday’s post into the approach.

on_shores_of relation for Lake Morat (source: etter)etter currently connects to SwissNames3D (for Switzerland), IGN BD-CARTO (for France), and PostGIS (if you want to plug in your own data) as sources for the geographic referent, and can use OpenAI, Anthropic, or any local LLM through LangChain.
The package was sponsored by camptocamp and is open-source under the BSD-3-Clause license. The announcement has more details.