Binary space partitioning generates hierarchical and rectilinear neutral landscape models suitable for human-dominated landscapes

Neutral landscape models are useful and popular tools for exploring effects of spatial patterns on ecological processes. Most neutral landscape models mimic natural landscape patterns that often consist of curved, complex, and sometimes fractal shapes. However, human-dominated landscapes often have a spatial rectilinear pattern that is highly aligned and dominated by straight lines and right angles. As existing rectilinear neutral landscape models lack controls over either the size, position, orientation, and shape of the rectilinear patches, or do not recognise the hierarchical structure of patch formation in human-dominated landscapes, our objective was to create a neutral landscape model capable of meeting these requirements. We present binary space partitioning as a method that generates hierarchical and rectilinear neutral landscape models. In doing so we explain how to control the size, position, orientation, and shape of the rectilinear patches, as well as generate a tree that records the hierarchical patch structure. Binary space partitioning succeeds in providing a simple, repeatable, process to generate a range of neutral landscape models for human-dominated landscapes. A large variety of landscape patterns can be efficiently produced from only a very small number of parameters. Binary space partitioning based neutral landscape models would be useful in representing many human-dominated landscapes. Their implementation is straightforward and should be easily understood, used, and developed by landscape ecologists.


Introduction
The neutral landscape model (NLM) is a virtual landscape generated by a computer algorithm, that was developed by landscape ecologists to explore the effects of spatial patterns on ecological processes free from the restrictions of real-world experimentation (Wang and Malanson 2008;Turner and Gardner 2015). For example, NLMs have been applied

