返回资讯中心
外部精选
软件工程
#开发者实时流

Gridpin 发布离线地理编码引擎,将整个国家数据打包成单个文件

来源标题:Gridpin – Offline geocoder, a country in a file

Gridpin 推出离线地理编码引擎,把单个国家的地址数据打包成一个内存映射文件,无需服务器、数据库导入或按次付费,单核笔记本上即可毫秒级精确正向与反向查询。目前已覆盖法国、德国、美国等十余个国家,提供 Rust 引擎、Python wheel、DuckDB 扩展和 MCP 服务器等形式,但尚不支持全球覆盖和按地点名称搜索。

Hacker News 最新altilunium2026/11/26 · 今天19 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

No server, no database import, no per-request fees.

GridPin packs a country into a memory-mapped file. Forward and reverse geocoding, millisecond exact lookups on a single laptop core — no server, and the engine and every query stay offline.

Fits: local, privacy-sensitive or high-volume address workloads in Australia, Brazil, Canada, France, Germany, Italy, Mexico, the Netherlands, New Zealand, Poland, Serbia, Spain and the United States (point addresses in 35 states, partly in 8 more and DC, address ranges only in CO, FL, HI, MS, NH, NV and SC). Does not fit today: worldwide coverage, a hosted endpoint, or a search of places by name without an address answer first.

Rust engine · CLI · Python wheel · DuckDB extension · MCP server · batch mode

$ gridpin query france.bin "8 Boulevard du Port, Amiens" -k 1 {"lat":49.897442,"lon":2.290084,"precision":"house","confidence":0.94, "street":"Boulevard du Port","housenumber":"8","commune":"Amiens","postcode":"80000", …}

$ gridpin reverse france.bin 49.894600 2.294900 # millisecond, fully offline {"lat":49.894538,"lon":2.294934,"precision":"house","confidence":0.95, "street":"Passage du Bailliage","housenumber":"19","commune":"Amiens","distance_m":7.3, …}

Zero calls home

The engine sends no telemetry and no license pings — not a byte of what you geocode leaves your machine. The only network use is you downloading a sheet.

Memory-mapped country files. No database, no data import, no warm-up.

Address to coordinates and coordinates to address, single or batch.

CLI, Python wheel via pip, a DuckDB extension for SQL, and an MCP server for AI agents.

Hosted geocoders charge per request, forever — and the biggest one won't even let you keep what you paid for.

The optional places layer of each country comes with every tier; it is best-effort and may lag the address release by a little.

Cost comparison: List prices as of 2026-08, 1M requests/month; hosted-API figures are provider list prices before storage add-ons — see each provider's current terms.

The grid is ours. The pin is yours. We ship fresh data sheets; every result you compute belongs to you — store it, join it, sell your product on top of it, forever.

A sheet is one data file per country; the optional places layer is a separate file. The full set is the atlas. Fresh sheets ship monthly on subscription; free builds are static, with no update schedule.

France is a single 365 MB sheet with 26.1M addresses — one file per country (each country also has a separate, optional places file). Put it anywhere on disk.

CLI, Python, or DuckDB — the Rust engine memory-maps the sheet and is ready instantly. No import, no schema.

Forward, reverse, and batch — exact lookups in well under a millisecond per core. On a plane, in an air-gapped VPC, on a laptop.

forward: top hit as JSON

$ gridpin query france.bin
"19 Rue Béranger, Paris" -k 1 {"lat":48.866402,"lon":2.363412, "precision":"house", …}

reverse

$ gridpin reverse france.bin
48.8664 2.3634

batch: JSONL in, JSONL out

$ gridpin batch france.bin
in.jsonl out.jsonl -k 1

Python pip install gridpin

import gridpin

g = gridpin.Geocoder("france.bin") # mmap, instant

hits = g.geocode("8 Bd du Port, Amiens", 1) print(hits[0]["lat"], hits[0]["lon"])

near = g.reverse(49.8945, 2.2949, 1)

