Seems reasonable.  Rather than a true global (d3_geo_*) I went for a local variable for reuse in the two nested loops.