Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I regularly go through the following process to go from ndjson (convenient for modifying data) to geojson (to project) and then to topojson to simplify and use.
($states; $objects)
| ndjson-reduce 'p.features.push(d), p' '{type: "FeatureCollection", features: []}'
| geostitch
| geoproject 'd3.geoMercator().rotate([" . (0 - $row[centroid_x]) . ", " . (0 - $row[centroid_y]) . "]).fitSize([$px_width, $px_height], d)'
| geo2topo all=-
| toposimplify --filter-all -p 1
The issue is that I need all of the data in a single geojson file so that I can use .fitSize() and maintain the same scale for all layers, but then when using it, I would much rather have the topojson split into layers.
The pull request would allow you to change the geo2topo command to "| geo2topo --split-layers" and use ndjson-map to specify the layer as a property of each like this:
($states | ndjson-map 'd.properties.layer = "states", d'; $objects | ndjson-map 'd.properties.layer = "objects", d')
| ndjson-reduce 'p.features.push(d), p' '{type: "FeatureCollection", features: []}'
| geostitch
| geoproject 'd3.geoMercator().rotate([" . (0 - $row[centroid_x]) . ", " . (0 - $row[centroid_y]) . "]).fitSize([$px_width, $px_height], d)'
| geo2topo --split-layers
| toposimplify --filter-all -p 1