A method and system for adaptive generation of urban buildings based on OSM data
Patent Information
- Application Number
- CN202610826843.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-09-04
AI Technical Summary
传统的程序化建筑生成方法缺少针对这种情况的处理办法,直接根据地理数据生成城市场景经常会出现大面积的空白地块,降低虚拟城市的完整度,由此得到的结果也会缺少真实性和有效性
[0071] Traditional procedural urban building generation algorithms typically employ custom building footprints or rule-based building footprints, resulting in urban buildings that lack real-world significance. This invention uses OSM (Optical Character Set) data as the data source for the urban building generation algorithm, employing OSM vector information as input data. On one hand, OSM data is collected and uploaded by local volunteers, ensuring authenticity and reliability, and providing strong data support for scene creation. On the other hand, realistic urban scenes can provide an experimental platform for analysis, simulation, verification, testing, and optimization in scientific research requiring rigorous experimental environments, further expanding the application areas and practical value of procedural generation technology.
Smart Images

Figure CN122695142A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtual city construction technology, and in particular to a method and system for adaptive generation of urban buildings based on OSM data. Background Technology
[0002] In recent years, the rapid development of the digital economy has brought profound changes to all aspects of people's lives, including clothing, food, housing, and transportation. While enjoying the great convenience brought by digital experiences, it has also driven the emergence of digital applications like mushrooms after rain. Against this backdrop, virtual cities and digital assets are of great significance to many industries and are currently widely used in the film and video game industry, digital cultural heritage, urban phenomenon simulation, and interior and exterior design and planning. However, with the acceleration of urbanization, the scale and complexity of cities are constantly increasing. Reconstructing urban buildings through traditional manual modeling is not only time-consuming and labor-intensive, but also has a low reusability rate. The simple visual images produced are increasingly unable to meet people's needs and expectations, and ordinary small-scale production projects can hardly afford the cost of mass-producing digital assets.
[0003] With the continuous iteration of high-performance equipment and the rapid development of computer technology, procedural content generation (PCG) technology has become increasingly mature and has shown significant advantages in the production of large-scale scene resources. Therefore, for the reconstruction of cities, a highly complex system in terms of function and visuals, computer algorithms can be used for automatic generation, which greatly improves the efficiency and accuracy of virtual city construction. PCG technology has the following important characteristics: (1) Abstraction: Geometric and texture data are not directly specified as in the traditional sense, but their details are abstracted into an algorithm or a set of programs. The specific generation process is handled by the computer and called when needed. In this way, developers can easily manipulate model data with as few details as possible without having to understand the underlying implementation logic. (2) Parameter control: Defining and adjusting parameters directly corresponds to specific behaviors in procedural generation. Developers can define a large number of practical controls needed for artists to operate effectively. For example, in terrain algorithms, the number and size of mountains can be controlled by adjusting parameters, while in procedural spheres, the number of line segments can be controlled by adjusting parameters. (3) Flexibility: It can capture the essence of entities without explicitly limiting them to the scope of the real world. In practical applications, diverse results can be generated by changing parameters, and these results are not necessarily limited to the original model. These characteristics give PCG technology a natural advantage in creating virtual environments, significantly reducing the modeling workload required to create digital content, while enabling the production of more expansive, detailed, and realistic content.
[0004] Urban systems are typically large-scale and highly functional, serving multiple purposes, including practical (traffic regulations, accessibility, etc.), social (land zoning, etc.), and cultural (urban characteristics, public areas, etc.). Therefore, creating a virtual city requires consideration of multiple factors such as terrain, population density, socioeconomic factors, and transportation planning, involving knowledge from multiple disciplines. To make the procedurally generated building layouts more rational and realistic, using the OSM (OpenStreetMap) database as a data source for building information is an excellent solution. OSM is a free and open-access global geospatial database, its data primarily derived from contributions by map-making volunteers, and anyone can freely edit or download it. OSM geospatial data contains a very broad range of information, providing detailed descriptions of building data, including address name, building type, building footprint, building height, number of floors, etc., making it ideal as an input dataset for procedural model generation algorithms.
[0005] Currently, procedural generation technologies for urban buildings primarily consider urban land use, traffic models, and even surrogate models. For example, methods such as L-systems, tensor fields, and surrogate simulation generate urban building layouts through rule constraints and target settings, while simultaneously controlling building density and height using population density maps and topographic maps. This approach can generate a seemingly realistic urban building cluster, but the created building layout and style do not conform to actual design specifications, making it difficult to use in rigorous scientific experiments such as urban planning and simulation. Template-based and instance-based methods require collecting detailed data from real-world cities, using statistical feature information or derivational process models to generate scenarios with building layouts or land distributions similar to reality, thus simulating real-world cities. While these methods produce urban building clusters with a certain degree of realism, the results remain rigid, and the required pre-processing is complex and inefficient. Another group of procedural urban building generation algorithms using GIS data focuses more on processing and generating input data; however, they do not provide a good solution to the problem of missing building information, making it difficult to correct or adaptively generate low-quality input data, and the completeness of the resulting urban building cluster is difficult to guarantee.
[0006] As a crowdsourced geographic information project, the OSM geodatabase lacks a unified standard for data collection and uploading, relying primarily on volunteers for organization. Not all volunteers involved in data collection are geographic professionals, resulting in inconsistent data quality and redundancy, particularly a significant shortage of building data. Traditional procedural building generation methods lack solutions for this issue; directly generating city scenes from geographic data often results in large areas of blank land, reducing the completeness of the virtual city and leading to results lacking realism and validity. Summary of the Invention
[0007] To address the shortcomings and existing problems of traditional procedural building generation algorithms applied to OSM data, this invention proposes an adaptive urban building generation method and system based on OSM data, combining the characteristics of urban building layouts and the commonalities of buildings in the real world. Before reconstructing urban buildings, the missing parts of the OSM data are adaptively generated to improve the realism and completeness of virtual city reconstruction.
[0008] On the one hand, the present invention proposes an adaptive urban building generation method based on OSM data, which includes the following process:
[0009] Acquire OSM data and preprocess it to obtain road and building data for the target area;
[0010] Based on the road and building data of the target area, the target area is divided into built-up plots or blank plots, and the building footprints of the built-up plots are extracted.
[0011] The Douglas-Puk algorithm was used to thin out the boundary lines of all plots, resulting in simplified plot boundary lines.
[0012] Based on the simplified land parcel boundary lines, an improved binary space partitioning algorithm is used to adaptively partition vacant land parcels, dividing each vacant land parcel into several sub-parcels;
[0013] The improved binary space segmentation algorithm is as follows: extract the vertices of the plot to be segmented and construct the direction vector of each vertex; identify concave points by calculating the cross product of the direction vectors of adjacent vertices; use the symmetry axis of the oriented bounding box as the segmentation axis and determine the cutting direction based on the angle between the longest side of the plot boundary line and the segmentation axis; take concave points or random points on the longest side as cutting points, draw cutting lines along the cutting direction, and divide the plot to be segmented into two sub-plots; recursively execute the segmentation process for each sub-plot until the area of each sub-plot meets the preset conditions;
[0014] Sub-plots with an area smaller than the preset effective area threshold are marked as green space, and sub-plots with an area not less than the preset effective area threshold are marked as plots to be built.
[0015] A skeleton-based subdivision method is used to generate building footprints for plots of land to be built, based on a perimeter layout, and plots of land to be built with generated building footprints are marked as building plots.
[0016] Based on the building footprints of all building plots, pre-made 3D model instances are called using shape syntax to generate 3D building models for each building plot, and combined with green space to form urban buildings.
[0017] Furthermore, the specific method for acquiring OSM data and preprocessing it to obtain road and building data for the target area is as follows:
[0018] Acquire OSM data and determine the target region; wherein, the OSM data includes: geometry and attribute labels of the geometry;
[0019] Select geometries that cross the boundary of the target region from the OSM data. For any selected geometries, calculate the intersection of the outer frame of the geometries with the boundary of the target region.
[0020] Using the intersection point as the dividing point, delete the geometric primitives located outside the boundary of the target area, and retain the geometric primitives located within the boundary of the target area, thereby obtaining the clipped target area OSM data;
[0021] Based on the attribute labels of the geometry in the clipped target area OSM data, geometry belonging to roads or buildings is filtered out, thereby obtaining the road data and building data of the target area.
[0022] Furthermore, the specific method for dividing the target area into built-up plots or blank plots based on road and building data, and extracting the building footprints of the built-up plots, is as follows:
[0023] Based on the road data of the target area, the longest common subsequence algorithm is used to extract the main road axes of the target area and construct the road axis topology network of the target area;
[0024] A distance-based intersection segmentation method and a Boolean-based intersection axis reconstruction method are used to segment the road axis in the road axis topology network into intersection regions and road segment regions.
[0025] The intersection area and the road segment area are modeled in 3D and then stitched together to obtain the 3D road model of the target area.
[0026] Boolean difference operations are performed on the 3D road model of the ground plane and the target area to divide the target area into several plots;
[0027] Traverse the geometry in the building data of the target area. For the geometry being traversed, create a ray from the centroid of the geometry in the direction downward along the ground plane normal, and mark the plots that the ray touches as building plots.
[0028] After the traversal process is complete, all unmarked plots are treated as blank plots.
[0029] Furthermore, the specific method for using the Douglas-Puk algorithm to thin out the boundary lines of all plots to obtain simplified plot boundary lines is as follows:
[0030] For any plot of land, arrange the vertices of the plot's boundary line in order to obtain the vertex sequence of the plot, and set a distance threshold variable. , The value is used to control the sparsity of the curve vertices;
[0031] Traverse the vertex sequence of the plot, and denote the currently traversed vertex as a point. ;
[0032] Point Let the two adjacent vertices be denoted as points. and points and establish line segments The equation;
[0033] Calculation points to line segment distance ,like Then retain the point Conversely, delete the point. ;
[0034] After the traversal process is completed, the plot boundary lines will be re-established based on the vertices retained in each plot, serving as simplified plot boundary lines.
[0035] Furthermore, the specific method for adaptively dividing vacant plots into several sub-plots using an improved binary space partitioning algorithm based on the simplified plot boundary lines is as follows:
[0036] For any blank plot of land, take the blank plot as the root node and perform a binary space partitioning process to obtain two first-level sub-plots. Determine whether the area of each first-level sub-plot is less than the preset building land area threshold. If at least one first-level sub-plot has an area not less than the area threshold, then perform a binary space partitioning process on the first-level sub-plot that does not meet the area requirement to obtain the next-level sub-plot. Continue to determine whether the area of each next-level sub-plot is less than the preset building land area threshold until the area of all sub-plots is less than the preset building land area threshold. Take each obtained sub-plot as a branch node to build a binary space partitioning tree for the blank plot, and take the sub-plots corresponding to all leaf nodes in the binary space partitioning tree as several sub-plots after the blank plot is partitioned.
[0037] Furthermore, the binary space partitioning process is as follows:
[0038] For a plot of land to be divided, the vertices of the plot are extracted based on the plot boundary line, and a geometric point sequence of the plot is constructed; wherein the geometric point sequence is a sequence obtained by sorting all the extracted vertices in counterclockwise order.
[0039] In the geometric point sequence of this plot, the direction vector of the current vertex is obtained by subtracting the position coordinate vector of the current vertex from the position coordinate vector of the next vertex.
[0040] Calculate the cross product of the direction vector of the previous vertex and the direction vector of the current vertex. If the cross product is negative, the current vertex is considered to be a concave point. If the cross product is positive, the current vertex is considered to be a convex point. If the cross product is zero, the current vertex is considered to be neither a concave point nor a convex point. This gives us the sequence of concave points for the plot.
[0041] Based on the coordinates of all vertices of the plot, the bounding box algorithm is used to calculate the rectangular bounding box of the plot, and the two axes of symmetry of the bounding box are taken as the principal axes of the binary space partition, denoted as the principal axes. and spindle ;
[0042] Select the longest side of the land parcel's boundary lines, and calculate the relationship between the longest side and the principal axis. The included angle and the longest side and the principal axis The included angle And compare, and select the main axis direction with the larger included angle as the cutting direction;
[0043] Based on the concave point sequence of the plot, if there is a concave point on the longest side, the existing concave point is used as the cutting point; if there is no concave point, a point is randomly selected within the preset interval of the longest side as the cutting point.
[0044] Using the cutting point as one vertex of the cutting line, draw a ray along the cutting direction, determine the intersection points of the ray with all sides of the plot boundary line except the longest side, and select the first intersection point as the other vertex of the cutting line. Then, use the determined cutting line to divide the plot into two sub-plots.
[0045] Furthermore, the specific method for generating a building footprint based on a perimeter layout for a building site using a skeleton-based subdivision approach is as follows:
[0046] For each plot of land to be developed, perform the following procedure:
[0047] The polygon offset method based on angle bisectors is used to offset the boundary line of the plot to be built inward, extract the skeleton line segment of the plot to be built, and construct a skeleton line segment set.
[0048] Traverse the set of skeleton segments, delete skeleton segments that connect to the vertices of the building plot to be built, and for each deleted skeleton segment, find skeleton branch points along the skeleton segment; the skeleton branch point is the intersection of two or more skeleton segments.
[0049] Draw a perpendicular line from the branch point of the skeleton to the boundary line of the land parcel on one side of the vertex, and add this perpendicular line as a new skeleton line segment to the skeleton line segment set;
[0050] Dividing lines are added at equal intervals along the simplified boundary line of the blank plot to which the building to be built belongs. The skeleton line segments in the skeleton line segment set and the added dividing lines are used together as the subdivision grid of the building to be built. Each small plot divided by the subdivision grid is offset inward by a preset distance to obtain the building footprint of the building to be built in a perimeter layout.
[0051] Furthermore, the prefabricated 3D model instance is as follows: the city buildings are divided into several levels, and 3D model instances of different types of buildings are prefabricated according to the building type of each level.
[0052] Furthermore, the specific method for generating 3D building models for each building plot by using shape syntax to call pre-made 3D model instances based on the building footprints of all building plots, and combining this with the green space portion to form urban architecture, is as follows:
[0053] For the building footprint of any building plot, perform the following procedure:
[0054] According to the Lot rule, the building footprint is extruded upwards to the target height to generate a 3D block with the shape of the building footprint as its cross-section;
[0055] The Building rule is used to unfold and split the 3D block by face to obtain the building front, building side and building roof;
[0056] The front and side of the building are divided using the FrontFacade and SideFacade rules respectively. The front of the building is divided into the ground floor, middle floor and top floor according to the building height. A rock frame is laid between the floor tiles of the middle floor. The division height of the top floor is set to a floating value.
[0057] The floor tiles of each intermediate floor are horizontally split using the Floor rule, dividing the floor tiles into several sub-tiles; the bottom floor is horizontally split using the Groundfloor rule, dividing the bottom floor into several sub-tiles, and a main entrance is set on the bottom floor.
[0058] The EntranceTile rule and the Window, Door, and Wall rules are used to instantiate each sub-tile, and a 3D model instance is randomly called to replace the shape object of the sub-tile to obtain the 3D model of the building plot.
[0059] The architectural footprints of all building sites are traced and combined with green spaces to form urban architecture.
[0060] On the other hand, the present invention proposes an adaptive urban building generation system based on OSM data, the system comprising:
[0061] The data acquisition module is used to acquire OSM data and preprocess it to obtain road and building data for the target area.
[0062] The land parcel division module is used to divide the target area into several land parcels based on the road data of the target area;
[0063] The land parcel marking module is used to mark the divided land parcels as building parcels or blank parcels based on the building data of the target area, and to extract the building footprint of the building parcels from the building data of the target area.
[0064] The boundary simplification module is used to thin out the boundary lines of all plots using the Douglas-Puk algorithm to obtain simplified plot boundary lines.
[0065] The blank segmentation module is used to adaptively segment blank plots based on simplified plot boundaries using an improved binary space segmentation algorithm, dividing each blank plot into several sub-plots;
[0066] The green space filtering module is used to mark sub-plots with an area smaller than a preset effective area threshold as green space, and to mark sub-plots with an area not less than the preset effective area threshold as plots to be built.
[0067] The footprint generation module is used to generate building footprints in a perimeter layout for building plots to be built using a skeleton-based subdivision method, and to mark building plots to be built with generated building footprints as building plots.
[0068] The instance creation module is used to divide urban buildings into several levels and, based on the building type of each level, to pre-create 3D model instances of different types of buildings.
[0069] The building generation module is used to generate 3D models of buildings for each building plot by calling 3D model instances using shape syntax based on the building footprint of all building plots, and combining them with green space to form urban buildings.
[0070] The beneficial effects of adopting the above technical solution are as follows:
[0071] Traditional procedural urban building generation algorithms typically employ custom building footprints or rule-based building footprints, resulting in urban buildings that lack real-world significance. This invention uses OSM (Optical Character Set) data as the data source for the urban building generation algorithm, employing OSM vector information as input data. On one hand, OSM data is collected and uploaded by local volunteers, ensuring authenticity and reliability, and providing strong data support for scene creation. On the other hand, realistic urban scenes can provide an experimental platform for analysis, simulation, verification, testing, and optimization in scientific research requiring rigorous experimental environments, further expanding the application areas and practical value of procedural generation technology.
[0072] Considering that the lack of building information in OSM data severely impacts the effectiveness of urban reconstruction and scene completeness, this invention employs improved binary spatial segmentation and skeletal subdivision techniques to adaptively generate building footprints for blank plots in the event of OSM data deficiency. This compensates for the lack of building information in OSM data and reduces the impact of input data quality issues on the generated results. Furthermore, shape grammar is used to generate various urban buildings, creating a standardized, rational, and visually appealing urban scene.
[0073] Furthermore, OSM data makes the urban buildings generated using the method of this invention more realistic and reasonable, and can reconstruct urban building clusters in the real world. It can be applied to related simulation and scientific research and has practical value.
[0074] In summary, this invention generates urban buildings using an adaptive method, which can reduce the negative impact of input data quality issues on the procedural generation results, making the algorithm effective and fault-tolerant. At the same time, it improves the creation efficiency and visual effects of urban digital assets, enriches the details of procedural buildings, and expands the application areas of procedural methods. Attached Figure Description
[0075] Figure 1 This is a schematic diagram of an adaptive urban building generation method based on OSM data in this embodiment;
[0076] Figure 2 This is a flowchart of an adaptive urban building generation method based on OSM data in this embodiment;
[0077] Figure 3 This is a schematic diagram of the implementation steps of the skeleton-based subdivision method in this embodiment, where (a) is a schematic diagram of the skeleton-based subdivision process and (b) is a subdivision effect diagram;
[0078] Figure 4 This is a structural diagram of an adaptive urban building generation system based on OSM data in this embodiment. Detailed Implementation
[0079] To facilitate understanding of this application, specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments. The following embodiments are illustrative of the invention but are not intended to limit its scope. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application.
[0080] like Figure 1 As shown, the core algorithm of this invention mainly includes three core parts: adaptive building plot segmentation, building footprint generation, and building generation based on shape grammar. Specifically, firstly, the OSM data is preprocessed, with useless data pruned and removed to separate blank plots and building plots. Secondly, for blank plots, an improved binary space segmentation technique is used for adaptive building plot segmentation; then, a skeletal subdivision method is used to create building footprints based on the generated building plots. On the other hand, for complete plots with building information already provided in the OSM data, a simple data filtering method is used to filter out building data and remove redundant and overlapping building footprints from the OSM. Finally, building models in the city are generated and output based on shape grammar. To enrich the details of the buildings, this invention created various styles and types of building module instances during the experiment, allowing for rapid module replacement and iteration using the rules of shape grammar.
[0081] Example 1:
[0082] This embodiment provides an adaptive urban building generation method based on OSM data, such as... Figure 2 As shown, the method includes the following steps:
[0083] Obtain OSM data and preprocess it to obtain road and building data for the target area.
[0084] The specific method for acquiring OSM data and preprocessing it to obtain road and building data for the target area is as follows:
[0085] Obtain OSM data and determine the boundary range of the target area; wherein, the OSM data includes: geometry and attribute labels of the geometry.
[0086] In this embodiment, the OSM data file is essentially geospatial data stored in XML text format, comprising two parts: spatial data (i.e., geometry) and attribute data (i.e., attribute labels). The spatial data constitutes the entire map image through three elements: nodes (points), paths (linear features and region boundaries), and relationships (representing the ways in which elements are related). Attribute data consists of labels used to describe vector data primitives; each element uses a "label" to record the type of feature the data stores. OSM data storage is extensive and complex, exhibiting drawbacks such as content redundancy and inconsistent data quality. To reduce the frequency of unnecessary errors in subsequent modeling processes, preprocessing steps such as trimming, cleaning, and content classification are required before inputting the acquired OSM data into the procedural generation algorithm.
[0087] Select geometries that cross the boundary of the target region from the OSM data. For any selected geometries, calculate the intersection point of the geometries' outline with the boundary of the target region.
[0088] Using the intersection point as the dividing point, delete the geometric primitives located outside the target region boundary, and retain the geometric primitives located within the target region boundary, thus obtaining the clipped target region OSM data.
[0089] In this embodiment, a clipping algorithm is used to delete data and vector geometry outside the target area. Specifically, geometry that crosses the selection range is selected, and the intersection of its outer frame and the boundary line of the selection box (i.e., the target area) is calculated. Using this intersection as the dividing point, primitives outside the selection box are deleted, while those inside are retained.
[0090] Based on the attribute labels of the geometry in the clipped target area OSM data, geometry belonging to roads or buildings is filtered out, thereby obtaining the road data and building data of the target area.
[0091] In this embodiment, a geographic data hierarchy filter is created using attribute tags in OSM data. This filter categorizes the geometry in the OSM data into basic types such as rivers, lakes, highways, railways, and buildings. These basic types can be further subdivided into smaller categories. For example, highways can be further divided into expressways, arterial roads, secondary roads, local roads, auxiliary roads, and paths; buildings can be divided into residential areas, shopping malls, stations, airports, schools, and parks. The geographic data hierarchy filter allows users to directly select the desired OSM data for subsequent processing, removing unnecessary feature data (such as rivers, lakes, railways, and light rail).
[0092] Based on the road and building data of the target area, the target area is divided into built-up plots or blank plots, and the building footprints of the built-up plots are extracted.
[0093] The specific method for dividing the target area into built-up plots or blank plots based on road and building data, and extracting the building footprints of the built-up plots, is as follows:
[0094] Based on the road data of the target area, the longest common subsequence algorithm is used to extract the main road axes of the target area and construct the road axis topology network of the target area.
[0095] A distance-based intersection segmentation method and a Boolean-based intersection axis reconstruction method are used to segment the road axis topology network into intersection regions and road segment regions.
[0096] The intersection segmentation method based on distance detection is as follows: calculate the distance between any two road axis endpoints in the road axis topology network; when the distance between at least three road axis endpoints is within a preset threshold range, the area where the at least three road axis endpoints are located is determined as an intersection area.
[0097] The intersection axis reconstruction method based on Boolean calculation is as follows: For any intersection area, perform a Boolean union operation on the road axes within the intersection area to merge them into an intersection area; extract the boundary of the intersection area, and cut off each road axis entering the intersection area at the boundary; include the road axes located within the intersection area into the intersection area, and the road axes located outside the intersection area as road segment areas.
[0098] The intersection area and the road segment area are modeled in 3D and then stitched together to obtain the 3D road model of the target area.
[0099] Boolean difference operations are performed on the ground plane and the 3D road model of the target area to divide the target area into several plots.
[0100] In this embodiment, the OSM road data is first processed, and the Longest Common Subsequence (LCSS) algorithm is used to extract the main road axes, constructing a topological network of urban road axes. Then, a distance-based intersection segmentation method and a Boolean-based intersection axis reconstruction method are used to segment the road axes into intersection regions and road segment regions. Next, different geometric calculations and program instructions are applied to the two regions to create 3D road models. Finally, a difference operation is performed between the ground plane and the 3D road model to obtain the land parcel plane segmented by the roads.
[0101] Traverse the geometry in the building data of the target area. For the geometry being traversed, create a ray from the centroid of the geometry in the direction downward along the ground plane normal, and mark the plots that the ray touches as building plots.
[0102] After the traversal process is complete, all unmarked plots are treated as blank plots.
[0103] In this embodiment, the process of detecting blank plots is as follows: Iterate through the building geometry provided in the OSM data, create a ray downwards from the centroid of the geometry, and mark the plots detected by the ray. Plots that remain unmarked after the entire loop is completed are considered blank plots.
[0104] In this embodiment, valid building data is filtered out based on building attribute tags in the building data. For example, building outlines with an area not less than a preset threshold are filtered out, building data corresponding to attribute tags marked as invalid are deleted, and vertex thinning is performed on the filtered building outlines to obtain the building footprint of the building plot, thereby achieving the redundancy clearing of the building footprint.
[0105] The Douglas-Puk algorithm was used to thin out the boundary lines of all plots, resulting in simplified plot boundary lines.
[0106] Since the nodes of the land parcel boundary lines obtained by difference operations are very dense, which is not conducive to the implementation of subsequent land parcel segmentation algorithms, this embodiment uses the Douglas-Peucker (DP) algorithm to thin out the boundary lines of the land parcels and reduce the vertex density.
[0107] The specific method for using the Douglas-Puk algorithm to thin out the boundary lines of all plots to obtain simplified plot boundary lines is as follows:
[0108] For any plot of land, arrange the vertices of the plot's boundary line in order to obtain the vertex sequence of the plot, and set a distance threshold variable. , The value is used to control the sparsity of the curve vertices;
[0109] Traverse the vertex sequence of the plot, and denote the currently traversed vertex as a point. ,point The coordinates are ;
[0110] Point Let the two adjacent vertices be denoted as points. and points ,point The coordinates are ,point The coordinates are and establish line segments The equation;
[0111] The line segment The equation is expressed as:
[0112] (1)
[0113] in, and All are variables.
[0114] Calculation points to line segment distance ,like Then retain the point Conversely, delete the point. ;
[0115] In this embodiment, the calculation point to line segment distance , represented as:
[0116] (2)
[0117] if This explains the point. The contribution to the curve is significant, so points need to be retained. ;if This explains the point. Its contribution to the curve is very small, so it can be deleted directly.
[0118] After the traversal process is completed, the plot boundary lines will be re-established based on the vertices retained in each plot, serving as simplified plot boundary lines.
[0119] In this embodiment, after iterating through all vertices of the land parcel boundary line, nodes with minor contributions to the curve have been deleted, leaving only key nodes that significantly influence the curve, thus completing the curve thinning process. This results in a concise and clear land parcel boundary line.
[0120] Based on the simplified land parcel boundary lines, an improved binary space partitioning algorithm is used to adaptively partition vacant land parcels, dividing each vacant land parcel into several sub-parcels;
[0121] The improved binary space segmentation algorithm is as follows: extract the vertices of the plot to be segmented and construct the direction vector of each vertex. Identify concave points by calculating the cross product of the direction vectors of adjacent vertices. Use the symmetry axis of the oriented bounding box as the segmentation axis and determine the cutting direction based on the angle between the longest side of the plot boundary line and the segmentation axis. Take a concave point or random point on the longest side as the cutting point and draw a cutting line along the cutting direction to divide the plot to be segmented into two sub-plots. Recursively execute the segmentation process for each sub-plot until the area of each sub-plot meets the preset conditions.
[0122] This embodiment slightly improves the binary space partitioning algorithm, no longer applying it to three-dimensional space, but instead partitioning a two-dimensional plane (i.e., blank plots). Simultaneously, it updates the rules and conditions for algorithm iteration until the area of the partitioned sub-plots meets the requirements for building generation, at which point recursion stops. A tree structure is then constructed, with the partitioned sub-polygons stored in the tree's nodes; all polygons located in the subspace reside in their respective subtrees.
[0123] The specific method for adaptively dividing vacant plots into several sub-plots using an improved binary space partitioning algorithm based on simplified plot boundaries is as follows:
[0124] For any blank plot of land, take the blank plot as the root node and perform a binary space partitioning process to obtain two first-level sub-plots. Determine whether the area of each first-level sub-plot is less than the preset building land area threshold. If at least one first-level sub-plot has an area not less than the area threshold, then perform a binary space partitioning process on the first-level sub-plot that does not meet the area requirement to obtain the next-level sub-plot. Continue to determine whether the area of each next-level sub-plot is less than the preset building land area threshold until the area of all sub-plots is less than the preset building land area threshold. Take each obtained sub-plot as a branch node to build a binary space partitioning tree for the blank plot, and take the sub-plots corresponding to all leaf nodes in the binary space partitioning tree as several sub-plots after the blank plot is partitioned.
[0125] In this embodiment, a blank plot of land is first taken as the root node. The plot is then divided into two sub-plots using a binary tree partitioning process, and these sub-plots are set as branch nodes of the binary tree. Next, it is determined whether the area of the sub-plots meets the requirements for building land area. Based on plot attributes and experience, this embodiment categorizes the building types for the blank area into three types: super high-rise buildings, commercial buildings, and residential buildings. The area threshold for super high-rise building plots is [not specified]. The threshold for the area of commercial building plots is set as follows: The threshold for the land area of residential buildings is set as follows: The threshold is a random value between the given area and the target area. If the area of a sub-plot is less than the set area threshold, the splitting process stops, and the current branch node is changed to a leaf node; otherwise, the splitting process is repeated for the sub-plots until all plots meet the area requirement. The threshold generated by the random parameter can make the binary splitting results more varied.
[0126] The binary space partitioning process is as follows:
[0127] For a plot of land to be divided, the vertices of the plot are extracted based on the plot boundary line, and a geometric point sequence of the plot is constructed; wherein the geometric point sequence is a sequence obtained by sorting all the extracted vertices in counterclockwise order.
[0128] In this embodiment, 5 vertices are used. Taking a blank plot of land as an example, the vertices of the irregular polygons of the blank plot are sorted in counterclockwise order to obtain the geometric point sequence of the blank plot, denoted as . .
[0129] In the geometric point sequence of this plot, the direction vector of the current vertex is obtained by subtracting the position coordinate vector of the current vertex from the position coordinate vector of the next vertex.
[0130] Calculate the cross product of the direction vector of the previous vertex and the direction vector of the current vertex. If the cross product is negative, the current vertex is considered a concave point. If the cross product is positive, the current vertex is considered a convex point. If the cross product is zero, the current vertex is considered neither a concave nor a convex point. This process yields the sequence of concave points for the plot.
[0131] In this embodiment, the concavity / convexity of the edge points of the blank plot is calculated using the geometric point sequence of the blank plot. Specifically, in the geometric point sequence of the blank plot, the normalized unit vector obtained by subtracting the position coordinate vector of the current vertex from the position coordinate vector of the next vertex is the direction vector of the current vertex. For example, The direction vector of the point is , The direction vector of the point is , The direction vector of the point is The concavity / convexity of the current node is determined by calculating the cross product of the direction vectors; The point is the current node, calculate The direction vector of the point and The cross product of the direction vectors of a point is expressed as:
[0132] (3)
[0133] in, Direction vector The model; Direction vector The model; Direction vector With direction vector The included angle; Direction vector The coordinate components; Direction vector The coordinate components.
[0134] if If the value is negative, it means exist Counterclockwise direction, The point is a concave point; if If the value is positive, then it means exist Clockwise direction The point is a convex point; if If the value of is zero, then the two vectors lie on the same straight line and are neither concave nor convex points. From this, the sequence of concave points in the vertices of the land parcel boundary can be obtained.
[0135] Based on the coordinates of all vertices of the plot, the bounding box algorithm is used to calculate the rectangular bounding box of the plot, and the two axes of symmetry of the bounding box are taken as the principal axes of the binary space partition, denoted as the principal axes. and spindle .
[0136] In this embodiment, based on the vertex coordinates of the blank plot, the Oriented Bounding Box (OBB) algorithm is used to calculate the smallest rectangular region that encloses the blank plot, i.e., the rectangular bounding box of the blank plot. The two axes of symmetry of this rectangular bounding box are used as the principal axes of the binary space partitioning.
[0137] Select the longest side of the land parcel's boundary lines, and calculate the relationship between the longest side and the principal axis. The included angle and the longest side and the principal axis The included angle By comparing the results, the direction of the main axis with the larger included angle is selected as the cutting direction.
[0138] Based on the concave point sequence of the plot, if there is a concave point on the longest side, the existing concave point is used as the cutting point; otherwise, a point is randomly selected within the preset interval of the longest side as the cutting point.
[0139] Using the cutting point as one vertex of the cutting line, draw a ray along the cutting direction, determine the intersection points of the ray with all sides of the plot boundary line except the longest side, and select the first intersection point as the other vertex of the cutting line. Then, use the determined cutting line to divide the plot into two sub-plots.
[0140] In this embodiment, the blank plot is divided into two subplots. Specifically, the boundary lines of the blank plot are traversed, the longest edge is selected, and the angle between this edge and the two principal axes is calculated. The direction of the principal axis with the larger angle to the longest edge is taken as the cutting direction. A point is randomly selected between 0.4 and 0.6 of the length of the longest edge as the cutting point, and the cutting line is determined. The intersection points between the cutting line and the other boundary lines of the current plot are calculated, and the first intersection point is selected as the other vertex of the cutting line segment. At this time, it is necessary to check whether there is a concave point on the contour line segment where the cutting point is located. If there is, the concave point is directly used as the cutting point to achieve cutting point offset. Finally, the initial blank plot is divided into two subplots by the dividing line.
[0141] Sub-plots with an area smaller than the preset effective area threshold are marked as green space, and sub-plots with an area not less than the preset effective area threshold are marked as plots to be built.
[0142] Because the original blank plots are irregularly shaped, dividing them into two-way spatial segments will result in small, fragmented building blocks. Some blank plots are so small that they do not meet the segmentation threshold and are not suitable for procedural building generation. Therefore, in this embodiment, these "fragments" are divided into green areas; and the sub-plots that meet the effective area requirements are divided into building plots to be built with the building footprint to be generated.
[0143] A skeleton-based subdivision method is used to generate building footprints for plots of land to be built, based on a perimeter layout, and plots of land to be built with generated building footprints are marked as building plots.
[0144] Architectural layouts in real life are diverse, but the most typical patterns fall into three main categories. The first is a flat layout where buildings are laid out on a plot of land, spontaneously forming internal roads; this is called a flat layout. Residential communities are a typical example of this, with buildings arranged relatively neatly, and pathways spontaneously forming between each building. The second is a ring-shaped layout where buildings face one side of the road; this is called a perimeter layout. Thanks to standardized urban planning systems, perimeter layouts are common in many Western cities after the Renaissance, with Barcelona being a prime example in contemporary cities. The third is a layout where the entire plot of land is not divided but developed as a whole; this is called a freestanding layout. Some super-tall buildings and important buildings (such as government buildings, parks, schools, and hospitals) primarily adopt the freestanding layout, and these buildings generally occupy a large area.
[0145] like Figure 3 As shown, for each plot of land to be developed, the following procedure is performed:
[0146] The polygon offset method based on angle bisectors is used to offset the boundary line of the plot to be built inward, extract the skeleton line segments of the plot, and construct a set of skeleton line segments.
[0147] Traverse the set of skeleton segments, delete skeleton segments that connect to the vertices of the building plot to be built, and for each deleted skeleton segment, find skeleton branch points along the skeleton segment; the skeleton branch point is the intersection of two or more skeleton segments.
[0148] Draw a perpendicular line from the branch point of the skeleton to the boundary line of the land parcel on one side of the vertex, and add this perpendicular line as a new skeleton segment to the skeleton segment set.
[0149] Dividing lines are added at equal intervals along the simplified boundary line of the blank plot to which the building to be built belongs. The skeleton line segments in the skeleton line segment set and the added dividing lines are used together as the subdivision grid of the building to be built. Each small plot divided by the subdivision grid is offset inward by a preset distance to obtain the building footprint of the building to be built in a perimeter layout.
[0150] In this embodiment, as Figure 2 As shown, a polygon inward offset method based on angle bisectors is used to uniformly extend and offset the edge lines of the plot plane inward, extracting the skeleton segments of the plot. Skeleton segments connecting to the corner points (i.e., the vertices of the plot) are deleted. Simultaneously, skeleton branch points are found along the deleted skeleton segments. A perpendicular line is drawn from the skeleton branch point to the edge line of the plot on one side of the corner point, and this perpendicular line is added as a new dividing line segment to the skeleton segment set. This yields a rough plot layout divided by the corrected skeleton. Dividing lines are added equidistantly along the edge lines of the initial blank plots, further subdividing the plots. Then, the resulting smaller plots are squeezed inward between buildings with appropriate spacing, ultimately resulting in a perimeter-arranged building footprint.
[0151] Based on the building footprints of all building plots, pre-made 3D model instances are called using shape syntax to generate 3D building models for each building plot, and combined with green space to form urban buildings.
[0152] The prefabricated 3D model example is as follows: the city buildings are divided into several levels, and 3D model examples of different types of buildings are prefabricated according to the building type of each level.
[0153] Urban buildings often share many identical windows and facades. Therefore, this embodiment divides the urban building facade into three levels based on the similarity of the building modules: the bottom level is the first floor of the building, typically including walls, doors, steps, windows, etc.; the middle level is the second to the top floor of the building, typically consisting of walls, windows, balconies, air conditioners, etc.; and the top level is the roof of the building, mainly including four types: flat roof, pitched roof, curved roof, and multi-wave folded plate roof, as well as the facilities on the roof. Furthermore, corresponding 3D model instances are created according to the different model types for each level of the building.
[0154] In this embodiment, the building footprint generated by the adaptive algorithm and the building footprint provided by OSM are merged, and the three-dimensional model of the building is generated using shape grammar.
[0155] The specific method for generating 3D building models for each building plot by using shape syntax to call pre-made 3D model instances based on the building footprints of all building plots, and combining them with green space portions to form urban architecture, is as follows:
[0156] For the building footprint of any building plot, perform the following procedure:
[0157] According to the Lot rule, the building footprint is extruded upwards to the target height, generating a 3D block with the shape of the building footprint as its cross-section.
[0158] The 3D block is split by face using the Building rule to obtain the building's front, side, and roof.
[0159] The front and side of the building are divided using the FrontFacade and SideFacade rules respectively. The front of the building is divided into the ground floor, middle floor and top floor according to the building height. A rock frame is laid between the floor tiles of the middle floor. The division height of the top floor is set to a floating value.
[0160] The floor tiles of each intermediate floor are horizontally split using the Floor rule, dividing the floor tiles into several sub-tiles; the bottom floor is horizontally split using the Groundfloor rule, dividing the bottom floor into several sub-tiles, and a main entrance is set on the bottom floor.
[0161] Each sub-tile is instantiated using the EntranceTile rule and the Window, Door, and Wall rules, and a 3D model instance is randomly called to replace the shape object of the sub-tile, thus obtaining the 3D model of the building plot.
[0162] The architectural footprints of all building sites are traced and combined with green spaces to form urban architecture.
[0163] The Lot, Building, FrontFacade, SideFacade, Floor, Groundfloor, EntranceTile, Window, Door, and Wall rules mentioned above are all shape syntax.
[0164] In this embodiment, the building footprint is extruded upwards to the target height according to the Lot rule, generating a 3D block with the shape of the building footprint as its cross-section. The Building rule is used to split this 3D block into three distinct parts: the Front (the building's front face), the Side (multiple sides of the building), and the Root (the roof). Since the building footprint of the site to be built is distributed, the building's front face, formed by this footprint, faces the road. The FrontFacade and SideFacade rules are used to segment the building's front and sides respectively. The building's front face is divided into three levels based on its height: bottom, middle, and top. A scaffold is laid between the middle levels as a transition. The top level's segmentation height is set to a floating value. If the segmentation to the last level is insufficient for the standard height of the middle levels, the remaining face is set as the roof; if it can be completely divided, no roof style is set, and a flat roof without thickness is directly generated. The Floor and Groundfloor rules are used to split the floor tiles. The Floor rule performs a splitting operation on the middle layer, making each split tile approximately 3 meters wide. Generally, to make the floors more realistic, a 1-meter-wide wall element is split. The Groundfloor rule is similar to the Floor rule, the only difference being that it applies to the ground floor, creating the main entrance on the first floor. If needed, the Tile rule can be used to further refine the elements of the split tiles. The EntranceTile rule, along with the Window, Door, and Wall rules, are instantiation rules for each building module, replacing the shape objects of entrances, windows, doors, and walls with the corresponding model resources. In this part, translation, rotation, and scaling transformations can be used to adjust the posture of the model resources, and then the corresponding 3D model is inserted into the area of the current shape using an insertion operation, completing the creation of the entire building. By traversing all building footprints and generating city buildings through the above steps, and using a random method to select building model instances, diverse building forms can be generated, creating a very realistic building cluster.
[0165] Example 2:
[0166] This embodiment provides an adaptive urban building generation system based on OSM data, such as... Figure 4 As shown, the system includes:
[0167] The data acquisition module is used to acquire OSM data and preprocess it to obtain road and building data for the target area.
[0168] The land parcel division module is used to divide the target area into several land parcels based on the road data of the target area.
[0169] The land parcel marking module is used to mark the divided land parcels as building parcels or blank parcels based on the building data of the target area, and to extract the building footprint of the building parcels from the building data of the target area.
[0170] The boundary simplification module is used to thin out the boundary lines of all plots using the Douglas-Puk algorithm, resulting in simplified plot boundary lines.
[0171] The blank segmentation module is used to adaptively segment blank plots based on simplified plot boundaries using an improved binary space segmentation algorithm, dividing each blank plot into several sub-plots.
[0172] The green space filtering module is used to mark sub-plots with an area smaller than a preset effective area threshold as green space, and to mark sub-plots with an area not less than the preset effective area threshold as plots to be built.
[0173] The footprint generation module is used to generate building footprints for building plots to be built in a perimeter layout using a skeleton-based subdivision method, and to mark building plots with generated building footprints as building plots.
[0174] The instance creation module is used to divide urban buildings into several levels and, based on the building type of each level, to pre-create 3D model instances of different types of buildings.
[0175] The building generation module is used to generate 3D models of buildings for each building plot by calling 3D model instances using shape syntax based on the building footprint of all building plots, and combining them with green space to form urban buildings.
[0176] Example 3:
[0177] This embodiment proposes an electronic device, including: one or more processors, and a memory, the memory being used to store instructions, which, when executed by the one or more processors, cause the one or more processors to execute the adaptive urban building generation method based on OSM data.
[0178] The electronic device may be a mobile phone, computer, or tablet computer, etc., and includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements the adaptive urban building generation method based on OSM data as described in the embodiments. It is understood that the electronic device may also include input / output (I / O) interfaces and communication components.
[0179] The processor is used to execute all or part of the steps in the OSM data-based adaptive urban building generation method as described in the above embodiments. The memory is used to store various types of data, which may include, for example, instructions for any application or method in an electronic device, as well as application-related data.
[0180] The processor can be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to execute the adaptive urban building generation method based on OSM data described in the above embodiments.
[0181] Example 4:
[0182] This embodiment proposes a computer-readable storage medium that stores executable instructions. When these instructions are executed, if they are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0183] The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the adaptive generation method for urban buildings based on OSM data described in the various embodiments of this application.
[0184] The aforementioned storage media include: flash memory, hard disk, multimedia card, card-type memory (e.g., SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR) memory), random access memory (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, disk, optical disk, server, APP (Application) application store, and other media capable of storing program verification codes. These media store computer programs, which, when executed by a processor, can implement the various steps of the aforementioned adaptive urban building generation method based on OSM data.
[0185] Example 5:
[0186] This embodiment proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the aforementioned adaptive generation method for urban buildings based on OSM data.
[0187] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a computer program product.
[0188] The various embodiments in this application are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0189] The scope of protection of this application is not limited to the embodiments described above. Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from the scope and spirit of this disclosure. If such modifications and variations fall within the scope of this disclosure and its equivalents, then the intent of this disclosure also includes these modifications and variations.
Claims
1. A method for adaptive generation of urban buildings based on OSM data, characterized in that, This method includes the following steps: Acquire OSM data and preprocess it to obtain road and building data for the target area; Based on the road and building data of the target area, the target area is divided into built-up plots or blank plots, and the building footprints of the built-up plots are extracted. The Douglas-Puk algorithm was used to thin out the boundary lines of all plots, resulting in simplified plot boundary lines. Based on the simplified land parcel boundary lines, an improved binary space partitioning algorithm is used to adaptively partition vacant land parcels, dividing each vacant land parcel into several sub-parcels; The improved binary space segmentation algorithm is as follows: extract the vertices of the plot to be segmented and construct the direction vector of each vertex; identify concave points by calculating the cross product of the direction vectors of adjacent vertices; use the symmetry axis of the oriented bounding box as the segmentation axis and determine the cutting direction based on the angle between the longest side of the plot boundary line and the segmentation axis; take concave points or random points on the longest side as cutting points, draw cutting lines along the cutting direction, and divide the plot to be segmented into two sub-plots; recursively execute the segmentation process for each sub-plot until the area of each sub-plot meets the preset conditions; Sub-plots with an area smaller than the preset effective area threshold are marked as green space, and sub-plots with an area not less than the preset effective area threshold are marked as plots to be built. A skeleton-based subdivision method is used to generate building footprints for plots of land to be built, based on a perimeter layout, and plots of land to be built with generated building footprints are marked as building plots. Based on the building footprints of all building plots, pre-made 3D model instances are called using shape syntax to generate 3D building models for each building plot, and combined with green space to form urban buildings.
2. The adaptive urban building generation method based on OSM data according to claim 1, characterized in that, The specific method for acquiring OSM data and preprocessing it to obtain road and building data for the target area is as follows: Acquire OSM data and determine the target region; wherein, the OSM data includes: geometry and attribute labels of the geometry; Select geometries that cross the boundary of the target region from the OSM data. For any selected geometries, calculate the intersection of the outer frame of the geometries with the boundary of the target region. Using the intersection point as the dividing point, delete the geometric primitives located outside the boundary of the target area, and retain the geometric primitives located within the boundary of the target area, thereby obtaining the clipped target area OSM data; Based on the attribute labels of the geometry in the clipped target area OSM data, geometry belonging to roads or buildings is filtered out, thereby obtaining the road data and building data of the target area.
3. The adaptive urban building generation method based on OSM data according to claim 2, characterized in that, The specific method for dividing the target area into built-up plots or blank plots based on road and building data, and extracting the building footprints of the built-up plots, is as follows: Based on the road data of the target area, the longest common subsequence algorithm is used to extract the main road axes of the target area and construct the road axis topology network of the target area; A distance-based intersection segmentation method and a Boolean-based intersection axis reconstruction method are used to segment the road axis in the road axis topology network into intersection regions and road segment regions. The intersection area and the road segment area are modeled in 3D and then stitched together to obtain the 3D road model of the target area. Boolean difference operations are performed on the 3D road model of the ground plane and the target area to divide the target area into several plots; Traverse the geometry in the building data of the target area. For the geometry being traversed, create a ray from the centroid of the geometry in the direction downward along the ground plane normal, and mark the plots that the ray touches as building plots. After the traversal process is complete, all unmarked plots are treated as blank plots.
4. The adaptive urban building generation method based on OSM data according to claim 3, characterized in that, The specific method for using the Douglas-Puk algorithm to thin out the boundary lines of all plots to obtain simplified plot boundary lines is as follows: For any plot of land, arrange the vertices of the plot's boundary line in order to obtain the vertex sequence of the plot, and set a distance threshold variable. , The value is used to control the sparsity of the curve vertices; Traverse the vertex sequence of the plot, and denote the currently traversed vertex as a point. ; Point Let the two adjacent vertices be denoted as points. and points And establish line segments The equation; Calculation points to line segment distance ,like Then retain the point Conversely, delete the point. ; After the traversal process is completed, the plot boundary lines will be re-established based on the vertices retained in each plot, serving as simplified plot boundary lines.
5. The adaptive generation method for urban buildings based on OSM data according to claim 4, characterized in that, The specific method for adaptively dividing vacant plots into several sub-plots using an improved binary space partitioning algorithm based on simplified plot boundaries is as follows: For any blank plot of land, take the blank plot as the root node and perform a binary space partitioning process to obtain two first-level sub-plots. Determine whether the area of each first-level sub-plot is less than the preset building land area threshold. If at least one first-level sub-plot has an area not less than the area threshold, then perform a binary space partitioning process on the first-level sub-plot that does not meet the area requirement to obtain the next-level sub-plot. Continue to determine whether the area of each next-level sub-plot is less than the preset building land area threshold until the area of all sub-plots is less than the preset building land area threshold. Take each obtained sub-plot as a branch node to build a binary space partitioning tree for the blank plot, and take the sub-plots corresponding to all leaf nodes in the binary space partitioning tree as several sub-plots after the blank plot is partitioned.
6. The adaptive generation method for urban buildings based on OSM data according to claim 5, characterized in that, The binary space partitioning process is as follows: For a plot of land to be divided, the vertices of the plot are extracted based on the plot boundary line, and a geometric point sequence of the plot is constructed; wherein the geometric point sequence is a sequence obtained by sorting all the extracted vertices in counterclockwise order. In the geometric point sequence of this plot, the direction vector of the current vertex is obtained by subtracting the position coordinate vector of the current vertex from the position coordinate vector of the next vertex. Calculate the cross product of the direction vector of the previous vertex and the direction vector of the current vertex. If the cross product is negative, the current vertex is considered to be a concave point. If the cross product is positive, the current vertex is considered to be a convex point. If the cross product is zero, the current vertex is considered to be neither a concave point nor a convex point. This gives us the sequence of concave points for the plot. Based on the coordinates of all vertices of the plot, the bounding box algorithm is used to calculate the rectangular bounding box of the plot, and the two axes of symmetry of the bounding box are taken as the principal axes of the binary space partition, denoted as the principal axes. and spindle ; Select the longest side of the land parcel's boundary lines, and calculate the relationship between the longest side and the principal axis. The included angle and the longest side and the principal axis The included angle And compare, and select the main axis direction with the larger included angle as the cutting direction; Based on the concave point sequence of the plot, if there is a concave point on the longest side, the existing concave point is used as the cutting point; if there is no concave point, a point is randomly selected within the preset interval of the longest side as the cutting point. Using the cutting point as one vertex of the cutting line, draw a ray along the cutting direction, determine the intersection points of the ray with all sides of the plot boundary line except the longest side, and select the first intersection point as the other vertex of the cutting line. Then, use the determined cutting line to divide the plot into two sub-plots.
7. The adaptive generation method for urban buildings based on OSM data according to claim 6, characterized in that, The specific method for generating a perimeter-based building footprint for a site to be developed using a skeleton-based subdivision approach is as follows: For each plot of land to be developed, perform the following procedure: The polygon offset method based on angle bisectors is used to offset the boundary line of the plot to be built inward, extract the skeleton line segment of the plot to be built, and construct a skeleton line segment set. Traverse the set of skeleton segments, delete skeleton segments that connect to the vertices of the building plot to be built, and for each deleted skeleton segment, find skeleton branch points along the skeleton segment; the skeleton branch point is the intersection of two or more skeleton segments. Draw a perpendicular line from the branch point of the skeleton to the boundary line of the land parcel on one side of the vertex, and add this perpendicular line as a new skeleton line segment to the skeleton line segment set; Dividing lines are added at equal intervals along the simplified boundary line of the blank plot to which the building to be built belongs. The skeleton line segments in the skeleton line segment set and the added dividing lines are used together as the subdivision grid of the building to be built. Each small plot divided by the subdivision grid is offset inward by a preset distance to obtain the building footprint of the building to be built in a perimeter layout.
8. The adaptive generation method for urban buildings based on OSM data according to claim 7, characterized in that, The prefabricated 3D model example is as follows: the city buildings are divided into several levels, and 3D model examples of different types of buildings are prefabricated according to the building type of each level.
9. The adaptive generation method for urban buildings based on OSM data according to claim 8, characterized in that, The specific method for generating 3D building models for each building plot by using shape syntax to call pre-made 3D model instances based on the building footprints of all building plots, and combining them with green space portions to form urban architecture, is as follows: For the building footprint of any building plot, perform the following procedure: According to the Lot rule, the building footprint is extruded upwards to the target height to generate a 3D block with the shape of the building footprint as its cross-section; The Building rule is used to unfold and split the 3D block by face to obtain the building front, building side and building roof; The front and side of the building are divided using the FrontFacade and SideFacade rules respectively. The front of the building is divided into the ground floor, middle floor and top floor according to the building height. A rock frame is laid between the floor tiles of the middle floor. The division height of the top floor is set to a floating value. The floor tiles of each intermediate floor are horizontally split using the Floor rule, dividing the floor tiles into several sub-tiles; the bottom floor is horizontally split using the Groundfloor rule, dividing the bottom floor into several sub-tiles, and a main entrance is set on the bottom floor. The EntranceTile rule and the Window, Door, and Wall rules are used to instantiate each sub-tile, and a 3D model instance is randomly called to replace the shape object of the sub-tile to obtain the 3D model of the building plot. The architectural footprints of all building sites are traced and combined with green spaces to form urban architecture.
10. A system for adaptive generation of urban buildings based on OSM data, used to implement the method for adaptive generation of urban buildings based on OSM data as described in any one of claims 1-9, characterized in that, The system includes: The data acquisition module is used to acquire OSM data and preprocess it to obtain road and building data for the target area. The land parcel division module is used to divide the target area into several land parcels based on the road data of the target area; The land parcel marking module is used to mark the divided land parcels as building parcels or blank parcels based on the building data of the target area, and to extract the building footprint of the building parcels from the building data of the target area. The boundary simplification module is used to thin out the boundary lines of all plots using the Douglas-Puk algorithm to obtain simplified plot boundary lines. The blank segmentation module is used to adaptively segment blank plots based on simplified plot boundaries using an improved binary space segmentation algorithm, dividing each blank plot into several sub-plots; The green space filtering module is used to mark sub-plots with an area smaller than a preset effective area threshold as green space, and to mark sub-plots with an area not less than the preset effective area threshold as plots to be built. The footprint generation module is used to generate building footprints in a perimeter layout for building plots to be built using a skeleton-based subdivision method, and to mark building plots to be built with generated building footprints as building plots. The instance creation module is used to divide urban buildings into several levels and, based on the building type of each level, to pre-create 3D model instances of different types of buildings. The building generation module is used to generate 3D models of buildings for each building plot by calling 3D model instances using shape syntax based on the building footprint of all building plots, and combining them with green space to form urban buildings.