1TOPOMERGE(1) User Commands TOPOMERGE(1)
2
3
4
6 topomerge - merges the source TopoJSON geometry collection, assigning
7 to the target
8
10 topomerge [options] <target=source> [file]
11
13 Merges polygons (or meshes lines) from the specified source TopoJSON
14 geometry collection object, assigning to the target object.
15
17 -h, --help
18 Output usage information.
19
20 -V, --version
21 Output the version number.
22
23 -o, --out file
24 Specify the output TopoJSON file name. Defaults to - for std‐
25 out.
26
27 -k, --key expression
28 Specify a JavaScript expression, given a TopoJSON geometry ob‐
29 ject d and its zero-based index i in its parent collection, that
30 determines how geometry objects are grouped before merging; each
31 group is merged separately. For example, given a topology of
32 U.S. counties, where the id of each county is its five-digit
33 FIPS code, the county boundaries can be merged into state bound‐
34 aries by using the first two digits of the county FIPS code,
35 which represents the state FIPS code:
36
37 topomerge states=counties -k 'd.id.slice(0, 2)' < us-counties.json > us-states.json
38
39 If a key is not specified, all input geometry objects will be
40 merged together. For example, this can be used to merge the
41 state boundaries into a single nation boundary:
42
43 topomerge nation=states < us-states.json > us.json
44
45 -f, --filter expression
46 Specify a JavaScript expression that filters the input geome‐
47 tries before merging or meshing. In conjunction with --mesh,
48 the expression is given two TopoJSON geometry objects a and b
49 that represent the adjacent features for a given arc segment; if
50 the expression evaluates truthily, the associated arc segment is
51 retained in mesh. Otherwise, the expression is given an input
52 TopoJSON geometry object d and its zero-based index i in its
53 parent collection; if the expression evaluates truthily, the ge‐
54 ometry object is retained in the merged polygon.
55
56 --mesh Generate a geometry collection of lines rather than polygons.
57
59 geo2topo(1), topo2geo(1), topoquantize(1), toposimplify(1)
60
61
62
63 January 2021 TOPOMERGE(1)