Generally speaking, any bidimensional shape can be characterized by its successive moments. Let $J_p$ be a set of pixels constituting a patch. The zeroth order moment is equal to the size of the patch (i.e., the number of pixels in the patch):

$$M_{00} = \sum_{j \in J_p} \delta\sigma_j = \#J_p, \qquad (J3)$$

where $\delta\sigma_j = 1$ by convention for pixels in the patch (i.e., pixel areas are normalized to unity). The first order moments are directly related to the position of the center of the patch ($x_0^c = M_{10}/M_{00}$, $x_1^c = M_{01}/M_{00}$):

$$M_{10} = \sum_{j \in J_p} x_0^j, \qquad (J4)$$

$$M_{01} = \sum_{j \in J_p} x_1^j, \qquad (J5)$$

where $(x_0^j, x_1^j)$ are the spatial coordinates of pixel j. The normalized second order moments are given by:

$$\mu_{20} = \frac{1}{M_{00}} \sum_{j \in J_p} (x_0^j - x_0^c)^2, \qquad (J6)$$

$$\mu_{02} = \frac{1}{M_{00}} \sum_{j \in J_p} (x_1^j - x_1^c)^2, \qquad (J7)$$

$$\mu_{11} = \frac{1}{M_{00}} \sum_{j \in J_p} (x_0^j - x_0^c)(x_1^j - x_1^c). \qquad (J8)$$

The normalized inertia tensor<fnref n="35" /> $I_p$ is then defined as:

$$I_p = \begin{pmatrix} \mu_{20} & \mu_{11} \\ \mu_{11} & \mu_{02} \end{pmatrix}. \qquad (J9)$$

From this definition, one can introduce the reduced principle moments of inertia of the patch, i.e., the eigenvalues $\lambda_1$ and $\lambda_2$ of $I_p$:

$$\lambda_1 = \frac{1}{2} \left( \mu_{20} + \mu_{02} - \left[ (\mu_{20} - \mu_{02})^2 + 4\mu_{11}^2 \right]^{1/2} \right), \qquad (J10)$$

$$\lambda_2 = \frac{1}{2} \left( \mu_{20} + \mu_{02} + \left[ (\mu_{20} - \mu_{02})^2 + 4\mu_{11}^2 \right]^{1/2} \right). \qquad (J11)$$

Clearly, the ratio of the minor to the major axes of the ellipse having the same reduced principle moments of inertia is given by $(\lambda_1/\lambda_2)^{1/2}$ and its eccentricity by $(1 - \lambda_1/\lambda_2)^{1/2}$.

At this point, we deviate somewhat from the equivalent ellipse analogy and choose to define the patch elongation as

$$e = 1 - \left( \frac{\lambda_1}{\lambda_2} \right)^{1/2}. \qquad (J12)$$

This definition is adopted as it turns out that the elongation thus defined has convenient features from a numerical point of view. The patch elongation ranges from 0 (for a circular patch) to 1 (for a linear patch).

### J.3. Patch design algorithm

The patch design procedure is represented as a workflow on Fig. J1. In the following description, the Roman numerals refer to the numbered steps in this workflow. The process is iterative and begins with the patch pivot-cell. The objective is to produce some randomness in the patch shape, while preserving as best as possible the patch selected size and elongation. This procedure refers to two subprocesses (patch connectedness condition and neighbor elongation score), described right after the algorithm description.

<footnote n="35">³⁵If a patch is seen as an actual 2D massive structure with each pixel mass equal to its area, this definition corresponds indeed to the tensor of inertia defined in classical mechanics.</footnote>
<figure><img src="image_18.png" /><figcaption>**Figure J1:** Patch design procedure workflow. Two parameters are required: the previously randomly selected patch size and elongation.</figcaption></figure>

### J.3.1. Algorithm description

The loop runs while the expected patch size is not reached (i). As the process goes on, the patch grows pixel by pixel. All neighbors of the current patch at each iteration are identified with the help of the chosen neighborhood matrix defined in section J.1, applied to each pixel of the current patch boundary (ii). Next, all identified neighbors are tested as follows. If at least one neighbor belongs to another patch of the same final LUC state $v$ (iii), a patch merging (defined in section 2.3) has occurred; the procedure is then stopped (failure) and no new patch is created (x). The same outcome follows if no neighbor is in the pivot-cell initial state $u$ (iii and x). Otherwise, there is at least one suitable neighbor, i.e. a neighbor with LUC state equal to the pivot cell initial state $u$ (in particular, this excludes pixels who have already undergone another state transition during the same time step). Next, the patch connectedness condition (see below) is checked on all suitable neighbors (iv). If at least one pixel satisfies the connectedness condition, one such pixel (if several) is randomly selected and added to the current patch (v). Otherwise, the patch elongation associated to each pre-selected pixels in step (iv) is computed (vi). Indeed, adding one such neighboring pixel to the patch would change its elongation and one therefore needs to find the most suitable pixel to be added to the patch, if more than one such pixel is available. This is defined on the basis of an elongation score: the pixel with the best (lowest) elongation score is selected and added to the current patch (vii); the computation of the elongation score is described below. At this point, one pixel has been added to the patch, either from the patch connectedness test (v) or from the elongation score one (vii). A final patch merging test is then performed (viii). If a patch merging is detected, the patch is discarded and the procedure stops with a failure outcome (x). Otherwise, the patch growth process starts again until the excepted patch size is reached (i). Finally, the patch is allocated and the algorithm returns a successful outcome (xi).

