[GIS] Listing every street name per postal code

germanyopenstreetmapoverpass-api

I would like to export a list of all street names per postal code for Germany.
More specificly, I have looked at OpenStreetMap/the Overpass API.

With

[out:json];
(
    area[postal_code="31061"];
);
way(area)[highway][name];
out;

i can get a list containing information about every street in the postal code "31061 – Alfeld".

Now, I could just use a public API, but I don't think they'd be happy with me firing 30k requests against their API.

I could host my own version of the Overpass API, altough that requires very large amounts of resources (HDD and RAM). I tried importing the dataset for germany, but had limited success due to the large file sizes.

There has to be a better solution to get the data I would like to have.

Is there maybe a commandline-tool available, that can extract all streets for a specific postal code from a http://download.geofabrik.de/europe/germany.html dump?

Best Answer

I don't think there is such a command line tool available. You can probably build something similar with osmium-tool. However it will take ages to process a raw PBF or XML file until obtaining all the information you are interested in. You will have to re-read the file for each query and you can't really perform spatial queries against it.