Skip to main content

Crate gridpin

Crate gridpin 

Source
Expand description

Geocoder core library (used by both the CLI binary and the Python bindings).

Modules§

abbrev
--abbrev words.tsv: your own abbreviations, written out before the query reaches the engine.
aliases
--aliases: your own names for places, read before the sheet. “HQ”, “depot 3”, “store 117” -> an address.
bench
gridpin bench: geocode a table whose true points are known and say how close the answers came.
builder
Single-pass index builder from a pre-sorted CSV. Input must be sorted by (nom_voie_norm, code_insee, numero, rep), which matches the lexicographic order of the FST keys street 0x1F insee.
cells
Codes of statistical grid cells a point lies in (plan T1.3): the European census grid on ETRS89-LAEA (EPSG:3035) at 1 km and 100 m, written as its publishers write it (CRS3035RES1000mN<north>E<east>, the south-west corner in metres), and the Japanese standard grid square (JIS X 0410) of the first, second and third level (4, 6 and 8 digits). A point outside the frame of a grid has no code.
cite
gridpin cite <sheet>: a citation of the sheet a study geocoded with, in BibTeX, APA or CFF.
cluster
gridpin cluster points.csv --k 12 [--max-size 80]: delivery zones and rounds from points.
codes
Point codes, both ways: geohash, Plus Code (Open Location Code), UTM, MGRS and degrees-minutes-seconds.
compare
parse and same_address: how the engine reads an address line, and whether two lines name one place.
country_names
Country names -> ISO 3166-1 alpha-2 (country_names.tsv): which country the end of a query names, for every sheet alike. Data, no country branch: a server of several sheets picks the sheet a query names by it (09.11.2026: “…, Serbia” and “…, España” did not pick their sheet, because only the US, CA, MX and AU rule packs carry country words).
crs
Coordinates of an answer in a national projection (--with crs:EPSG:2154), by formula, without a crate.
diagnosis
Optional request-local observations. No lookup, scoring or decision is performed here.
exists
Does an address exist in the sheet? yes, maybe or no, with the reason, read from the answer and the verdicts of its fields (verdict.rs); nothing is looked up beyond the address cascade itself.
explain
gridpin explain <sheet> "query": why the engine answered as it did, in words and as JSON for agents.
export
Writing a sheet’s houses to a file: CSV, JSONL, GeoJSONL, GeoJSON, GPX.
extract
Addresses in free text, confirmed by the engine itself (gridpin extract).
extras
Optional answer fields, asked for with --with (CLI), with= (server, Python) and kept out of Hit.
forms
Forms of a query the address path does not know, read before it: a coordinate (decimal, degrees-minutes- seconds, UTM, MGRS, Plus Code, geohash), a special address (post office box, military post, “care of”, milepost, motorway exit) and a street intersection.
geojson_io
gridpin batch in.geojson out.geojson --column address: GeoJSON (a FeatureCollection) and GeoJSONL (one Feature per line) as the input of batch, written back in the same form.
google
The shape of a Google Geocoding API answer, so a client written for it only needs a new base URL.
grammar
gridpin grammar <sheet>: the address grammar a sheet’s own rules declare, in the open schema docs-public/address-grammar.schema.json (method: "declared"). No statistics: the street-type words, which side of the street name they stand on, the digits of the postcode key. The measured grammar (shares over the addresses of a sheet) is gridpin-pro learn-grammar, in the same schema with method: "measured".
index
Index format v7 (“GPC0”): header + table of contents + sections, all little-endian.
iso20022
A structured ISO 20022 postal address (PstlAdr) from a free address line, confirmed against the sheet.
keyed
A table joined by a code (plan T1.1, gridpin attach): statistics a publisher gives by census tract, statistical area or grid cell, attached to rows that carry that code (a layer column of gridpin-pro batch --append) or a point the code is computed from (h3:<n>, geohash:<n>, cell:<name>).
locator
A number for an answer, for clients that will not take an answer without an object number (gridpin serve --ids): TeslaMate stores osm_id under a unique index, Dawarich merges places by it, Atlas builds type:id from it.
mapbox
The Mapbox Geocoding v5 dialect of gridpin serve: GET /geocoding/v5/mapbox.places/<query>.json, the path @mapbox/mapbox-sdk (and through it @mapbox/mapbox-gl-geocoder 5.1.3) asks when its origin is this server (checked by running the library against a local server, 2026-11-19). The answer is a Carmen GeoJSON FeatureCollection, as the v5 reference describes it (docs.mapbox.com/api/search/geocoding-v5, read 2026-11-19).
match_tables
gridpin match A B OUT: two tables joined by the address their rows name.
md
Markdown output for a reader rather than a program: query --format md, reverse --format md and batch --output-format md. An agent or a person reads the answer as a table; the values are those of the JSON answer, in its order, and a weak answer says so in words as well as in its weak field.
ml
Parser model inference (logistic regression over hashed features) — exact mirror of the training script: same features, same blake2b-4 hash, same classes.
norm
Query-string normalization — mirrors DuckDB strip_accents(lower(…)): lowercase → NFD decomposition → strip combining marks → punctuation to space → collapse whitespace.
outcome
What a query came to, for an agent or a person: an answer, a question back, or silence with its reason.
parts
The parts of an address, one model for every structured format the engine writes (ISO 20022, FHIR, CLDXF, …).
places
gridpin build --places places.csv own.bin: a sheet of one’s own places from a friendly table.
points
gridpin nearest and gridpin join: work on two lists of your own, by straight-line distance and by zone.
postcode_layer
A postcode layer beside a sheet: a full postcode to its street, town, region and a point, for countries whose sheet keeps only part of the code (Brazil: the sheet keys the first five CEP digits, the layer the eight).
postcodes
gridpin postcodes <sheet> --res 9: an outline of each postcode, drawn from the points of its houses.
publish
Publishing a geocoded table without its points: batch --aggregate (counts by cell, no coordinates written at all) and batch --mask (each point moved by a random distance in a ring, far enough that k addresses of the sheet lie within the move).
query
Index reading (mmap) and the query path: hypothesis-based parsing of the input (digit groups as house-number candidates; compound suffixes via a dictionary), exact lookup + prefix lookup + typo tolerance (Levenshtein automaton).
receipt
batch --receipt: a JSON file beside the output that says how it was made — the engine version, the SHA-256 of the sheet, of the input and of the output, the command line and the time. Someone who has the same sheet and the same engine reruns the command line and compares the output’s hash: that is the method of a geocoding step, in a form a reviewer can check.
repeats
Rows that repeat an earlier row of the same batch run are answered once.
rules
Rules-in-data: curated tables (commune/city aliases, abbreviations, street-type words, capital anchors, stop lists) can be embedded in the data file (SEC_RULES section); the constants below are the built-in defaults used when a file carries no rules. Updating a rule means rebuilding the data, not releasing a new engine. When both exist, the section wins.
serve
gridpin serve: one sheet behind a small local HTTP server.
sheets
Country sheets of the release: the registry, the cache folder, verification and download.
slice
gridpin slice <sheet> --bbox … --out part.bin: a smaller sheet cut from a sheet, for a browser, a device or one city. The source sheet is not changed.
tabular
CSV and TSV for gridpin batch: the input file comes back with its own columns plus gp_* answer columns.
valhalla
An answer as a Valhalla route location (gridpin query --format valhalla, GET /v1/geocode?format=valhalla): one line {"locations":[{"lat":…,"lon":…,"display_lat":…,"display_lon":…}]} that a routing request can take as it is.
verdict
What happened to each field of the query in the answer: confirmed, corrected, inferred, replaced, unresolved.