All tested pixels (ending up in either success or failure) are removed from the pool of potential pixels for a $u \rightarrow v$ transition (set $J$, which therefore is reduced as the iterative allocation method progresses). Whether the patcher procedure ends in success or failure, the allocation method continues as described in section 4.2 and in Fig. 2.

The patch merging test of steps (iii) and (viii) bears only on merging with other patches produced at the same time step. Merging with pre-existing areas does not lead to patch rejection. As a consequence, and if the transition probability is correctly estimated in the vicinity of existing areas (as ensured by our calibration-estimation procedure,
<figure><img src="image_19.png" /><figcaption>Figure J2: Allocation example on the basis of the connectedness test. The chosen neighborhood structure is rook and the connectedness condition is set to 3.</figcaption></figure>

Mazy and Longaretti 2022b), our patch design procedure can also serve the purpose of the expander patch creation procedure of Dinamica EGO or other software. No specific algorithm is needed for this purpose in our software.

### J.3.2. Connectedness test

A “connectedness test” has been implemented in order to prevent the formation of small areas of one or a few non-transited pixels in a patch. To this effect, we consider all pixels that have successfully passed tests (ii) and (iii) in the patch formation procedure just described. The rook neighboring structure is attached to each of these pixels. Next, we determine the number of neighbors $n_{rook}$ in this rook structure, whose LUC state is identical to $v$ (the final state in the transition of interest). We define a threshold number of neighbors $n_c$. If $n_{rook} \ge n_c$, the pixel under test is selected for allocation in (iv), and one such pixel is randomly selected in (v), if more than one is found.

Fig. J2 presents an example of this test with the threshold set to $n_c = 3$ (our default choice). Obviously, this approach is only efficient for small holes and is inefficient in case of large ones. However, such a shape is very unlikely, due to the elongation condition also included in the patch design procedure. As a matter of fact, we have never observed a failure of the test to achieve its intended purpose (i.e., preventing the formation of holes inside a patch), but we do not provide a formal proof of this statement.

### J.3.3. Elongation score test

In case the connectedness test just described has failed (i.e., no new pixel has been added for the purpose of preventing the formation of a hole in the patch), all pixels selected in steps (ii) and (iii) are considered in steps (vi) and (vii). Each such pixel is tested by provisionally adding it to the current patch. This results in a change of elongation of the patch. The new potential patch elongation is computed under the assumption that the patch centroid does not change. Indeed, the addition of a pixel will only slightly change the center of mass ($x_0^c, x_1^c$) of the patch (unless it is composed of only a few pixels) and making this assumption greatly simplifies the calculations and leads to a more efficient process. For this purpose, for each neighbor $j$ with coordinates ($x_0^j, x_1^j$), one computes new potential second order moments:

$$ \mu_{20}^j = \frac{1}{M_{00} + 1} (M_{00}\mu_{20} + (x_0^j - x_0^c)^2) \qquad (J13) $$

$$ \mu_{02}^j = \frac{1}{M_{00} + 1} (M_{00}\mu_{02} + (x_1^j - x_1^c)^2) \qquad (J14) $$

$$ \mu_{11}^j = \frac{1}{M_{00} + 1} (M_{00}\mu_{11} + (x_0^j - x_0^c)(x_1^j - x_1^c)), \qquad (J15) $$

where moments $M_{20}$, $M_{02}$ and $M_{11}$ and centroid coordinates ($x_0^c, x_1^c$) refer to the current patch state. The neighbor elongation $e^j$ is then computed according to the equation (J12).

Next, in order to decide which among all pixels thus characterized is eventually incorporated in the current patch, a test score is computed. The basic rationale of this score is to take two constraints into account: the closer $e^j$ is to the
<figure><img src="image_20.png" /><figcaption>**Figure J3:** Measured elongation (averaged) of final LUC maps produced by the uPAM on the case study 3, as a function of the expected mean elongation.</figcaption></figure>

targeted elongation patch parameter e, and the higher the transition probability $P(v|u^j, z^j)$ of this neighbor, the most likely this neighbor is to be selected for inclusion in the current patch.

A possible score satisfying these two conditions is the following:

$$ \tau^j = \frac{|e - e^j|}{P(v|u^j, z^j)} \qquad (J16) $$

where v is the final LUCC state of the LuC transition of interest. The neighbor with the lowest τ score is selected and added to the current patch (vii).

### J.3.4. Patch design pseudocode

In addition to the workflow represented in figure J1 and described in the sections above, a pseudocode is given in the following.

## J.4. Patch elongation validation

We are now in position to provide a justification of this rather convoluted choice of patch construction for a given elongation. This is done on an example. Namely, we take again the very simple case study of section 5.3.3, except that we now vary the patch elongation parameter from 0 to 1.

Our choice of patch construction and elongation definition allows us to obtain a controlled result, as shown on Fig. J3. The relation displayed on this figure shows the relation between the elongation selected prior to the formation of the patch (expected elongation) and the elongation measured on the actual patch (measured elongation). This relation is an average over a large number of generated patches with the same expected elongation, in order to reduce statistical sources of noise. A nearly perfect equality between expected and measured elongations is obtained. The normalized standard deviation of all measured elongations is not represented but is very low (< 5 × 10⁻³). This nearly perfect relation between imposed and measured elongation implies that if some patch shape measure based on second order moments were included in the calibration process, our patch construction parameter would be essentially bias-free.

This justification does not uniquely select the procedure we have defined. We merely checked here that this procedure is satisfactory, not necessary.