whosonfirst/go-whosonfirst-format

bulk formating

Opened this issue · 2 comments

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?

[edit] maybe an -i (in place) flag like from sed would be nicer?

A tool built on top of

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: