schema-join
Copy admin columns from a join layer onto the input polygons they overlap.
Synopsis
Section titled “Synopsis”topo-tools schema-join [OPTIONS] INPUT_FILE JOIN_FILE [OUTPUT_FILE]Description
Section titled “Description”Each input polygon takes the columns of the join polygon it overlaps most. Geometry is not changed. When a column already has a different value, both are kept: the join layer’s value goes in a new numbered column (adm2_name1).
Options
Section titled “Options”--issues-output TEXT: Path for the issues report. Defaults to OUTPUT_FILE with an “_issues” suffix.--name-field TEXT: Name column of each level, with {n} for the level number, e.g. ‘adm{n}_name’. Give it with--code-field. Without both, levels are detected from the data.--code-field TEXT: Code column of each level, with {n} for the level number, e.g. ‘adm{n}_code’. Give it with--name-field. Without both, levels are detected from the data.--min-overlap FLOAT: Report an input polygon when its best-matching join polygon covers less than this share of its area. [default: 0.5]--overwrite BOOLEAN: Replace output files that already exist. Pass--overwrite=falseto stop with an error instead. [default: True]--threads INTEGER: Number of threads DuckDB uses (default: all CPU cores).--debug: Keep intermediate tables, export them to Parquet, and log the time and memory each query takes.--tmp-dir TEXT: Folder for the working DuckDB database and intermediate files (default: a new temporary folder, deleted afterwards unless--debugis set).--step [inputs|assign|join|outputs]: Run only this step of the tool, for debugging.
Examples
Section titled “Examples”Copy admin2 columns onto an admin3 layer:
topo-tools schema-join admin3.geojson admin2.geojsonBuild up a full hierarchy one level at a time, coarsest first:
topo-tools schema-join admin2.parquet admin1.parquet admin2_join.parquettopo-tools schema-join admin3.parquet admin2_join.parquet admin3_join.parquet