exact lookups: ~3,000/s per core;

geocode_many() batches across cores

DuckDB gridpin_ext

-- install: see docs → Install LOAD gridpin_ext; SELECT gridpin_load('france.bin');

-- forward, straight from SQL SELECT gridpin_geocode(address) FROM customers;

-- reverse SELECT gridpin_reverse(lat, lon) FROM gps_pings;

AI agents get the same engine through an MCP server — claude mcp add gridpin -- uvx gridpin-mcp. The agent downloads a sheet once, checked against the signed release, and geocodes offline. How it works.

Also from R, Node.js, QGIS, LangChain, spreadsheets (CSV), a local Nominatim-compatible server, Docker, GeoPandas, Spark and Databricks, Google's API format, SQLite and Datasette, polars, ClickHouse, dbt, NocoDB, Baserow and Grist, Google Sheets, Benthos and Redpanda Connect, address suggestions in a web form, WebAssembly, Home Assistant, Rust — every way to use it. The sheet is also a table you can list, export and sample, and your own files join it: nearest depot, zones, place names.

Sheet format v7; Germany added in September 2026 (v0.2.0), Spain in September 2026 (v0.3.0), Brazil in October 2026 (v0.4.0), the United States in October 2026 (v0.5.0), Canada in October 2026 (v0.6.0), Mexico in November 2026 (v0.7.0), Australia in November 2026 (v0.8.0), Poland and New Zealand in November 2026 (v0.10.0). New sheets are added country by country — tell us which one you need next.

A sheet is smaller than its own raw source. France's national registry download is an 885 MB gzip that unpacks to 4.9 GB of CSV — the finished sheet is 365 MB, and that already includes every index: typo automata, spatial cells, ranking. You download less than the raw data and get a ready-to-query engine file instead of a CSV to import.

Optional places layer for every country (<cc>_poi.bin, 15 MB to 1.7 GB) of places from Overture (mixed permissive: CDLA-Permissive-2.0 / Apache-2.0 / CC0-1.0) — geocode "Musée du Louvre, Paris", not just street addresses.

Prebuilt binaries cover Linux x86_64 (x86_64-unknown-linux-gnu), macOS Apple Silicon (aarch64-apple-darwin) and Windows x86_64 (x86_64-pc-windows-msvc); any other target (Intel macOS, Linux arm64/musl, Windows arm) builds from source with stable Rust.

Real addresses arrive with typos, shortened street types and the town in the wrong place. Share of queries answered within 150 m of the true address:

CI: cargo test on three operating systems, plus a public smoke test that builds Monaco from a raw OSM extract and runs live queries on every commit.

You're paying for fresh sheets, not for lookups. Run a billion queries — the price doesn't move.

Already bought? Open your files with your key.

Annual billing = 10× the monthly price — two months free. Free, Starter and Pro, feature by feature. All plans: unlimited requests, results are yours forever.

Yes — forever. That's the point. Everything GridPin computes on your machine is yours: cache it, put it in your database, ship it in your product. Compare: Google's terms forbid storing results and cap coordinates at 30 days; Mapbox charges 7.5× for permanent storage rights.

Your customer addresses never leave your infrastructure: no API call to geocode, no third-party processor, no data transfer to review — the geocoder runs where your data already lives, and the engine sends no telemetry at all. The only network action is you downloading a sheet, and it carries no query data.

The engine (Rust), the DuckDB extension, the data pipeline, and the docs are public under Apache-2.0. The paid part is the data service: fresh, tested, ready-to-use sheets every month — plus country-specific rule tables that ship inside the paid data files.

A laptop. Sheets are memory-mapped, so they open instantly and don't need to fit in RAM. On a single arm64 core, exact lookups run at ~3,000/s and reverse geocoding at ~1,800/s; typo-tolerant fuzzy matching is much slower (tens of ms per query), so batch messy input across cores. See the benchmarks for the per-shape method and numbers.

If GridPin is useful to you, a star on GitHub helps other people find it.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →