Bash

cat /root/traccar-geocoder/builder/src/build_index.cpp | ssh node3 "cat > /tmp/traccar-geocoder/builder/src/build_index.cpp" && ssh node3 "cd /tmp/traccar-geocoder/build && make -j\$(nproc) 2>&1 | tail -3 && rm -rf /tmp/de-par-final3 && mkdir -p /tmp/de-par-final3 && /tmp/traccar-geocoder/build/build-index /tmp/de-par-final3 ~/pbf/germany.osm.pbf --parallel-admin 2>&1 | grep -E 'polygon|Done|closed way'" 2>&1

Build with relation-member exclusion for closed ways


[ 50%] Building CXX object CMakeFiles/build-index.dir/src/build_index.cpp.o
[100%] Linking CXX executable build-index
[100%] Built target build-index
  Added 29 admin polygons from closed ways.
  Assembling admin polygons in parallel (40080 relations, 112858 way geometries)...
  Parallel admin assembly complete: 43187 polygon rings from 40080 relations.
Done reading:
  43216 admin polygon rings
Waiting for admin polygon S2 covering to complete...
Admin polygon S2 covering complete (6103 cells).
admin index: 6103 cells, 43216 polygons
Done.


43,216 — very close to 43,221 (only 5 difference). Let me check.


ssh node3 "/tmp/freq_compare /tmp/de-par-final3 /tmp/de-sequential-final" 2>&1

Check remaining differences


  'Deutschland - Österreich|2': A=1 B=0 diff=+1
  'Deutschland — Schweiz / Suisse / Svizerra|2': A=1 B=0 diff=+1
  'Drabenderhöhe|10': A=2 B=3 diff=-1
  'Großfischbach|10': A=2 B=4 diff=-2
  'Kleines Dorf|11': A=1 B=0 diff=+1
  'Krefeld-Ost|9': A=2 B=1 diff=+1
  'Krefeld-Uerdingen|9': A=1 B=2 diff=-1
  'Millienhagen-Oebelitz|8': A=2 B=3 diff=-1
  'Moorkolonie Neudorf|11': A=1 B=0 diff=+1
  'Moorkolonie Platendorf|11': A=1 B=0 diff=+1
  'Münchhausen|8': A=2 B=3 diff=-1
  'Neuhaus|10': A=5 B=4 diff=+1
  'Werl|10': A=1 B=2 diff=-1
  'Wäschegrund|10': A=1 B=2 diff=-1
  'Deutschland - België / Belgique / Belgien|2': A=0 B=1 diff=-1
  'Sauschütt|8': A=0 B=1 diff=-1
  'Umbertshausen|8': A=0 B=1 diff=-1
  'Wense-Fallingbostel|10': A=0 B=1 diff=-1
Total frequency differences: 19


The filter was too aggressive — it removed correct closed-way polygons. Let me revert to including all closed ways (matching osmium's behavior) and instead focus on the cross-border ring stitcher extras.


Edit

                                    // Handle closed ways that are admin boundaries themselves
                                    // (not part of a multipolygon relation, but standalone polygons)
                                    // Skip ways that are members of admin relations — those are
                                    // handled by the multipolygon assembler, not as standalone polygons.
                                    if (parallel_admin && !admin_way_ids.count(way.id())) {

                                    // Handle closed ways that are admin boundaries themselves
                                    // Osmium creates areas from closed ways independently of
                                    // multipolygon relations, even if the way is a relation member.
                                    if (parallel_admin) {