osmfilter should be the right tool for this job.