All Today

🗺️ Texspace: a Rust geocoder that covers the whole planet in 4 to 16 GB of RAM

· 3 min

Preview image of the Texspace project page

In brief


Texspace is an offline geocoder that turns addresses into coordinates and coordinates into addresses. According to its [project page](https://texspace.dev) it runs as one static Rust binary over map data stored as SQLite files (shards) and needs no Elasticsearch or PostgreSQL server. 💾 For the whole planet the page gives 4 to 16 GB of RAM and about 100 GiB of disk, with a setup of roughly 15 minutes. It is an option for developers who want to host address search themselves without a large server or per-request fees.


How it searches. Classic geocoders such as libpostal, Pelias or Nominatim first split a query into fields like street and city and only then check the geography, so swapped fields or a wrong city can misroute a query. According to the project page Texspace reverses that order: it stores addresses as S2 cells in SQLite tables and intersects the spatial footprints first. A small index narrows the 128 global shards down to one or two, then the engine looks up parcel polygon, rooftop, building and street interpolation in turn, and a small decision-tree ranker with calibrated confidence orders the hits. Chinese, Japanese, Korean, Cyrillic, Greek, Hebrew, Arabic and Thai scripts are transliterated when the data is built, so Latin queries can find streets that exist only in native script.

📊 The maker's numbers. The data holds 416 million rooftops and 18.5 million cadastral parcels in 128 shards (74.0 million entities, about 35.2 GB compressed). On an 8-core server with 16 GB of RAM a search takes about 23 ms and a reverse lookup 1.9 ms; batch runs reach about 111 queries per second. Accuracy was measured, the page says, on 440 addresses from municipal and national open-data portals in nine countries; the evaluation and scripts are in the eval/ folder. For comparison the page lists Nominatim at 64 to 128 GB of RAM and 900 GB to 1 TB of disk, Pelias at 64 to 128 GB of RAM and Photon at 32 to 64 GB. A single state or metro shard runs in 256 MB of RAM.

⌨️ Using it. `cargo install texspace && texspace pull gb` fetches, for example, the United Kingdom; `texspace pull planet --with-buildings` fetches the planet. Shards are streamed from Cloudflare R2 and verified with SHA-256. There is a command line, an HTTP server with Pelias-compatible endpoints, a Rust crate, Python, a DuckDB extension, Swift and Kotlin libraries and an MCP server with nine read-only tools. Offline GeoIP data, a time-zone database and 51 prepared city packs for iOS and Android (3.5 to 57 MB) come with it. The page's examples also name a hosted test API at api.texspace.dev.

⚠️ Limits. The page itself says that commercial APIs keep deeper catalogs of businesses and points of interest, and that rooftop density follows the coverage of open address data and OpenStreetMap in each country. The page text we read names no license; anyone planning to ship it in a product should check the repository.

Sources

Open in the interactive reader →

This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources. Imprint, privacy policy and terms of service