Osmfilter or osmium tool are both well suited to pre-filter your local planet pbf file. Afterwards you can just use that extract rather than the full planet in your GIS tool.