Zing Forum

Reading

etter: An Intelligent Parsing Framework to Unlock Geospatial Queries with Natural Language

etter is a geospatial query parsing library based on large language models (LLMs). It can convert multilingual natural language location descriptions into structured geospatial filters, supporting various spatial relationships such as containment, buffer zones, and directions, thereby providing precise query capabilities for search engines and geospatial databases.

地理查询自然语言处理LLM空间关系地理信息系统开源项目Python
Published 2026-04-17 16:40Recent activity 2026-04-17 16:50Estimated read 6 min
etter: An Intelligent Parsing Framework to Unlock Geospatial Queries with Natural Language
1

Section 01

etter: An Intelligent Parsing Framework to Unlock Geospatial Queries with Natural Language (Introduction)

This article introduces the open-source library etter—a geospatial query parsing tool based on large language models (LLMs). It can convert multilingual natural language location descriptions into structured geospatial filters, supporting various spatial relationships such as containment, buffer zones, and directions. It helps developers build precise location search functions and solves complex query problems that traditional rule engines or keyword matching struggle to handle.

2

Section 02

Pain Points of Geospatial Queries and the Emergence of etter

In fields like map applications and location services, users often describe location needs in natural language. However, traditional methods rely on rule engines or keyword matching, which struggle to handle complex scenarios involving multiple languages, granularities, and relationships. Developed with sponsorship from Camptocamp, etter leverages the intelligent understanding capabilities of LLMs to parse natural language geospatial queries into structured spatial filters, providing a solution to this problem.

3

Section 03

Core Functions and Technical Features of etter

etter具备以下关键特性:

  1. Multilingual Support: Can parse geospatial queries in multiple languages including English, German, French, Italian, etc.
  2. Rich Spatial Relationships: Covers relationships like containment (in), proximity (near), buffer zones (within X km), directions (north_of, etc.), linear features (along/left_bank/right_bank), and water bodies (on_shores_of).
  3. Structured Output: Ensures type safety via Pydantic models, outputting information including query type, spatial relationship, reference location, etc.
  4. Streaming Processing: Supports Server-Sent Events (SSE) to return parsing steps in real-time, enhancing transparency and user experience.
4

Section 04

Architecture Design and Integration Patterns

etter adopts a modular three-layer architecture: parsing layer (converts natural language to structured queries), geocoding layer (converts location names to coordinates), and spatial operation layer (generates search areas via geometric calculations). Additionally, it supports flexible configuration (custom spatial relationship parameters) and LLM provider agnosticism (compatible with OpenAI, Anthropic, and local models), making it easy to integrate into various application scenarios.

5

Section 05

Typical Application Scenarios

etter适用于多种场景:

  • Tourism and Outdoor Activities: Parses queries like "hiking along the shores of Lake Morat" or "cycling along the Aare River", adjusting search radius based on activity type.
  • Real Estate and Business Location Selection: Converts queries like "within 10 km southwest of Lausanne" or "within a 15-minute walk from Zurich Main Station" into geospatial filters.
  • Logistics and Delivery: Parses descriptions like "within 2 km of the right bank of the Rhône River" to determine service coverage and routes.
6

Section 06

Technical Implementation Details

etter的实现细节包括:

  1. Confidence Evaluation: Provides overall and component confidence scores; when below a threshold, it can throw a LowConfidenceError or flag the result.
  2. Error Handling: Defines exceptions like ParsingError (parsing failure), UnknownRelationError (unregistered relationship), LowConfidenceError (low confidence), etc.
  3. Batch Processing and Asynchronous Support: Supports batch query processing and asynchronous streaming parsing to meet large-scale or real-time needs.
7

Section 07

Project Significance and Future Prospects

etter represents an important direction for the integration of GIS and NLP, providing a foundation for intelligent location services. In the future, we can expect features like multi-modal geolocation, landmark-based relative location descriptions, and intelligent distance calculation considering terrain and transportation networks. For developers who need to handle natural language geospatial queries, etter is an open-source project worth trying, demonstrating innovative ideas for combining AI with traditional GIS.