bulk formating
Opened this issue · 2 comments
missinglink commented
I was looking for a method of running this code against an entire directory today (recursively).
What I came up with was this:
find /data -type f -name '*.geojson' -exec bash -c './bin/wof-format $0 > $0.tmp; mv $0.tmp $0' {} \;
It's not super elegant, but works, should we add this to the README or would you prefer to add support for passing directories as $1
such as there is for exportify?
missinglink commented
[edit] maybe an -i
(in place) flag like from sed
would be nicer?
thisisaaronland commented
A tool built on top of
- https://github.com/whosonfirst/go-whosonfirst-iterate
- https://github.com/whosonfirst/go-writer
- https://github.com/whosonfirst/go-whosonfirst-export
Would accomplish this and be agnostic about the source (and destination) of the WOF records. Essentially a tool to iterate over a source:
And rather than counting things invoke the code here (where "here" means []byte
rather than an io.ReadSeeker
but the gist is the same: