4. Review names
Fourth step of preparing an administrative boundary
release. Continues from the coded
output of step 3. No dedicated tool yet, schema-fill is
built for bulk/global dataset production, not per-country name review, so
this step is manual investigation, generally covering:
-
Duplicates under the same parent: two units sharing a name (or a near-identical one) under the same immediate parent.
SELECT adm1_code, adm2_name, COUNT() FROM admin2_coded.parquet GROUP BY adm1_code, adm2_name HAVING COUNT() > 1;
-
Near-duplicates from a typo, not a real distinct name: DuckDB's
jaro_winkler_similarity()/levenshtein()flag close-but-not-exact pairs under the same parent for a human to confirm. -
Blank or placeholder names: any
adm{N}_namethat'sNULL, empty, or still holds a source-system default. -
Encoding artifacts: mojibake (e.g.
éwhereéwas intended), usually from a source file read with the wrong encoding. -
Renamed vs. mistyped, against the reference release: for a unit whose p-code already existed in
{ref_version}, compare its name now against its name then. A real administrative rename is expected and fine, a diverging spelling of the same unit isn't. -
Parent-name conflicts from
schema-join: eachvalue-mismatchrow in stage 1's issues file is a child whose ownadm{N}_namediffers from its parent layer's, whichschema-joinadded asadm{N}_name{k}. Pick one spelling per parent unit and write it toadm{N}_nameon every child under it. Drop thatschema-joinsibling only once no row still differs fromadm{N}_name. Keep anyadm{N}_name{k}mapped from the source in stage 1, since it's an alternate name, not a conflict.
Record every finding in an issues file (reusing the shared schema:
key, kind, reason, unit_a, unit_b, parent_fid, geom, every
other column null), kind one of duplicate-name, near-duplicate-name,
blank-name, encoding-artifact, name-drift. Unlike every other tool's
issues file, write this one even when it has zero rows: it's the only
artifact this stage produces, and Setup step 4 checks for its presence
(not its row count) to know this stage is done.
Next: package for output.