itacart.geometry.MAX_FILL_CELLS

itacart.geometry.MAX_FILL_CELLS: int = 200000000

Ceiling on cells emitted by one polyfill() call.

A fill is bounded by the geometry’s area divided by the cell area, which at resolution 13 is one square centimetre: a single football pitch holds seventy billion cells. Without a ceiling the call does not fail, it simply never returns, and the caller cannot tell the two apart.

The number is measured, not chosen. The index a fill returns costs about three bytes per cell, so two hundred million cells is a string of some six hundred megabytes and a peak of roughly twice that while it is being joined. That is large but survivable on an ordinary machine, and it is the point at which the output itself, rather than any bookkeeping around it, becomes the thing that does not fit.

Raising it further is a memory question, not a policy one: measure len(polyfill(...)) against available memory before doing so.