A dynamic area-oriented house information statistical method and device and a storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-23
AI Technical Summary
Existing technologies have low efficiency and accuracy in collecting housing information in dynamic areas during urban renewal and transformation, making it difficult to meet diverse and urgent data needs.
By acquiring dynamic area vector files during the urban renewal process, dynamic area attribute association is performed. This association is then combined with preset area weights and a set of building facades. The residential information table is used to perform statistical analysis of housing and resident information, thereby achieving automated data processing.
It improves the efficiency and accuracy of data processing in dynamic areas, reduces the workload and error rate of manual screening, meets diverse and urgent statistical needs, and provides timely and reliable data support for urban renewal.
Smart Images

Figure CN122264718A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data statistics technology, and in particular to a method, apparatus and storage medium for statistical analysis of housing information in dynamic areas. Background Technology
[0002] As urbanization continues to increase, urban construction is gradually shifting from new land development to urban renewal and redevelopment. Basic data surveys are a crucial preliminary step in this process. To facilitate the rapid advancement of urban renewal and relocation efforts, basic data surveys typically require statistical analysis within designated areas, based on factors such as renewal type, expected demolition sequence, and district division. However, as the survey progresses, the designated areas often undergo multiple adjustments, and the boundaries are dynamic due to varying service recipients. Currently, this work still relies heavily on manual screening and statistics, resulting in low efficiency and accuracy, and failing to meet diverse and urgent data needs. Summary of the Invention
[0003] To address the above technical issues, this application provides a method, apparatus, and storage medium for statistical analysis of housing information in dynamic areas, which enables intelligent data statistics for dynamic urban areas and effectively improves data processing efficiency and accuracy.
[0004] This application provides a method for statistical analysis of housing information in dynamic areas, including: Obtain the dynamic area vector files during the urban renewal process and associate the dynamic area attributes to obtain a dynamic area set; Obtain the building facades within the survey area and associate their attributes to obtain a set of building facades; For the set of dynamic regions and the set of building facades, the dynamic regions and building facades are associated based on preset region weights to obtain a set of associated information. Obtain the household information table, which records the member information of each household and its corresponding housing information; Based on the household information table and the associated information set, statistical analysis of housing and resident information is performed to obtain the housing information statistical results for each dynamic area.
[0005] As an improvement to the above solution, the step of obtaining dynamic region vector files during the urban renewal process and associating dynamic region attributes to obtain a dynamic region set includes: Obtain dynamic area vector files during the urban renewal process; Based on the dynamic region vector file, the shape and name annotation of each dynamic region are identified to obtain the first dynamic region set and the region name annotation point set. Based on the first dynamic region set and the region name annotation point set, position matching between the region name annotation points and the dynamic region is performed to associate the attribute information of the dynamic region with the region name annotation points within its surface, thereby obtaining a second dynamic region set with associated region names. Obtain a preset regional weight file and convert it into a data dictionary to obtain a regional weight set, which includes regional names and their regional weights. Based on the region name, the set of region weights is matched with the second set of dynamic regions. The weights of the successfully matched regions are associated with the corresponding dynamic regions to obtain the final set of dynamic regions.
[0006] After obtaining the dynamic area vector file during the urban renewal process, the method further includes: Based on the file extension of the dynamic region vector file, if the dynamic region vector file is a .dwg file, a geographic database is created based on the ArcPy third-party library, and the dynamic region vector file is imported into the geographic database to create a dynamic region dataset. By identifying polygons and annotation features in the dynamic region dataset, the form files corresponding to the polygons and the form files corresponding to the annotation features are output; wherein, the form files are used to generate the first dynamic region set and the region name annotation point set.
[0007] As an improvement to the above solution, the step of obtaining the building facades within the survey scope and associating their attributes to obtain a set of building facades includes: Obtain a house index map within the survey area; Based on the building index map, extract the building faces and building numbers to obtain the set of building faces and the set of building number annotation points; Traverse each point in the set of house number annotation points. If the house number annotation point is within the house face of the set of house faces, then associate the house number annotation point with the corresponding house face. For the house number annotation points and house faces that are not associated in the set of house faces and the set of house number annotation points, the house number annotation points are associated with the nearest house face based on the distance between the house number annotation points and each house face, thus obtaining a set of house faces with associated house numbers.
[0008] As an improvement to the above scheme, the dynamic region set and the building surface set are associated with each other based on a preset region weight to obtain an association information set, including: Based on the set of dynamic regions and the set of house faces, determine whether each house face is in a dynamic region. If so, associate the house face with the corresponding dynamic region to obtain a first set of house faces associated with dynamic regions and a second set of house faces not associated with dynamic regions. For each house face in the second house face set, if the house face intersects with at least one dynamic region in the dynamic region set, then the house face is associated with the corresponding dynamic region based on the region weight, the first house face set is updated, and the associated information set is output.
[0009] As an improvement to the above scheme, the step of associating the roof with the corresponding dynamic region based on regional weights includes: When there is only one dynamic region intersecting with the building surface, associate the building surface with that dynamic region; When there are multiple dynamic regions intersecting with the roof surface, determine whether there is a unique largest region weight based on the region weight corresponding to the dynamic region. If so, then associate the roof of the building with the dynamic region corresponding to the unique largest regional weight; If not, for the dynamic region with the largest regional weight, calculate the intersection area between each dynamic region and the building surface, and associate the dynamic region with the largest intersection area with the building surface.
[0010] As an improvement to the above scheme, the step of performing statistical analysis of housing and resident information based on the household information table and the associated information set to obtain statistical results of housing information for each dynamic area includes: Based on the household information table, for each household, the divisible members and divisible houses in each household are determined separately. Based on the divisible household members and the divisible houses, housing is allocated to obtain an updated household information table; Based on the house numbers in the updated household information table, the dynamic areas corresponding to the house numbers are identified to collect resident information for each dynamic area and obtain the housing information statistics results.
[0011] As an improvement to the above scheme, the allocation of housing based on the divisible household members and the divisible houses includes: For each household, if the number of divisible members is equal to the number of divisible houses, then the divisible houses are allocated to the divisible members; if the number of divisible members is less than the number of divisible houses, then the houses are sorted according to their area and the area weight corresponding to their dynamic area, and the divisible houses are allocated to the divisible members according to the house sorting. By searching for ID card numbers to identify duplicate information, if the identified duplicate ID card number corresponds to multiple divisible houses, the house with the lowest corresponding regional weight is modified to a non-divisible house, and the previous step is returned to redistribute the houses until there are no more houses for the same person, so as to update the household information table.
[0012] This application also provides a housing information statistics device for dynamic areas, including: The dynamic region module is used to obtain dynamic region vector files during the urban renewal process and associate dynamic region attributes to obtain a dynamic region set. The building facade module is used to obtain the building facades within the survey area and associate the building facade attributes to obtain a set of building facades. The information association module is used to associate the dynamic region set and the building surface set based on a preset regional weight to obtain an associated information set. The information statistics module is used to obtain a household information table, which records the member information of each household and its corresponding housing information; based on the household information table and the associated information set, it performs housing and household information statistics to obtain housing information statistics results for each dynamic area.
[0013] This application also provides a computer-readable storage medium storing a computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the housing information statistics method for dynamic areas described above.
[0014] Compared to existing technologies, the beneficial effects of the housing information statistics method, apparatus, and storage medium for dynamic areas provided in this application are as follows: A dynamic area set is obtained by acquiring dynamic area vector files during the urban renewal process and associating them with dynamic area attributes; a housing surface set is obtained by acquiring housing surfaces within the survey area and associating them with housing surface attributes; a set of associated information is obtained by associating the dynamic area set and housing surface set based on preset regional weights; a household information table is obtained, and housing and household information statistics are performed based on the household information table and the associated information set to obtain the housing information statistics results for each dynamic area, thus realizing intelligent data statistics for dynamic areas. This application associates and unifies the statistics of three types of data—dynamic area vectors, housing surfaces, and household information—through an automated process. It enables rapid and accurate collection and zoning statistics of housing and household information even when area boundaries are dynamically changing. This improves the automation level and statistical efficiency of data processing, significantly reduces the workload and error rate of manual screening, facilitates meeting diverse and urgent statistical needs, and provides timely and traceable data support for subsequent urban renewal and relocation decisions. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating a method for statistical analysis of housing information in dynamic areas, as provided in an embodiment of this application. Figure 2 This is a schematic diagram of a housing information statistics device for dynamic areas provided in an embodiment of this application. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0017] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for statistical analysis of housing information in dynamic areas, as provided in an embodiment of this application. The method includes: S1: Obtain the dynamic area vector files during the urban renewal process and associate the dynamic area attributes to obtain a dynamic area set; S2: Obtain the building facades within the survey area and associate the building facade attributes to obtain a set of building facades; S3: For the dynamic region set and the building surface set, associate the dynamic region and the building surface based on the preset region weight to obtain the associated information set; S4: Obtain the household information table, which records the member information of each household and its corresponding housing information; S5: Based on the household information table and the associated information set, perform statistical analysis of housing and household information to obtain the statistical results of housing information for each dynamic area.
[0018] As one optional embodiment, the step of obtaining dynamic region vector files during the urban renewal process and associating dynamic region attributes to obtain a dynamic region set includes: Obtain dynamic area vector files during the urban renewal process; Based on the dynamic region vector file, the shape and name annotation of each dynamic region are identified to obtain the first dynamic region set and the region name annotation point set. Based on the first dynamic region set and the region name annotation point set, position matching between the region name annotation points and the dynamic region is performed to associate the attribute information of the dynamic region with the region name annotation points within its surface, thereby obtaining a second dynamic region set with associated region names. Obtain a preset regional weight file and convert it into a data dictionary to obtain a regional weight set, which includes regional names and their regional weights. Based on the region name, the set of region weights is matched with the second set of dynamic regions. The weights of the successfully matched regions are associated with the corresponding dynamic regions to obtain the final set of dynamic regions.
[0019] Specifically, this embodiment focuses on data statistics for dynamic areas during urban renewal and renovation processes. First, a dynamic area vector file is read to obtain the dynamic range of the area. This dynamic area vector file can be in either dwg or shapefile format. Dwg is a proprietary file format used by CAD (Computer-Aided Design) software to save design data; shapefile is a vector data format used to store geographic information system data, capable of representing features such as points, lines, and polygons and recording their coordinates and attributes.
[0020] To facilitate subsequent data processing, it is necessary to standardize file formats across different types. By reading the file extension of the dynamic region vector file, if it is a .shp file, no format processing is performed; if it is a .dwg file, the file is converted to .shp format.
[0021] Furthermore, after obtaining the dynamic area vector file during the urban renewal process, the method further includes: Based on the file extension of the dynamic region vector file, if the dynamic region vector file is a .dwg file, a geographic database is created based on the ArcPy third-party library, and the dynamic region vector file is imported into the geographic database to create a dynamic region dataset. By identifying polygons and annotation features in the dynamic region dataset, the form files corresponding to the polygons and the form files corresponding to the annotation features are output; wherein, the form files are used to generate the first dynamic region set and the region name annotation point set.
[0022] Specifically, when the input dynamic region vector file is identified as a .dwg file, a geographic database Processing.gdb is created based on the ArcPy library in Python. The .dwg file is imported into the geographic database to create a dynamic region dataset cad2dataset_region. Then, by identifying the polygon and annotation features in the dynamic region dataset cad2dataset_region, two corresponding .shp files are output: polygon_region.shp and annotation_region.shp.
[0023] Furthermore, for the obtained shapefile or shapefile converted from dwg file, the shapefile is read using the geopandas third-party library in Python, and a set of region name annotation points pointset_region=[point1,point2...] and a first dynamic region set polygonset_region=[polygon1,polygon2...] are generated.
[0024] Furthermore, iterate through each point in the set of region name annotation points, pointset_region. For each point, iterate through the first dynamic region set, polygonset_region, based on the point's coordinates. Use the shapely library to determine whether the point is within the dynamic region plane. If it is, associate the point's attribute information with the attribute information of the dynamic region, specifically associating the region name, thereby updating the dynamic region set and obtaining the second dynamic region set, polygonset_region=[[polygon1,name1],[polygon2,name2]...].
[0025] Furthermore, a pre-defined regional weight file is obtained. This file is a text document formulated based on the specific requirements of the data requester and relevant policies. The dynamic regional weights can be set according to the update order or importance of different regions. For example, each dynamic region is assigned a weight value from high to low according to the order in which they are updated; or, the importance of each dynamic region is assessed based on the regional update mode (such as demolition and existing status improvement) and regional planning function (such as roads, residential land, etc.), and the dynamic regions are assigned weight values from high to low according to their importance.
[0026] The obtained region weight file is a text file. In this embodiment, the text file is converted into a data dictionary to obtain a set of region weights, which includes the region name and its region weight, and is stored as polygon_weight={name1:weight1,name2:weight2,....}.
[0027] Further, the second dynamic region set `polygonset_region` and the region weight set `polygon_weight` are traversed. By matching the region names (`name`) in the two sets, a successful match is obtained if the region names are the same. The corresponding region weight of the successful match is associated with the dynamic region. For example, if `name1` = `name1` in the two sets, then the dynamic region `polygon1` is associated with the corresponding region weight `weight1`. When all elements have been traversed, the final dynamic region set `polygonset_region` is obtained, which is associated with region names and region weights: `polygonset_region = [[polygon1, name1, weight1], [polygon2, name2, weight2]...]`.
[0028] This application's embodiments achieve automated and accurate dynamic region attribute association by identifying polygons and annotation points, matching region name annotation points with polygon locations, and then combining this with a preset weight dictionary to complete weighted association. Furthermore, for dynamic region files in CAD formats such as .dwg, importing them into a geographic database using ArcPy and exporting them as standard .shp files before feature recognition enables seamless conversion and standardization from CAD format to GIS standard data. This process improves compatibility and operability with various vector data sources, ensuring that subsequent automatic identification and name matching based on polygons and annotation features can be stably executed in a general GIS environment.
[0029] As one optional embodiment, the step of obtaining the house facades within the survey scope and associating their attributes to obtain a set of house facades includes: Obtain a house index map within the survey area; Based on the building index map, extract the building faces and building numbers to obtain the set of building faces and the set of building number annotation points; Traverse each point in the set of house number annotation points. If the house number annotation point is within the house face of the set of house faces, then associate the house number annotation point with the corresponding house face. For the house number annotation points and house faces that are not associated in the set of house faces and the set of house number annotation points, the house number annotation points are associated with the nearest house face based on the distance between the house number annotation points and each house face, thus obtaining a set of house faces with associated house numbers.
[0030] Specifically, an index map of houses within the survey area is obtained. This index map is typically a .dwg file. First, using the ArcPy third-party library, the index map is imported into the already created geographic database Processing.gdb to create a house dataset cad2dataset_building. Then, polygon and annotation features are identified in the cad2dataset_building dataset. Polygon features correspond to house faces, and annotation features correspond to house numbers. Two corresponding .shp files are output: polygon_building.shp and annotation_building.shp.
[0031] Furthermore, based on the third-party library geopandas in Python, two shapefiles are read to generate a set of building faces polygonset_building=[polygon1b,polygon2b...] and a set of building number annotation points pointset_building=[point1,point2...].
[0032] Iterate through each point in the set of house number annotation points, pointset_building. For each point, iterate through the set of house faces, polygonset_building, based on the point's coordinates. Using the shapely library, it determines whether the point is inside a house face. If so, it associates the point's attribute information with the house face's attribute information. Then, iterate through the remaining unassociated house number annotation points and house faces. For each point, it calculates the distance from the point to the house face and associates the point with the nearest house face. Finally, it obtains the set of house faces associated with house numbers, polygonset_building=[[polygon1b,id1],[polygon2b,id2]...].
[0033] As one optional embodiment, the dynamic region set and the building surface set are associated with each other based on a preset region weight to obtain an association information set, including: Based on the set of dynamic regions and the set of house faces, determine whether each house face is in a dynamic region. If so, associate the house face with the corresponding dynamic region to obtain a first set of house faces associated with dynamic regions and a second set of house faces not associated with dynamic regions. For each house face in the second house face set, if the house face intersects with at least one dynamic region in the dynamic region set, then the house face is associated with the corresponding dynamic region based on the region weight, the first house face set is updated, and the associated information set is output.
[0034] Specifically, iterate through each house face in the set of house faces (polygonset_building), and for each house face, iterate through the set of dynamic regions (polygonset_region), read the dynamic regions within it, and sequentially determine whether the house face is within a dynamic region. If so, associate the house face with the dynamic region. For example, read house face polygon1b, iterate through the set of dynamic regions, read dynamic region polygon1, and if house face polygon1b is within dynamic region polygon1, associate the two and update [polygon1b, id1, polygon1] to the first set of house faces (polygonset_building1).
[0035] After the traversal is complete, the first set of house faces associated with the dynamic region is obtained as polygonset_building1. At the same time, house faces that are not contained in the dynamic region are filtered out and added to the second set of house faces not associated with the dynamic region as polygonset_building2=[[polygon1b2,id12],[polygon2b2,id22]...].
[0036] Furthermore, the second set of building faces (polygonset_building2) is traversed to determine whether any building face intersects with a dynamic region. If a building face intersects with a dynamic region, it is associated with that dynamic region. If a building face intersects with multiple dynamic regions, a dynamic region is selected for association based on its region weight. The building faces associated with the dynamic regions are then updated in the first set of building faces (polygonset_building1), resulting in a set of association information between building faces and dynamic regions.
[0037] As one optional embodiment, associating the building facade with the corresponding dynamic region based on regional weights includes: When there is only one dynamic region intersecting with the building surface, associate the building surface with that dynamic region; When there are multiple dynamic regions intersecting with the roof surface, determine whether there is a unique largest region weight based on the region weight corresponding to the dynamic region. If so, then associate the roof of the building with the dynamic region corresponding to the unique largest regional weight; If not, for the dynamic region with the largest regional weight, calculate the intersection area between each dynamic region and the building surface, and associate the dynamic region with the largest intersection area with the building surface.
[0038] Specifically, the second set of building faces, polygonset_building2, is traversed. For each building face, the dynamic region set, polygonset_region, is traversed, and the dynamic regions within it are read. It is then determined whether the building face intersects with any of the dynamic regions. If a building face intersects with only one dynamic region, then the building face is associated with that dynamic region, and the result is updated in the first set of building faces, polygonset_building1.
[0039] If a building surface intersects with multiple dynamic regions, the region weights of these dynamic regions are obtained, and the dynamic region with the largest region weight is selected. If there is only one dynamic region with the largest region weight, it is associated with the building surface. If there is more than one dynamic region with the largest region weight, the intersection area between the building surface and the dynamic region with the largest region weight is calculated, the dynamic region with the largest intersection area is selected and associated with the building surface, and updated to the first building surface set polygonset_building1.
[0040] After traversing the building faces, the final set of associated information is obtained: polygonset_building1=[[polygon1b,id1,polygon1],[polygon2b,id2,polygon2]...].
[0041] This application's implementation first filters house faces that are entirely within the designated area, then determines the attribution of intersecting house faces based on regional weights. This approach considers both spatial inclusion relationships and intersections, ensuring that most houses are reasonably allocated to dynamic areas. It improves the robustness of spatial attribution determination, avoiding the biases of simply dividing by location or center of gravity, thus obtaining a more realistic set of related information. Furthermore, through explicit sequence rules, it provides a deterministic and reproducible conflict resolution mechanism, ensuring the consistency and interpretability of attribution determinations. This facilitates reasonable allocation in cases of overlapping areas or similar weights, and is convenient for review and traceability.
[0042] In an optional embodiment of this application, dynamic area housing area statistics are also included. First, the entire area statistics set Sarea_all=[S1,S2...Sn] is initialized, where S1=[Sid,Scz1,Sjw1,Sgz1,Sgf1], Sid is the area name, Scz1 is the building area corresponding to village residential houses within the area, Sjw1 is the building area corresponding to collective property, Sgz1 is the building area corresponding to state-owned residential houses, and Sgf1 is the building area corresponding to state-owned non-residential houses. For the household information table, the building area column, house type column, house number column, and whether / not listed are retrieved row by row. For valid building columns, traverse the cells from top to bottom. First, check if the column is valid; if not, continue traversing the next row. If it is valid, read the building area S. Then, if the housing type is village residential, Scz = Scz + S; if the housing type is collective property, Sjw = Sjw + S; if the housing type is state-owned residential, Sgz = Sgz + S; if the housing type is state-owned non-residential, Sgf = Sgf + 1. Continue until all rows have been traversed, update the Sarea_all set, and obtain the statistical table of housing area for each dynamic area.
[0043] As one optional embodiment, the step of performing statistical analysis of housing and resident information based on the household information table and the associated information set to obtain statistical results of housing information for each dynamic area includes: Based on the household information table, for each household, the divisible members and divisible houses in each household are determined separately. Based on the divisible household members and the divisible houses, housing is allocated to obtain an updated household information table; Based on the house numbers in the updated household information table, the dynamic areas corresponding to the house numbers are identified to collect resident information for each dynamic area and obtain the housing information statistics results.
[0044] Specifically, the household information table, also known as the one-household-one-dwelling details table, is first obtained to record the member information of each household and its corresponding housing information. Then, the member information of the same household is merged for subsequent data processing. Specifically, the header of the household information table is read, the serial number column in the table is located, and the cells in that column are traversed. Based on the Openxl library in Python, the cell merging range (x1, x2, y1, y2) is read, where x1 and x2 are the range of cells in the merged column, and y1 and y2 are the range of cells in the merged row. The table is expressed in columns, so only the merged row range (y1, y2) is stored. After merging in sequence, the merged row range set merge_row=[[y11,y12],[y21,y22]...[yn1,yn2]] is obtained, where each row range contains information for one household.
[0045] Furthermore, add columns Col1: members eligible for separate households, and Col2: houses eligible for separate households to the table. Then, confirm whether members in each household are eligible for separate households and the number of houses eligible for separate households. Specifically, iterate through the row range set merge_row, read the first row range [y11, y12], and retrieve information within the row range. Based on the member relationship and age, determine whether a member is eligible for separate households. First, read the member relationship column within the row range. If the member relationship is head of household, fill in "yes" in the corresponding Col1 column; if the member relationship is children, filter for children of marriageable age. If the number is 1, fill in "yes" directly; if the number is n>1, fill in "yes" for the first n-1 children. In addition, check whether there are other related relatives in the household. If they are of marriageable age, fill in "yes" for all of them, and "no" for the rest.
[0046] For houses that can be subdivided, the number of subdivided units is determined based on the building's foundation area and total floor area. The building's foundation area refers to the ground area occupied by the building's foundation. Specifically, the building's foundation area and total floor area are read within the row range. If the building's foundation area Sj < 8, then column Col2 is filled with 0; if the building's foundation area Sj ∈ [8, 120], then column Col2 is filled with 1; if the building's foundation area Sj > 120, then the total floor area Sz is read, and m = Sj / / 60. If Sz / m > 280, then Col2 is filled with 1; if Sz / m ≤ 280, then Col2 is filled with m.
[0047] Following the steps described above, traverse all ranges in the merge_row range set to determine the divisible members and divisible houses in each household. Then, based on the number of divisible members and divisible houses in each household, and combined with regional weights, allocate houses.
[0048] As one optional embodiment, the housing allocation based on the divisible members and the divisible houses includes: For each household, if the number of divisible members is equal to the number of divisible houses, then the divisible houses are allocated to the divisible members; if the number of divisible members is less than the number of divisible houses, then the houses are sorted according to their area and the area weight corresponding to their dynamic area, and the divisible houses are allocated to the divisible members according to the house sorting. By searching for ID card numbers to identify duplicate information, if the identified duplicate ID card number corresponds to multiple divisible houses, the house with the lowest corresponding regional weight is modified to a non-divisible house, and the previous step is returned to redistribute the houses until there are no more houses for the same person, so as to update the household information table.
[0049] Specifically, traverse the set of row ranges merge_row again, starting from the first row range [y11, y12], identify column Col1, count the number of "yes" within the row range, denoted as a, which is the number of separable members in one household; identify column Col2, calculate the sum of the numbers in the row range, denoted as b, which is the number of separable houses in one household.
[0050] If a = b, then in sequence, move the house numbers in column Col2 that are not 0 to the corresponding rows of the members with "yes" in column Col1. Optionally, the operations when a > b are the same as when a = b.
[0051] If a < b, search column Col2 within the corresponding row range. If there is a value greater than 1, replace it with 1 and recalculate the sum of the row range of column Col2, denoted as b; if a = b, also move the house numbers in column Col2 that are not 0 to the corresponding rows of the members with "yes" in column Col1; if a < b still holds, search the house number column and column Col2, identify the rows where column Col2 is not 0, read the corresponding house numbers of these rows, identify the dynamic area names corresponding to the house numbers, and sort them in descending order according to their corresponding area weights. If the area weights are the same, further sort them in descending order according to the building area. Then, in the order of arrangement, allocate them to the corresponding rows of the members with "yes" in column Col1 one by one. After allocation, set the value of column Col2 in the rows corresponding to the remaining house numbers to 0.
[0052] Furthermore, traverse the set of row ranges merge_row according to the above operations. Then, correct the housing information by retrieving duplicate ID numbers to ensure that each household corresponds to only one house. Specifically, identify the ID number column, retrieve duplicate ID numbers, and match the corresponding row ranges row_range1 = [y11, y12], row_range2 = [y21, y22], etc. Traverse all the corresponding row ranges. If there is only one separable house in the rows corresponding to the duplicate ID numbers in multiple row ranges, no modification is made; if there are multiple separable houses corresponding to the duplicate ID numbers, match the houses with the smallest area weight in the corresponding row ranges for each of them. Then, compare the houses with the smallest area weight in different row ranges, and set the value of column Col1 in the row corresponding to the house with the smaller weight to no. Then, perform the above housing allocation process again, recalculate and compare a and b for housing allocation until there are no members with the same ID number sharing multiple houses. Furthermore, traverse the houses in the rows where column Col2 does not correspond to 1 in sequence. If the value of column Col1 of the matching member is no, modify the value of column Col2 in the corresponding row to 0 until the traversal ends.
[0053] Finally, initialize the dynamic area household count set Hukou=[H1,H2...Hn], with all elements in the set set to 0. Iterate through column Col2 of the household information table, identifying the first row value h1. If h1≠0, identify the corresponding dynamic area Hn where the house number belongs, Hn=Hn+h1; if h1=0, continue iterating through the next row until the iteration is complete, outputting the final Hukou set to obtain the household count statistics for each dynamic area. Furthermore, by combining this with the house area statistics table, a comprehensive statistical result of the house information for each dynamic area can be obtained, achieving rapid data statistics for dynamic areas.
[0054] This application addresses the statistical work of housing and household data in the basic data collection of dynamic areas during urban renewal and redevelopment. Using CAD housing index maps, household data tables, and housing detail tables from the basic data survey results as raw data, it reconstructs the topological relationships of the CAD graphics by setting regional weights, and associates information such as house number, area, and homeowner with location. This enables automatic statistical collection and output of basic information within dynamic areas, improving data collection efficiency and meeting the data needs of different operational departments. This application effectively solves the correlation problem when area surfaces, house surfaces, and corresponding annotations are separate, as well as the attribution problem when house surfaces overlap with area surfaces. It provides customized statistical and reporting output of current building volume and number of households in the area for data requesting units. The above statistical and data output process is automated and does not rely on manual intervention, meeting the personalized needs of multiple data requesting units and providing reliable data support for urban renewal planning and cost estimation.
[0055] Accordingly, this application also provides a housing information statistics device for dynamic areas, which can implement all the processes of the housing information statistics method for dynamic areas in the above embodiments.
[0056] Please see Figure 2 , Figure 2 This is a schematic diagram of a housing information statistics device for dynamic areas provided in an embodiment of this application. The housing information statistics device for dynamic areas includes: The dynamic region module 201 is used to obtain dynamic region vector files during the urban renewal process and associate dynamic region attributes to obtain a dynamic region set. The building facade module 202 is used to obtain the building facades within the survey area and associate the building facade attributes to obtain a set of building facades. Information association module 203 is used to associate the dynamic region set and the building surface set with the dynamic region set and the building surface set based on a preset regional weight to obtain an association information set; The information statistics module 204 is used to obtain a household information table, which records the member information of each household and its corresponding housing information; and to perform housing and household information statistics based on the household information table and the associated information set to obtain housing information statistics results for each dynamic area.
[0057] Preferably, the dynamic region module 201 is specifically used for: Obtain dynamic area vector files during the urban renewal process; Based on the dynamic region vector file, the shape and name annotation of each dynamic region are identified to obtain the first dynamic region set and the region name annotation point set. Based on the first dynamic region set and the region name annotation point set, position matching between the region name annotation points and the dynamic region is performed to associate the attribute information of the dynamic region with the region name annotation points within its surface, thereby obtaining a second dynamic region set with associated region names. Obtain a preset regional weight file and convert it into a data dictionary to obtain a regional weight set, which includes regional names and their regional weights. Based on the region name, the set of region weights is matched with the second set of dynamic regions. The weights of the successfully matched regions are associated with the corresponding dynamic regions to obtain the final set of dynamic regions.
[0058] Preferably, the dynamic region module 201 is further configured to: Based on the file extension of the dynamic region vector file, if the dynamic region vector file is a .dwg file, a geographic database is created based on the ArcPy third-party library, and the dynamic region vector file is imported into the geographic database to create a dynamic region dataset. By identifying polygons and annotation features in the dynamic region dataset, the form files corresponding to the polygons and the form files corresponding to the annotation features are output; wherein, the form files are used to generate the first dynamic region set and the region name annotation point set.
[0059] Preferably, the roof module 202 is specifically used for: Obtain a house index map within the survey area; Based on the building index map, extract the building faces and building numbers to obtain the set of building faces and the set of building number annotation points; Traverse each point in the set of house number annotation points. If the house number annotation point is within the house face of the set of house faces, then associate the house number annotation point with the corresponding house face. For the house number annotation points and house faces that are not associated in the set of house faces and the set of house number annotation points, the house number annotation points are associated with the nearest house face based on the distance between the house number annotation points and each house face, thus obtaining a set of house faces with associated house numbers.
[0060] Preferably, the information association module 203 is specifically used for: Based on the set of dynamic regions and the set of house faces, determine whether each house face is in a dynamic region. If so, associate the house face with the corresponding dynamic region to obtain a first set of house faces associated with dynamic regions and a second set of house faces not associated with dynamic regions. For each house face in the second house face set, if the house face intersects with at least one dynamic region in the dynamic region set, then the house face is associated with the corresponding dynamic region based on the region weight, the first house face set is updated, and the associated information set is output.
[0061] Preferably, associating the rooftop with the corresponding dynamic region based on regional weights includes: When there is only one dynamic region intersecting with the building surface, associate the building surface with that dynamic region; When there are multiple dynamic regions intersecting with the roof surface, determine whether there is a unique largest region weight based on the region weight corresponding to the dynamic region. If so, then associate the roof of the building with the dynamic region corresponding to the unique largest regional weight; If not, for the dynamic region with the largest regional weight, calculate the intersection area between each dynamic region and the building surface, and associate the dynamic region with the largest intersection area with the building surface.
[0062] Preferably, the step of performing statistical analysis of housing and resident information based on the household information table and the associated information set to obtain statistical results of housing information for each dynamic area includes: Based on the household information table, for each household, the divisible members and divisible houses in each household are determined separately. Based on the divisible household members and the divisible houses, housing is allocated to obtain an updated household information table; Based on the house numbers in the updated household information table, the dynamic areas corresponding to the house numbers are identified to collect resident information for each dynamic area and obtain the housing information statistics results.
[0063] Preferably, the housing allocation based on the divisible household members and the divisible houses includes: For each household, if the number of divisible members is equal to the number of divisible houses, then the divisible houses are allocated to the divisible members; if the number of divisible members is less than the number of divisible houses, then the houses are sorted according to their area and the area weight corresponding to their dynamic area, and the divisible houses are allocated to the divisible members according to the house sorting. By searching for ID card numbers to identify duplicate information, if the identified duplicate ID card number corresponds to multiple divisible houses, the house with the lowest corresponding regional weight is modified to a non-divisible house, and the previous step is returned to redistribute the houses until there are no more houses for the same person, so as to update the household information table.
[0064] In specific implementation, the working principle, control process and technical effects of the housing information statistics device for dynamic areas provided in this application are the same as those of the housing information statistics method for dynamic areas in the above embodiments, and will not be repeated here.
[0065] This application also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the housing information statistics method for dynamic areas described in any of the above embodiments.
[0066] This application provides a method, apparatus, and storage medium for statistical analysis of housing information in dynamic areas. Its advantages include: obtaining a dynamic area set by acquiring dynamic area vector files during urban renewal and associating them with dynamic area attributes; acquiring building facades within the survey area and associating them with building facade attributes to obtain a building facade set; associating the dynamic area set and building facade set based on preset regional weights to obtain an associated information set; acquiring a household information table and performing statistical analysis of housing and household information based on the household information table and the associated information set to obtain statistical results for housing information in each dynamic area, thus realizing intelligent data statistics for dynamic areas. This application associates and unifies the statistical analysis of three types of data—dynamic area vectors, building facades, and household information—through an automated process. It enables rapid and accurate collection and zoning of housing and household information even when area boundaries are dynamically changing, improving the automation and efficiency of data processing, significantly reducing the workload and error rate of manual screening, facilitating the fulfillment of diverse and urgent statistical needs, and providing timely and traceable data support for subsequent urban renewal and relocation decisions.
[0067] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. A method for statistical analysis of housing information in dynamic regions, characterized in that, include: Obtain the dynamic area vector files during the urban renewal process and associate the dynamic area attributes to obtain a dynamic area set; Obtain the building facades within the survey area and associate their attributes to obtain a set of building facades; For the set of dynamic regions and the set of building facades, the dynamic regions and building facades are associated based on preset region weights to obtain a set of associated information. Obtain the household information table, which records the member information of each household and its corresponding housing information; Based on the household information table and the associated information set, statistical analysis of housing and resident information is performed to obtain the housing information statistical results for each dynamic area.
2. The method for statistical analysis of housing information in dynamic areas as described in claim 1, characterized in that, The process of obtaining dynamic region vector files during urban renewal and associating them with dynamic region attributes to obtain a dynamic region set includes: Obtain dynamic area vector files during the urban renewal process; Based on the dynamic region vector file, the shape and name annotation of each dynamic region are identified to obtain the first dynamic region set and the region name annotation point set. Based on the first dynamic region set and the region name annotation point set, position matching between the region name annotation points and the dynamic region is performed to associate the attribute information of the dynamic region with the region name annotation points within its surface, thereby obtaining a second dynamic region set with associated region names. Obtain a preset regional weight file and convert it into a data dictionary to obtain a regional weight set, which includes regional names and their regional weights. Based on the region name, the set of region weights is matched with the second set of dynamic regions. The weights of the successfully matched regions are associated with the corresponding dynamic regions to obtain the final set of dynamic regions.
3. The method for statistical analysis of housing information in dynamic areas as described in claim 2, characterized in that, After obtaining the dynamic area vector file during the urban renewal process, the method further includes: Based on the file extension of the dynamic region vector file, if the dynamic region vector file is a .dwg file, a geographic database is created based on the ArcPy third-party library, and the dynamic region vector file is imported into the geographic database to create a dynamic region dataset. By identifying polygons and annotation features in the dynamic region dataset, the form files corresponding to the polygons and the form files corresponding to the annotation features are output; wherein, the form files are used to generate the first dynamic region set and the region name annotation point set.
4. The method for statistical analysis of housing information in dynamic areas as described in claim 1, characterized in that, The process of acquiring the building facades within the survey scope and associating their attributes yields a set of building facades, including: Obtain a house index map within the survey area; Based on the building index map, extract the building faces and building numbers to obtain the set of building faces and the set of building number annotation points; Traverse each point in the set of house number annotation points. If the house number annotation point is within the house face of the set of house faces, then associate the house number annotation point with the corresponding house face. For the house number annotation points and house faces that are not associated in the set of house faces and the set of house number annotation points, the house number annotation points are associated with the nearest house face based on the distance between the house number annotation points and each house face, thus obtaining a set of house faces with associated house numbers.
5. The method for statistical analysis of housing information in dynamic areas as described in claim 1, characterized in that, The process involves associating the dynamic region set and the building facade set based on preset region weights to obtain an association information set, including: Based on the set of dynamic regions and the set of house faces, determine whether each house face is in a dynamic region. If so, associate the house face with the corresponding dynamic region to obtain a first set of house faces associated with dynamic regions and a second set of house faces not associated with dynamic regions. For each house face in the second house face set, if the house face intersects with at least one dynamic region in the dynamic region set, then the house face is associated with the corresponding dynamic region based on the region weight, the first house face set is updated, and the associated information set is output.
6. The method for statistical analysis of housing information in dynamic areas as described in claim 5, characterized in that, The method of associating the roof of a building with the corresponding dynamic region based on regional weights includes: When there is only one dynamic region intersecting with the building surface, associate the building surface with that dynamic region; When there are multiple dynamic regions intersecting with the roof surface, determine whether there is a unique largest region weight based on the region weight corresponding to the dynamic region. If so, then associate the roof of the building with the dynamic region corresponding to the unique largest regional weight; If not, for the dynamic region with the largest regional weight, calculate the intersection area between each dynamic region and the building surface, and associate the dynamic region with the largest intersection area with the building surface.
7. The method for statistical analysis of housing information in dynamic areas as described in claim 1, characterized in that, The statistical analysis of housing and resident information based on the household information table and the associated information set, to obtain the housing information statistical results for each dynamic area, includes: Based on the household information table, for each household, the divisible members and divisible houses in each household are determined separately. Based on the divisible household members and the divisible houses, housing is allocated to obtain an updated household information table; Based on the house numbers in the updated household information table, the dynamic areas corresponding to the house numbers are identified to collect resident information for each dynamic area and obtain the housing information statistics results.
8. The method for statistical analysis of housing information in dynamic areas as described in claim 7, characterized in that, The allocation of housing based on the divisible members and the divisible houses includes: For each household, if the number of divisible members is equal to the number of divisible houses, then the divisible houses are allocated to the divisible members; if the number of divisible members is less than the number of divisible houses, then the houses are sorted according to their area and the area weight corresponding to their dynamic area, and the divisible houses are allocated to the divisible members according to the house sorting. By searching for ID card numbers to identify duplicate information, if the identified duplicate ID card number corresponds to multiple divisible houses, the house with the lowest corresponding regional weight is modified to a non-divisible house, and the previous step is returned to redistribute the houses until there are no more houses for the same person, so as to update the household information table.
9. A housing information statistics device for dynamic areas, characterized in that, include: The dynamic region module is used to obtain dynamic region vector files during the urban renewal process and associate dynamic region attributes to obtain a dynamic region set. The building facade module is used to obtain the building facades within the survey area and associate the building facade attributes to obtain a set of building facades. The information association module is used to associate the dynamic region set and the building surface set based on a preset regional weight to obtain an associated information set. The information statistics module is used to obtain the household information table, which records the member information of each household and its corresponding house information. Based on the household information table and the associated information set, statistical analysis of housing and resident information is performed to obtain the housing information statistical results for each dynamic area.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the device containing the computer-readable storage medium executes the computer program, it implements the method for statistical analysis of housing information for dynamic regions as described in any one of claims 1 to 8.