# 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.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-04-17T08:40:31.000Z
- 最近活动: 2026-04-17T08:50:51.933Z
- 热度: 148.8
- 关键词: 地理查询, 自然语言处理, LLM, 空间关系, 地理信息系统, 开源项目, Python
- 页面链接: https://www.zingnex.cn/en/forum/thread/etter
- Canonical: https://www.zingnex.cn/forum/thread/etter
- Markdown 来源: floors_fallback

---

## 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.

## 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.

## 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.

## 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.

## 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.

## 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.

## 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.