Abstract
Context Neutral landscape models are useful and popular tools for exploring effects of spatial patterns on ecological processes. Most neutral landscape models mimic natural landscape patterns that often consist of curved, complex, and sometimes fractal shapes. However, human-dominated landscapes often have a spatial rectilinear pattern that is highly aligned and dominated by straight lines and right angles. Objectives As existing rectilinear neutral landscape models lack controls over either the size, position, orientation, and shape of the rectilinear patches, or do not recognise the hierarchical structure of patch formation in human-dominated landscapes, our objective was to create a neutral landscape model capable of meeting these requirements. to better understand: biological processes such as species abundance, distribution, and connectivity; physical processes such as wildfire risk and water and nutrient flow; and analytical methods such as landscape indices (for an extended list of NLM applications see: With and King 1997;Wang and Malanson 2008).
The ecological origin of NLMs means that most NLMs seek to mimic natural landscape patterns that often consist of curved, complex, and sometimes fractal shapes. However, in landscapes dominated by intense human urbanisation and cultivation a preference for straight lines and right angles, particularly when the topography is flat, produces rectilinear spatial patterns with aligned and parallel landscape features (Forman 1995). For example, in New Zealand agricultural subdivision of land from the late 1800s on the Canterbury plains has produced a landscape of often aligned rectangles (Fig. 1), and subdivision through urbanisation and afforestation has created similarly patterned landscapes (Cumberland 1981).
Perhaps because of a paucity of options for producing NLMs for human-dominated landscapes, NLMs that incorporate human processes such as urbanisation may use patterns of existing urban areas (Bierwagen 2007;Gardner and Urban 2007;Smets et al. 2019). This is not a problem when modelling focuses on issues of relevance to a specific location. However, when exploring landscape processes such as urban development in a general sense, using existing urban patterns will introduce analytical biases related to the city chosen. Consequently, a method for generating plausible NLMs is of general interest for urban modelling and could be used for NLMs in other human-dominated landscapes such as agricultural landscapes (Langhammer et al. 2019).
As well as shape, landscape patterns are usefully viewed in hierarchical sense, with processes operating at different spatial scales combining to produce an overall landscape pattern (Forman 1995;Turner and Gardner 2015). For example, in natural landscapes, geological processes acting at the macro-scale may provide an initial dominant restriction to forest patterns, these forest patterns are then affected by disturbance events operating at a meso-scale, before individual tree mortality affects patterns at the microscale (Urban et al. 1987;Turner and Gardner 2015). Hierarchical structures also exist in human-dominated landscapes such as cities (Batty 2008) and result from the iterative process of subdivision, as each round of subdivision and development is built on the outcome of previous rounds of subdivision and development (Morgan and O'Sullivan 2009;Wickramasuriya et al. 2013). This hierarchy is important to recognise as what happens to land at a lower hierarchical level will be affected by processes operating at a higher hierarchical level. For example, in a landscape consisting of farms that consist of fields, how an individual field will be used will be a result of decisions made not only at the level of the field, but also at the higher hierarchical levels of the farm and the wider landscape. Consequently, NLMs for human-dominated landscapes should not only be able to create a rectilinear spatial pattern, but the NLMs should also have internal hierarchical structure. Fig. 1 The Canterbury Plains of New Zealand are an extremely good example of a flat and intensely used landscape with a spatial rectilinear pattern that is highly aligned and dominated by straight lines and right angles Some rectilinear NLMs have been presented (Gustafson and Parker 1992;O'Neill et al. 1992;Ko et al. 2006;Le Ber et al. 2009), but these either lack controls over the size, position, orientation, and shape of the rectilinear patches, or do not recognise the hierarchical nature of the subdivision process (Table 1), all of which are important components of humandominated landscapes (Forman 1995). For example, the only existing hierarchical method (O'Neill et al. 1992) produces randomly located square patches with no ability to control patch position, shape, or orientation. We present binary space partitioning (BSP) as a method that generates hierarchical and rectilinear NLMs that provide additional functionality over existing techniques (Table 1) and therefore could be useful in representing many human-dominated landscapes.

Binary space partitioning as a neutral landscape model
BSP is a recursive, hierarchical partitioning (or subdivision) of an n-dimensional space into two subspaces that was developed for computer graphics (Fuchs et al. 1980). Application of BSP trees in a landscape context has been limited to the creation of urban spatial patterns as part of agent-based modelling (Morgan and O'Sullivan 2009). Here we extend this idea into a more general and flexible NLM form that would be applicable to any human-dominated landscape and show how a BSP NLM can be integrated within more natural landscapes.
To use BSP to create an NLM we apply BSP to a two-dimensional raster landscape such that the results conform to an existing general numerical framework for NLMs (Etherington et al. 2015). Within this raster landscape cells will be grouped into hierarchical patches. For example, in a hierarchy with three levels multiple cells would be grouped into patches representing land parcels, multiple land parcels would be grouped into properties, and multiple properties would be grouped into a landscape (Wickramasuriya et al. 2013).
The BSP process uses two data structures, the first of which is a raster (or two-dimensional array) for which the dimensions of the raster dictate the scale of the landscape in terms of the extent and grain (or resolution). Patches within the landscape are then defined as rectilinear groups of raster cells (or array elements) and when initialised the landscape consists of a single patch representing the whole landscape. The second data structure is a graph (or network), and more specifically a binary tree that consists of nodes (or vertices) connected by directed edges (or links) in which a parent node is connected to exactly two child nodes. When the BSP tree is initialised, the patch representing the whole landscape becomes the root node of the BSP tree as this root node has no parents and is the node from which the tree grows.
Having initialised the data structures, BSP proceeds by selecting a patch based on a random location within the landscape, so larger patches have a greater chance of being selected. Once selected, a patch is then partitioned to become the parent of two equally sized child patches. This partition occurs along the parent patch's longest dimension, or if the parent patch is square and has equal dimensions the direction of the partition is randomly selected. The BSP tree is then updated, with the randomly selected parent patch becoming a parent node for two child nodes that are the two partitioned child patches. This partitioning process is then repeated until a desired number of patches have been created. The patches in the final NLM are leaf nodes of the BSP tree, and these leaf nodes plus all parent nodes have a tree height that indicates their hierarchical level (Fig. 2).
The order in which spaces are partitioned via BSP will affect the outcome, so multiple equally valid results can be produced (Fuchs et al. 1980). This is a very useful property for NLMs as it means that for the same input parameters a variety of NLMs can be produced such that consistency in the effects of different spatial patterns resulting from the same spatial process can be assessed. The resulting NLMs all consist of rectilinear patches that tessellate together to form a landscape (Fig. 3), and the pattern of the rectilinear patches within the landscape has obvious parallels to real-world human-dominated landscapes (Fig. 1). What is also extremely important is that these patches can be grouped together at any hierarchical level based on their height within the BSP tree to mimic properties (Fig. 3).

Controlling patch orientation and shape
Thus far we have assumed that the orientation of the partition occurs along the parent patch's longest dimension, or if the parent patch is square and has equal dimensions the direction of the partition is randomly selected. This assumption can be relaxed, and the orientation of the partition could also occur randomly in either a horizontal or vertical direction. However, there will be occasions where the orientation of patches within a landscape will be biased towards one direction, such as the orientation of cultivated fields perpendicular to prevailing winds to reduce erosion (Forman 1995). Therefore, BSP NLMs could also be produced that partition the landscape in either a horizontal or vertical orientation. In addition to orientation, the length to width ratio of rectilinear patches will also vary between landscapes. While many urban landscapes have consisted of squares (Grant 2001) and some agricultural landscapes consist of extremely elongated rectangles (Wójcik and Leń 2015), most rectilinear patches have a length to width ratio between 1.5:1 and 4:1 (Forman 1995). By specifying a maximum length to width ratio, which must be at least 2:1 to allow a square to be partitioned, the orientation of each partition can be checked to ensure that patches conform to the desired shape. A smaller maximum length to width ratio will produce more compact squarer patches and a larger maximum length to width ratio when combined with a preferred orientation of partition can produce extremely elongated rectangular patches. By varying the preferred orientation and the maximum length to width ratio of the partitions a multitude of different rectilinear patterns can be created (Fig. 4).

Controlling patch location and size
The BSP process described thus far has a non-spatial partitioning process in that once selected every patch has the same probability p = 1 of being partitioned.
However, it would be helpful to have some means for BSP to recognise that a landscape will affect the environmental pattern produced. Such patterns can be implemented by a raster that defines how the probability of partitioning varies across space. The BSP process is then modified such that after being randomly selected, a patch is partitioned with a probability equal to the mean value of the probability surface within the patch. Such a process can produce patterns that use distance from a central location to mimic urban sprawl (Fig. 5a) or urban intensification (Fig. 5b), or by using a linear shape for the probability surface a pattern akin to roadside human development can be produced (Fig. 5c). The options here are essentially endless and could even make use of other NLMs to produce very complex patterns. For example, cities are known to have a fractal geometry (Batty 2008) therefore it is possible to even use fractal NLMs such as Perlin noise (Etherington et al. 2022) as the basis for defining the probability surface to create complex BSP patterns that have an underlying fractal form (Fig. 5d).

Further realism through NLM integration
Having developed BSP within a general numeric framework (Etherington et al. 2015) it is quite simple to integrate BSP with other NLMs such as Perlin Fig. 4 Examples of controlling the patch orientation and shape, rectilinear patch length to width ratio, of a binary space partitioning (BSP) neutral landscape model (NLM). All NLMs have 100 patches and the patches are hierarchically grouped at a BSP tree height h = 3, but the preferred partition orientation and the maximum length to width ratio have been specified differently in each case. a Partitioning along the longest dimen-sion and with a maximum length to width ratio of two, which represent default BSP. b Partitioning in a random orientation with a maximum length to width ratio of four. c Partitioning in a horizontal orientation with a maximum length to width ratio of four. d Partitioning in a vertical orientation with a maximum length to width ratio of eight noise (Etherington 2022) to achieve greater realism when required. For example, a Perlin noise NLM representing slope within an agricultural landscape could be used to vary rectilinear BSP patch orientation based on predominant slope within landscape regions (Fig. 6). Many landscape patterns have both natural and human components (Forman 1995). In this case, a Perlin noise NLM used to mimic elevation could form the basis of a series of natural land classes that follow an elevational gradient, but the elevation could also be used as the basis for a partition probability surface to generate BSP parcels above a certain BSP tree height that could form the basis of human land classes (Fig. 7). These examples illustrate that BSP NLMs can easily form components of more realistic NLMs.

Discussion
Rectilinear patterns and hierarchical structures are a fundamental component of many human-dominated landscapes (Forman 1995), and BSP can be used to generate hierarchical and rectilinear NLMs suitable for representing human-dominated landscapes. Examples of such rectilinear patterns occur globally across time and cultures (Grant 2001) and therefore we would expect BSP to be of enormous relevance for landscape modelling. The examples presented here illustrate quite clearly that using BSP can produce a wide range of landscape patterns that mimic the hierarchical structure and rectilinear shape of human-dominated landscapes. As in the case of NLMs more generally, the intention for the BSP approach is to generate realistic, but not representative, landscapes for further analysis. Therefore, while the resulting NLMs are not exact replicas of real-world landscapes, the inherent qualities of the BSP NLM results in an abstract but realistic representation of human-dominated landscapes that is suitable for use as templates for modelling. Also, the substantial flexibility in the resulting landscape patterns belies the small number of parameters used to control the creation of the NLMs. To this point, the BSP approach succeeds in providing a simple, repeatable, process to generate a range of NLMs for humandominated landscapes. By placing BSP in the general numeric framework of NLMs we can integrate and combine BSP NLMs with fractal NLMs to produce complex landscapes that integrate patterns resulting from both physical and human processes.
Although the BSP NLM provides the potential for additional controls to enhance landscape realism, we recognise realism needs to be balanced against generalism. NLMs create a controlled virtual experimental Given a a Perlin noise NLM representing landscape slopes, and b discrete landscape regions, for which c the mean slope is calculated. Then d three separate BSPs can be integrated together to produce a rectilinear NLM in which the patch orientation in each region is orthogonal to the predominate landscape slope direction Fig. 7 Example of integrating a binary space partitioning (BSP) neutral landscape model (NLM) and a fractal NLM. Given a a Perlin noise NLM used to create a digital elevation model, b a partition probability surface can be developed that biases partitioning towards lower elevations, from which c a BSP NLM can be created. An integrated NLM d can be cre-ated that is formed from either: natural land classes along an elevational gradient with curved and complex shapes (0 = bare rock, 1 = natural forest, 2 = unmanaged grassland); those BSP patches with a BSP tree height h ≥ 8 forming human land classes with rectilinear shapes (3 = arable, 4 = pasture) environment where potentially confounding factors can be excluded. Therefore, the purpose of NLMs is not to produce ultra-realistic reimaginings of existing landscapes, but rather virtual landscapes in which only the factors of interest to the question at hand will vary, so that very simple NLMs may often be sufficient (With and King 1997). In presenting BSP as a NLM we agree with (Turner and Gardner 2015, p. 89) that "No single NLM will be appropriate for all situations. Rather the NLM should be designed to provide the appropriate null hypotheses against which actual patterns may be tested". Therefore, while the additional realism BSP NLMs provide may be critically important for some studies, it may be an unnecessary complication for other studies that would be better using existing rectilinear NLMs (Table 1). The BSP algorithm also involves a greater number of parameters that must be understood and specified, and produces a BSP tree that requires an appreciation of graph theory concepts that define the hierarchical concepts of the method. However, graphs (or networks) have been used to represent landscape structure (Wang and Malanson 2008) so we do not foresee this additional requirement to be overly problematic. Therefore, we encourage landscape ecologists to consider the use of the BSP NLM alongside existing rectilinear NLMs when selecting a NLM that meets their study requirements. Funding Open Access funding enabled and organized by CAUL and its Member Institutions. This work was supported by the Strategic Science Investment Funding for Crown Research Institutes from the New Zealand Ministry of Business, Innovation and Employment's Science and Innovation Group. The authors would also like to thank Manaaki Whenua -Landcare Research and the University of Auckland for providing the financial resources for this research.
Data availability Not applicable, there is no data associated with this work.

Conflict of interest
The authors have no conflicts of interest or competing interests to declare.

Ethical approval Not applicable.
Consent to participate Not applicable.

Consent for publication Not applicable.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.