Export number of nodes for a specific date

Hello,

With some help I created the following script to export the number of gas stations per NUTS 3 region in Germany.

[out:csv( "de:regionalschluessel", name, total, nodes, ways, relations )];

//All NUTS 3 regions in Germany
area["ref:nuts:3"~"^DE"];

// Count the fuel stations in each area
foreach->.regio(
  // Collect all Nodes, Ways and Relations wth amenity=fuel in the current area
  ( node(area.regio)[amenity=fuel];
    way(area.regio)[amenity=fuel];
    rel(area.regio)[amenity=fuel];);
  
  make count "de:regionalschluessel" = regio.set(t[ "de:regionalschluessel"]),
             name = regio.set(t["name"]),
             total = count(nodes) + count(ways) + count(relations),
             nodes = count(nodes),
             ways = count(ways),
             relations = count(relations);
  out;
);

Now, I thought about exporting this data for different years. I found the following article about filtering for time stamps.
https://wiki.openstreetmap.org/wiki/DE:Overpass_API/Beispielsammlung#Stand_der_OSM-Daten_zu_einem_Stichtag

Can anyone help me and tell me how to put this option in my existing code? So i can just switch the date and export data for different years.

Thank you!

7 posts - 2 participants

Read full topic


Ce sujet de discussion accompagne la publication sur https://community.openstreetmap.org/t/export-number-of-nodes-for-a-specific-date/104787