A method and system for automatically generating vector graphics for real estate registration
By constructing a multi-source input module and a unified intermediate representation model, the problem of processing multi-source heterogeneous data in real estate registration is solved, enabling the automated generation of standard vector graphics, improving registration efficiency and accuracy, and providing traceability of graphic changes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LIUZHOU INVESTIGATION SURVEYING & MAPPING INST
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies are insufficient for effectively handling multi-source heterogeneous surveying and mapping results in real estate registration, leading to problems such as layer disorder, attribute loss, and topological errors during the graphic generation process, which cannot meet the accuracy and efficiency requirements of real estate registration.
A multi-source input module is used for file type identification and preprocessing to build a unified intermediate representation model. Through topological rule verification and repair, and geometric optimization, vector graphics that conform to real estate registration standards are generated.
It enables accurate identification and dynamic routing of multi-source data, automatically repairs topological defects, generates vector graphics that meet industry standards, improves registration efficiency and accuracy, and provides traceability and quality audit support for graphic changes.
Smart Images

Figure CN122492867A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, specifically relating to a method and system for automatically generating vector graphics for real estate registration. Background Technology
[0002] With the deepening of the unified real estate registration system, the demand for standardized and automated processing of vector graphics such as land parcel maps and unit maps in real estate registration is becoming increasingly urgent. In current registration practice, surveying results are mostly submitted in the form of CAD drawings or paper scans, which require manual intervention to convert them into vector formats (such as SVG or WKT) that the registration system can recognize. This process not only involves complex format adaptation, but also needs to ensure that the graphics meet the topological and semantic rules unique to real estate registration, such as "land parcel closure" and "collinear boundaries." This poses a severe challenge to the accuracy, consistency, and processing efficiency of graphic generation.
[0003] Among these, the generation of vector graphics for real estate registration needs to retain the original geometric accuracy while embedding business logic constraints to support subsequent ownership confirmation and spatial analysis. However, existing technical approaches generally suffer from structural defects: directly importing CAD files is easily affected by differences in drafting standards, leading to layer misalignment and attribute loss; manual outlining or OCR-assisted methods based on scanned images are inefficient and cannot guarantee geometric closure and coordinate accuracy; while general vectorization tools can extract outlines, they lack an understanding of the rules in the real estate field and cannot automatically correct broken lines, overlaps, or non-closed areas, causing output graphics to be frequently rejected by quality control due to topological errors.
[0004] Therefore, there is an urgent need for a vector graphics automatic generation method that can integrate multi-source inputs, embed business rules, and has self-verification capabilities, so as to achieve end-to-end automated conversion from heterogeneous drawings to compliant vector data. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for automatically generating vector graphics for real estate registration, which can effectively solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Firstly, a method for automatically generating vector graphics for real estate registration includes: Receive the original drawing input, parse the original drawing input to extract geometric elements and their associated semantic information; Based on the extracted geometric elements and semantic information, a unified intermediate representation model is constructed. The unified intermediate representation model includes geometric units, semantic tags bound to geometric units, and topological relationships that represent the shared boundary information between different geometric units. The model performs topology rule verification on the geometric units in the unified intermediate representation model, and automatically performs targeted topology repair when topology defects are detected. Topology repair includes: for the defect of unclosed polygons, a cubic uniform B-spline interpolation algorithm is used to generate a smooth closed curve to close the polygon; and for the defect of overlapping between adjacent polygons, the overlapping area is corrected based on the normal vector offset. Geometric optimization is performed on the geometric units that pass the topology rule verification. Geometric optimization includes right angle fitting of the interior angles of polygons, and correcting the interior angles within the preset tolerance range to right angles. The geometrically optimized geometric units and their associated semantic tags are converted into vector format files that meet the requirements of the target registration platform and then output.
[0007] Preferably, the original drawing input is received, and the original drawing input is parsed to extract geometric elements and their associated semantic information, specifically including: The original drawing input is double-verified by a file type identifier. The double verification is based on both the file extension and the magic number in the file header to determine the true type of the input file. Based on the determined file type, the original drawing input is dynamically routed to the corresponding preprocessing path. If it is determined to be a structured CAD or GIS format, a structured parser extracts closed polylines or spline curves as geometric elements, and a spatial proximity algorithm is used to associate text entities to extract semantic information. If it is determined to be an unstructured image format, an image preprocessing unit performs edge detection and contour extraction to obtain candidate polygons as geometric elements, and an OCR engine is used to recognize the text and associate it with the corresponding polygons through the shortest spatial distance to extract semantic information.
[0008] Preferably, the unified intermediate representation model is further configured with version management function, maintaining a version chain containing historical IR objects for each parcel identifier; when processing new drawing inputs involving existing parcels, the current version is loaded and compared with historical versions to generate a structured change report containing geometric changes and attribute changes.
[0009] Preferably, constructing a unified intermediate representation model further includes: An R-tree spatial index is established for all geometric units. Based on the R-tree spatial index, the adjacency relationship between different geometric units is traversed and determined. For two geometric units with an adjacency relationship, the vertex coordinate sequence, length and orientation information of their shared boundary are extracted and encapsulated as a topological relationship.
[0010] Preferably, topology rule validation further includes: The closure test determines whether the closure flag of a geometric unit is true, or calculates whether the Euclidean distance between its first and last vertices is less than a first preset threshold. The collinearity and gapless test determines whether collinearity exists by calculating whether the root mean square error of the distance between adjacent geometric units with topological relationships is less than a second preset threshold for adjacent geometric units, and by generating a bidirectional buffer of the shared boundary and checking whether it is completely covered by adjacent geometric units.
[0011] Preferably, a cubic uniform B-spline interpolation algorithm is used to generate a smooth closed curve to close the polygon, including: Obtain the first and last vertices of the polygon with breakpoint defects; generate at least one intermediate control point by linear interpolation between the first and last vertices, and use the first, intermediate, and last vertices as the control point sequence of the B-spline curve; construct a node vector that interpolates the curve endpoints to the first and last control points; based on the control point sequence and node vector, call the deBoor algorithm to calculate multiple new vertices on the interpolation curve, and insert the new vertices into the original polygon vertex sequence to form a closed loop.
[0012] Preferably, the correction of the overlapping region based on the normal vector offset includes: Calculate the centroid of the intersection region of two adjacent polygons; determine the side where the overlapping region is located based on the position of the centroid relative to the shared boundary; calculate the normal vector at each vertex on the shared boundary; offset the corresponding vertex on the polygon located on the overlapping region side outward by a preset distance along the direction of the normal vector, and simultaneously offset the corresponding vertex on the other polygon inward by a preset distance along the opposite direction of the normal vector, so as to eliminate the overlap.
[0013] Preferably, correcting interior angles within a preset tolerance range to right angles includes: Traverse each vertex of the polygon and calculate the interior angle value formed by the current vertex and its adjacent vertices. If the interior angle value falls within the tolerance range of 85° to 95°, it is taken as the angle to be corrected. Using the vertex of the angle to be corrected as the base point, perform a geometric transformation based on vector rotation and projection on the two sides that make up the angle, transforming one side into a perpendicular side to the other side while keeping its length unchanged, thereby correcting the interior angle to 90°.
[0014] Preferably, geometric optimization of the geometric units that have passed the topology rule verification further includes: Before performing right-angle fitting, the Douglas-Peucker algorithm is used to simplify the nodes of the geometric units to reduce the number of vertices.
[0015] Secondly, a vector graphics automatic generation system for real estate registration includes: The multi-source input module is used to receive original drawing inputs, parse the original drawing inputs to extract geometric elements and their associated semantic information; The model building module is used to construct a unified intermediate representation model based on the extracted geometric features and semantic information. The unified intermediate representation model includes geometric units, semantic labels bound to the geometric units, and topological relationships that represent the shared boundary information between different geometric units. The topology verification and repair module is used to perform topology rule verification on the geometric units in the unified intermediate representation model, and automatically perform targeted topology repair when topology defects are detected. Topology repair includes: for the breakpoint defects of non-closed polygons, a cubic uniform B-spline interpolation algorithm is used to generate a smooth closed curve to close the polygon; and for the overlapping defects between adjacent polygons, the overlapping area is corrected based on the normal vector offset. The geometry optimization module is used to perform geometry optimization on geometric units that have passed the topology rule verification. Geometry optimization includes right angle fitting processing of the interior angles of polygons, correcting the interior angles within the preset tolerance range to right angles. The output adaptation module is used to convert the geometrically optimized geometric units and their bound semantic tags into vector format files that meet the requirements of the target registration platform and then output them.
[0016] In summary, this application includes at least one of the following beneficial technical effects: 1. This application addresses the pain points of diverse sources and heterogeneous formats of surveying and mapping results in real estate registration. It achieves accurate identification and dynamic routing analysis of various data formats, including CAD, GIS, and scanned images, through a dual verification mechanism (combining file extension and file header magic number) in a multi-source input module. Particularly for structured data, this application innovatively introduces a layer mapping rule engine and a spatial proximity algorithm based on centroid-text Euclidean distance. This effectively addresses the problem of inconsistent layer naming caused by different surveying and mapping units' mapping standards. It automatically and accurately matches geometric contours scattered throughout the drawings with core attribute fields such as land parcel numbers and rights holder information. This transforms the inefficient work of manual interpretation and association into standardized data that is understandable to machines, laying a solid data foundation for subsequent fully automated processing and significantly improving the system's compatibility and analysis accuracy for heterogeneous surveying and mapping results.
[0017] 2. This application deeply aligns with the stringent topological rules required for vector graphics in the real estate registration field. It constructs a unified intermediate representation model encompassing geometric units, semantic labels, and topological relationships, and implements automated closed-loop repair of topological defects based on this model. Unlike existing technologies that can only detect graphic errors but cannot automatically correct them, this application addresses the high-frequency defect of "unclosed plots" by employing a cubic uniform B-spline interpolation algorithm (combining clamped node vectors and the deBoor algorithm) to generate smooth, closed curves that closely match the original orientation at breakpoints. For the quality inspection challenge of "boundary overlap," it innovatively adopts a correction mechanism based on normal vector offset and centroid sign distance. This topology verification and repair mechanism not only transforms the graphic quality inspection process from manual, door-to-door checks to automated machine verification but also ensures the geometric accuracy and smoothness of the repaired boundaries through mathematical algorithms. This represents a leap forward from "error detection" to "intelligent repair," significantly improving the initial registration pass rate.
[0018] 3. This application, through a sophisticated integration of geometric optimization and business rules, ensures that the automatically generated graphics strictly comply with industry standards such as the "Real Estate Surveying and Mapping Code." In the geometric optimization stage, this application does not simply employ a general node simplification algorithm. Instead, after simplifying redundant vertices using the Douglas-Peucker algorithm, it innovatively introduces a right-angle fitting mechanism based on vector rotation and projection transformation. This mechanism forcibly corrects interior angles within the 85° to 95° tolerance range to 90°, ensuring that the generated building outline retains the key inflection point features of the original drawings while meeting the standardized requirements for right-angled representation of buildings in real estate registration. Furthermore, through unified intermediate representation model version chain management and Hausdorff distance difference comparison functionality, this application achieves traceability of historical land parcel change data and quantitative analysis of graphic differences. This provides an intuitive chain of evidence for ownership evolution in change registration business. Simultaneously, the synchronous generation of metadata JSON files provides comprehensive data support for full-process quality auditing and accountability. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the overall technical architecture of a vector graphic automatic generation method and system for real estate registration proposed in this invention; Figure 2 This is a schematic diagram of the core principle framework of the unified intermediate representation model in this invention; Figure 3 This is a logical flowchart of the preprocessing of structured and unstructured data differentiation, topology rule verification, and automatic repair in this invention. Figure 4 This is a schematic diagram of the multi-level interaction relationship and data flow in the geometry optimization and standard format output stages of this invention. Detailed Implementation
[0020] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description of specific embodiments based on the present invention is provided in conjunction with the accompanying drawings and preferred embodiments.
[0021] Example 1 See Figures 1 to 4 As shown, a method for automatically generating vector graphics for real estate registration includes the following steps: S1: The system receives and manages original drawing inputs through a multi-source input module. Step S101: First, start the multi-source input module, which is responsible for receiving original drawing files submitted from outside.
[0022] The multi-source input module supports drawing formats covering three common sources in real estate registration: AutoCAD DWG format files, GeoJSON or Shapefile vector data files commonly used in the field of geographic information systems, and scanned images in PDF, JPEG, PNG, and TIFF formats. This ensures that the system can be compatible with various output formats submitted by different surveying and mapping units, laying the foundation for subsequent differentiated processing.
[0023] Step S102: The multi-source input module integrates a file type recognizer, which uses a dual verification mechanism to determine the true type of the input file.
[0024] The file type identifier first makes a preliminary judgment based on the file extension, then reads several bytes from the beginning of the file, which is usually called the file header magic number or feature code, and compares the read byte sequence with the system's built-in feature code library for various formats.
[0025] For example, DWG files typically contain version identifiers such as AC10xx in their header, PDF files begin with %PDF, and JPEG files contain fixed bytes such as FF D8.
[0026] By combining file extension with file header features for verification, type identification errors caused by accidental modification or loss of file extensions can be effectively avoided, ensuring the accuracy of subsequent processing path selection.
[0027] Step S103: When the recognizer determines that the input file is a DWG file in CAD format, it calls the Teigha development library to parse its binary structure.
[0028] Teigha is a cross-platform development library that can directly read and write DWG files. It can access the geometric and attribute data inside the file without relying on the AutoCAD software environment. The system loads the DWG file through the interface provided by Teigha, accesses the database objects inside it, and then traverses all the graphic entities in the drawing model space.
[0029] For each entity encountered, differentiated processing is performed based on the entity type: if the entity is a polyline or spline curve, extract the coordinate sequence of all vertices constituting the entity and record whether the entity is closed and the name of the layer it belongs to; if the entity is text or a label, extract the text content and the coordinates of its insertion point.
[0030] The extracted vector features and text information will be temporarily stored in memory according to layer classification, along with their original coordinates and layer attributes in the drawing, for further filtering and association in subsequent steps.
[0031] Step S104: When the file type recognizer determines that the input file is in GIS data format, it calls the GDAL / OGR library to perform loading and parsing operations. GDAL / OGR is a standard library for geospatial data conversion and supports multiple vector formats such as Shapefile and GeoJSON.
[0032] First, the specified data source file is opened through the GDAL / OGR driver interface to obtain all layers within the data source. For each layer, the system iterates through all features contained in that layer. Each feature corresponds to a geographic entity. For each feature, the system calls the OGRFeature interface to obtain its geometric object. This geometric object can be of type such as point, line, or polygon. The system converts the geometric object into a coordinate sequence using the OGRGeometry export function. For example, polygons are stored as a list of vertex coordinates of closed loops. At the same time, the system reads the feature's attribute table, extracting the name and value of each attribute field in key-value pair format.
[0033] All extracted geometric and attribute data are temporarily stored in memory according to layer classification, along with the original spatial reference system information of the data, for subsequent coordinate transformation and unified processing.
[0034] Step S105: When the input file is determined to be a scanned image, the image preprocessing unit is started, and the image file is decoded using the OpenCV image processing library.
[0035] The system calls OpenCV's imread function to read the image file and decode it into a two-dimensional pixel matrix. Each element of the matrix corresponds to the color value of a pixel. For color images, the pixel values are stored in BGR order; for grayscale images, they are stored as single-channel brightness values.
[0036] While reading the image, the system attempts to obtain the image's metadata, including the horizontal and vertical resolution (DPI) information, through the image file access interface provided by OpenCV. This information is typically stored in the image file header or EXIF data. If the DPI cannot be obtained from the file, the user-configured default value or calculation based on the drawing scale will be used. Color space information is determined based on the number of image channels; for example, three channels represent the RGB color space, and a single channel represents the grayscale space.
[0037] The read pixel matrix, along with parameters such as image width, height, DPI, and color space, is stored in memory for subsequent edge detection and contour extraction steps.
[0038] In step S106, the system assigns a globally unique task identifier to each input drawing. The task identifier is generated by combining the current system timestamp with a random number to ensure that there are no conflicts between different tasks, and at the same time, it records the complete metadata information related to the task.
[0039] The method of obtaining metadata varies depending on the input type: the submission timestamp is obtained directly from the system clock; coordinate system information is parsed from the drawing file first, such as CAD files or GIS files which usually contain spatial reference definitions. If it cannot be parsed, the default coordinate system set by the user is used; the drawing scale is extracted from the annotations in the CAD file or user input. If it is an image file, it is estimated based on DPI and pixel size or the default scale is used; the image resolution parameter is recorded from the DPI information obtained in step S105.
[0040] All of this metadata, along with the original image data or vector features, is persistently stored in the system's working directory or database using the task identifier as the key, providing a basis for subsequent coordinate transformations, scaling calculations, and quality inspection traceability.
[0041] Step S107: The above steps together lay the data foundation for the entire processing flow. Based on the input type identified in step S102, the task can be dynamically routed to the corresponding preprocessing path. For example, CAD files enter the structured parsing branch, while image files are processed by the image preprocessing unit.
[0042] The establishment of task identifiers and metadata enables the system to implement task queue scheduling in batch processing mode, allowing multiple tasks to be executed in parallel. Each task independently records its processing status and intermediate results, thereby significantly improving the throughput efficiency of large-scale drawing input.
[0043] S2: The system performs differential preprocessing on structured and unstructured data based on the input type.
[0044] Part 1: Preprocessing of structured data for CAD or GIS.
[0045] Step S201: When the system confirms that the input is in a structured format, such as a CAD file or GIS data, based on the determination result of step S1, the structured parser is activated and started.
[0046] The structured parser first loads the layer mapping rule engine, which reads the pre-configured layer configuration file. The configuration file uses a common attribute file format or JSON format and internally defines the mapping relationship between standard layer names and business semantics.
[0047] For example, the file can be configured to map multiple possible layer name variants such as DK_BOUNDARY, land boundary line, and land plot outline to the logical layer of land plot boundary, and to map BUILDING_OUTLINE and building edge line to the logical layer of building outline.
[0048] This mapping mechanism enables the correct identification of the target layer even if different surveying units use different layer naming conventions, laying the foundation for subsequent geometry and attribute extraction.
[0049] Step S202: The structured parser traverses all graphic entities in the CAD file.
[0050] For each entity encountered, the parser first obtains the name of the layer it belongs to, and then determines whether the layer is mapped to the target logical layer, i.e., the land boundary or building outline, based on the layer mapping relationship established in step S201. If the match is successful, the parser further checks the geometric type of the entity.
[0051] The system focuses on entities that are closed polylines or spline curves, because land boundaries and building outlines in real estate registration are usually represented by closed lines. For polyline entities, the system obtains their vertex coordinate sequence through the Teigha library interface and records whether the polyline is closed. For spline curves, the system obtains their control point sequence and generates an approximate polygon vertex sequence through curve fitting, while recording the curve's closure attribute.
[0052] If a spline curve is defined as an open curve in CAD, the system will not process it temporarily or will mark it as non-closed, leaving it for processing in the subsequent topology verification stage.
[0053] All selected geometric objects, along with their vertex coordinate sequences, closure markers, and logical layer information, are stored in an ordered list format. And temporarily stored in memory.
[0054] In step S203, while extracting geometric objects, the parser retrieves text entities in the CAD file that are spatially adjacent to these geometric objects, including TEXT and MTEXT types.
[0055] To establish the connection between geometry and text, the centroid coordinates of each polygon are first calculated. The centroid is obtained by the arithmetic mean of the coordinates of all vertices of the polygon, and the calculation formula is as follows:
[0056]
[0057] Where n represents the number of vertices of the polygon. and Let x and y represent the x and y coordinates of the i-th vertex, respectively. and The coordinates of the centroid of the polygon in question are given.
[0058] For each text entity, obtain its positioning point coordinates; for TEXT entities, the positioning point is usually the text insertion point; for MTEXT entities, the positioning point can be the top left corner of the text box or a user-defined alignment point, and the system reads the corresponding point coordinates according to the attributes of the text object.
[0059] The system then calculates the Euclidean distance between the location point and the centroid of the polygon. The distance formula is as follows:
[0060] in, This represents the coordinates of the positioning point of the text entity. and Let d be the coordinates of the centroid of the polygon, and d be the Euclidean distance between the two points.
[0061] If the distance is less than the preset proximity distance threshold, the text content is associated with the corresponding polygon. The proximity distance threshold is dynamically determined according to the drawing scale. The specific calculation method is as follows: first, determine the actual ground distance, such as 5 meters, and then convert it to the drawing distance according to the drawing scale. For example, when the scale is 1:500, 5 meters corresponds to 10 millimeters on the drawing.
[0062] In CAD files, the drawing units are usually millimeters or meters. The distances on the drawing need to be converted to CAD units according to the drawing settings. If the CAD file is in millimeters, then 10 millimeters is used directly as the threshold. If it is in meters, then 10 millimeters needs to be converted to 0.01 meters as the threshold.
[0063] If the drawing scale cannot be obtained from the file metadata, a default threshold of 50 drawing units will be used, and users will be allowed to adjust it later.
[0064] In step S204, the associated text content is further matched with regular expressions to extract structured fields. A series of regular expression patterns are predefined and stored in the rule base to identify the key attribute fields required for real estate registration.
[0065] Specifically, the matching rules for land parcel numbers are configured according to business needs. Land parcel numbers are usually composed of administrative division codes, years, and serial numbers, conforming to a specific coding format. For land use codes, rules are configured to match national standard land classification codes, such as common codes like industrial land code M and residential land code R. For building area, rules are configured to match strings that match numbers followed by units in square meters, where the number part supports integers or decimals, and the unit part may be expressed as ㎡, square meters, etc.
[0066] In actual processing, these regular expressions are applied sequentially to each piece of text. If a match is successful, the corresponding field value is extracted and stored as a key-value pair, such as land parcel number: AH2024-001. If a piece of text matches multiple rules, its classification is determined according to a pre-defined priority, for example, prioritizing the land parcel number, then the usage code, and finally the area.
[0067] The extracted field values will be bound to the corresponding geometric units and will be subsequently populated into the semantic tags of the unified intermediate representation model.
[0068] The first part described above completes the separation, extraction, and preliminary association of geometric and attribute information in structured data, providing basic elements for the subsequent construction of a unified intermediate representation model.
[0069] Part 2: Preprocessing for unstructured image formats.
[0070] Step S205: When the input is determined to be an unstructured image, the image preprocessing unit begins to perform a series of image processing operations. First, grayscale conversion is performed, converting the color image to a grayscale image. The conversion uses a weighted average method, with the following formula:
[0071] in This represents the grayscale value at pixel coordinates (x,y). R(x,y), G(x,y), and B(x,y) represent the original values of the red, green, and blue channels of the pixel, respectively. This formula originates from the ITU-R BT.601 standard and conforms to the characteristics of human eye brightness perception.
[0072] In step S206, the grayscale image is then subjected to Gaussian filtering for noise suppression, using a 5×5 Gaussian kernel with a standard deviation σ of 1.0. The weights of the Gaussian kernel are determined using a two-dimensional Gaussian function:
[0073] The calculation shows that x and y represent the coordinate offsets of each element in the kernel relative to the kernel center. By performing a two-dimensional convolution operation between the generated Gaussian kernel and the grayscale image, a smoothed image can be obtained. This process can effectively remove high-frequency noise while preserving edge information.
[0074] Step S207: Edge detection uses the Canny operator, with the high and low thresholds set to the low threshold respectively. With high threshold It can effectively preserve the fine line boundaries in the parcel map while suppressing texture interference.
[0075] The Canny operator outputs a binary edge map, where edge pixels are white and the background is black.
[0076] In step S208, the edge image is processed by morphological closing operation to fill the tiny holes and connect the adjacent broken edges. The closing operation uses a structuring element such as a 3×3 rectangular kernel. First, the image is dilated, and then eroded to make the edges more continuous and complete.
[0077] Step S209: After morphological processing, the findContours function of the OpenCV library is called to trace continuous contours in CHAIN_APPROX_SIMPLE mode. This mode only stores the endpoints of the contours, compresses redundant points in the horizontal, vertical and diagonal directions, and generates a list of candidate polygons.
[0078] Each contour is represented by an ordered sequence of vertices. The area and perimeter of each contour are calculated, and closed regions are initially screened based on preset conditions. To effectively eliminate small contours caused by noise, only contours with an area greater than a certain threshold are retained.
[0079] Determining this threshold requires converting the actual ground area into pixel area in the image based on the drawing scale. The drawing scale can be obtained from the metadata recorded in step S106. For example, when the scale is 1:500, 10 square meters of actual ground corresponds to a drawing area of... Square meters, converted to square millimeters is Square millimeters.
[0080] If the image resolution is known, for example, how many pixels per millimeter, it can be further converted into pixel area; if an accurate scale cannot be obtained, a default threshold, such as 500 pixels, can be used, and users can configure it.
[0081] In addition, the system also checks the perimeter-to-area ratio, which is used to exclude long and narrow noise regions. A reasonable range can be set based on experience. For example, if the perimeter-to-area ratio is less than 0.1, it is retained; otherwise, it is considered noise and is removed. In practical applications, this threshold can be determined based on the statistics of training samples.
[0082] Step S210: While extracting the geometric contours, start the OCR engine to perform text detection and recognition on the entire image. Open source engines such as PaddleOCR can be used. This engine is based on a deep learning model and can detect text regions in the image and output the coordinates of the four corner points of the text box and the recognized text string.
[0083] The system collects all detection results and generates a list of the correspondence between text box coordinates and text content.
[0084] In step S211, the system iterates through all the identified text boxes and calculates the center point coordinates of each text box. The center point coordinates are obtained by averaging the four corner points.
[0085] For each candidate polygon, calculate the shortest distance from the center point to the polygon boundary. That is, traverse all edges of the polygon, calculate the perpendicular distance from the point to each line segment, and take the minimum value.
[0086] The distance from a point to a line segment is calculated using the standard geometric method: if the perpendicular lies on the line segment, the distance is the length of the perpendicular; otherwise, the distance is the smaller of the distances from the point to the two endpoints of the line segment.
[0087] The text content is assigned to the polygon with the smallest distance, thus completing the binding between geometry and semantics. If a polygon is not assigned any text, its semantic label can be temporarily left blank, to be manually added later or inferred from neighboring polygons.
[0088] The second part described above realizes the entire process of automatically extracting geometric contours from scanned images and associating them with attribute text, thus transforming unstructured data into structured elements that can be processed by subsequent modules.
[0089] At this point, step S2 completes the output of the structured geometric elements and their associated semantic information obtained after differential preprocessing, namely the geometric unit and preliminary semantic label corresponding to each polygon.
[0090] S3: The system encapsulates the extracted results into a standardized data structure based on a unified intermediate representation model.
[0091] Step S301: The system initiates the construction process of the unified intermediate representation model, hereinafter referred to as the IR model. It is a standardized data container used to encapsulate the geometric and semantic information extracted from various input sources in step S2.
[0092] The IR model consists of three core components: GeometryUnit, SemanticTag, and TopoRelation. These three components work together to ensure that subsequent topology verification, geometry optimization, and format output can be performed based on a unified data structure. The specific data instance corresponding to each parcel is referred to as the IR object.
[0093] In step S302, the system first constructs the geometric unit component.
[0094] For each polygon output in step S2, its vertex coordinates are stored in an ordered list, formatted as follows: All coordinate values must be converted to the projection coordinate system specified by the target registration platform, such as the 3-degree Gauss-Kruger projection zone 38 under the CGCS2000 national geodetic coordinate system.
[0095] The coordinate transformation can be implemented using the coordinate transformation interface provided by the PROJ or GDAL libraries. The transformation is performed based on the original spatial reference system information and target projection parameters of the input data. The original spatial reference system information comes from the metadata recorded in step S106. CAD or GIS files typically contain coordinate system definitions; if these cannot be obtained, user-preset default values are used. For CAD files, the coordinates may be in millimeters or meters, requiring conversion to real-world coordinates according to the drawing scale and coordinate system definition. For GIS files, the coordinates themselves already contain geographic references, allowing direct call to library functions for projection transformation.
[0096] For polygons from which scanned images are sourced, pixel coordinates need to be converted to actual ground coordinates. First, the image DPI information is used to convert the pixel coordinates to map coordinates in millimeters. The calculation formula is as follows:
[0097]
[0098] in , For pixel coordinates, , The image's horizontal and vertical resolutions are then determined. The map coordinates are then converted to actual ground coordinates in meters based on the drawing scale.
[0099]
[0100] The denominator of the scale is represented by "scale". For example, when the scale is 1:500, the denominator is 500. If the map does not have a geographic reference, the system establishes a local planar coordinate system with the upper left or lower left corner of the image as the origin, and uses the transformed coordinates as the actual coordinates in this coordinate system.
[0101] Each geometric unit also contains a Boolean flag named `isClosed` to indicate whether the polygon is a closed region. If the polygon originates from structured data such as a closed polyline in CAD, `isClosed` is directly set to true; if the polygon originates from an approximate contour of an unstructured image, the Euclidean distance between its first and last vertices is calculated after coordinate transformation.
[0102] in The coordinates of the first vertex, This represents the coordinates of the tail vertex. When this distance is less than a preset tolerance threshold, isClosed is forcibly set to true. The tolerance threshold is set according to the actual business accuracy requirements, and is usually 0.5 meters.
[0103] The Euclidean distance calculation is performed in the transformed real-world coordinate system to ensure consistency with the actual ground distance.
[0104] Step S303: Next, construct a semantic label component for each geometric unit. The semantic label is a set of predefined core attribute fields for real estate registration, including at least 15 fields such as parcel number, land use code, building area, name of the right holder, and real estate certificate number.
[0105] The names and data formats of these fields must strictly follow the naming and format verification of the "Real Estate Registration Database Standard". This standard is the current standard in the land and resources industry. For example, the parcel number usually adopts a combination coding method of administrative division code plus year plus serial number. The building area field is required to be in square meters and retain two decimal places. The land use code must conform to the national standard classification code, such as R2 representing Class II residential land, etc.
[0106] In actual implementation, the system can configure corresponding validation rules for each field. For example, it can use regular expressions to check whether the format of the land parcel number is valid, use numerical range to check whether the area is reasonable, and use enumerated values to check whether the usage code is within the allowed range.
[0107] If not all fields can be extracted from the drawings in step S2, the corresponding fields can be left as empty values for later manual entry or inference through related data. For example, missing information for the same land parcel may be obtained through adjacent drawings or historical archives.
[0108] Step S304: Finally, construct the topology relationship component.
[0109] To efficiently calculate the adjacency relationships between polygons, an R-tree spatial index is first established for all geometric units. Specifically, the STRtree class in the JTS Topology Suite library can be used to quickly filter out candidate objects that may intersect or be adjacent in space based on the boundary rectangle of the geometric objects. When establishing the index, each geometric unit is traversed, and the boundary rectangle of each polygon, i.e., the smallest bounding rectangle, is used as the key, while the geometric unit itself is used as the value and inserted into the STRtree.
[0110] After the index is built, each polygon is traversed and the index is used to query the set of other polygon candidates that are spatially adjacent to it. For each other polygon in the candidate set, the touches method of the JTS library is called to determine whether there is an adjacency relationship between the two polygons.
[0111] The `touches` method returns true if two polygons have at least one common point but do not intersect internally. This is the topological definition of adjacent plots in real estate registration. If `touches` determines that the polygons are adjacent, the `intersection` method is called to calculate the intersection of the two polygons. This intersection is usually a line string, i.e., a shared boundary.
[0112] The system extracts all vertex coordinates from the geometry object returned by the intersection, forming an ordered coordinate sequence, which is stored as a string of lines. At the same time, it calculates the length of the shared boundary, which can be obtained through the getLength method of JTS, and calculates the approximate direction of the boundary, for example, by determining the azimuth angle of the line connecting the first and last points. The azimuth angle can be calculated using the arctangent function.
[0113] This auxiliary information will be added to the topology component for use in subsequent verification and repair.
[0114] S4: The system performs topology rule verification and automatic repair on the unified intermediate representation model.
[0115] Step S401: Start the topology checker, traverse all IR objects (geometric units) and their associated semantic and topological information constructed in step S3, and perform two core topology rule checks on each geometric unit.
[0116] The first rule verifies whether the geometric unit corresponding to each plot meets the closure requirement. Specifically, the isClosed Boolean flag of the geometric unit must be true, and the straight-line distance between its first and last vertices must be less than a preset distance threshold δ, where δ is 0.3 meters. The straight-line distance between the first and last vertices is calculated using the Euclidean distance formula, i.e.:
[0117] in The coordinates of the first vertex, The coordinates of the tail vertex are given. If isClosed is false or the distance exceeds 0.3 meters, the polygon is determined to have a breakpoint defect.
[0118] Step S402, the second rule checks whether the common boundary of any two adjacent plots meets the requirements of collinearity and no gaps. First, the shared boundary line string of each pair of adjacent polygons is obtained from the topology relationship component.
[0119] Collinearity testing is performed by calculating the root mean square error (RMSE) of the distance between corresponding point pairs on the shared boundary line strings of two polygons. The system adopts an equal-interval sampling method, which uniformly collects the same number of sampling points on the two line strings according to the arc length parameter. The number of sampling points is taken as the larger value of the original number of vertices of the two line strings. For example, if line string A has m vertices and line string B has n vertices, then the number of sampling points N is taken as max(m,n).
[0120] In the specific sampling process, for each line string, its cumulative chord length is calculated, and then N-2 interior points are inserted at equal intervals along the total arc length. Including the start and end points, there are a total of N points, thus obtaining the corresponding point sequence on the two line strings. and Next, calculate the Euclidean distance between each pair of corresponding points, i.e.:
[0121] Then calculate the root mean square value of these distances, i.e.:
[0122] If the RMSE is less than the preset threshold ε, where ε is 0.1 meters, then the common boundaries are determined to be collinear.
[0123] Gap detection is accomplished through buffer analysis. The system generates a bidirectional buffer with a width of ±0.05 meters for the shared boundary line string, that is, it extends 0.05 meters on both sides of the line string to form a strip area.
[0124] Buffer generation can be achieved using the `buffer` method from a geometry library such as JTS, with the parameter set to 0.05 meters and the endpoint type specified as either flat or round. Flat endpoints are typically used to maintain straight boundaries. After generating the buffer, a strip region B is obtained. Next, it is checked whether two adjacent polygons P and Q completely cover the buffer. This can be determined by calculating whether the intersection of the union of buffer B and polygons P and Q equals buffer B.
[0125] Equivalent to calculation Is the difference between the area of buffer B and the area of buffer B less than the minimum tolerance? More precisely, calculate the area of buffer B covered by P and Q. If there is an area in B that is not covered by P or Q, then... If the difference between B and B is not empty, then a gap exists; if the area of the difference is 0, then there is no gap.
[0126] After the above collinearity and gapless tests are completed, the results will be recorded in the topology component for subsequent repair or output.
[0127] Step S403: If step S401 detects a breakpoint defect in a polygon, i.e., the polygon is not closed or the distance between its first and last vertices exceeds 0.3 meters, the breakpoint closure repair mechanism is automatically triggered. This mechanism uses a cubic uniform B-spline interpolation algorithm to close the breakpoint at the first vertex of the polygon. Coordinates and tail vertex Coordinates A smooth connecting curve is generated between them, thus closing the polygon.
[0128] In practice, firstly and K control points are uniformly sampled between points, with k being 3. The coordinates of these 3 control points are initially determined by linear interpolation. Assume the parameter t takes a uniform value between 0 and 1, and the parameter of the j-th control point... Then control point The coordinates are:
[0129]
[0130] To ensure the curve passes through the first and last control points and To achieve this, a suitable node vector needs to be constructed. For cubic B-splines, the node vector is usually in a clamped form, ensuring that the curve endpoints interpolate at the first and last control points. The node vector U is constructed as [0,0,0,0,1,1,1,1], with a length of 8, matching the number of control points (5) plus the order (3 plus 1). Therefore, this node vector ensures that the curve interpolates at u=0 at the first control point. Interpolate at u=1 at the last control point .
[0131] The system calls the de Boor algorithm, which is the standard recursive method for evaluating B-splines. Given a parameter u, m points are uniformly sampled in the interval [0,1], where m is 10. .
[0132] For each Using the control point sequence and node vector U, the coordinates of the corresponding points on the curve are calculated using the de Boor recursive formula. The de Boor recursive formula is as follows: For a k-th degree B-spline, given the parameter u, determine the node interval where it is located, and then repeatedly perform linear interpolation. For specific implementation, refer to relevant literature in computer graphics or computational geometry. Ten new vertices are calculated and inserted into the end of the original vertex sequence in sequence, that is, immediately after the tail vertex and before the first vertex, thus forming a closed loop.
[0133] The newly generated vertex coordinates will replace the original non-closed vertex sequence, and the isClosed flag of the geometric unit will be updated to true.
[0134] Step S404: If step S402 detects a slight overlap between two adjacent polygons, and the overlap area is less than 0.1 square meters, the system activates the overlap correction mechanism. This mechanism first calculates the centroid of the intersection region of the two polygons. This centroid is obtained by calculating the arithmetic mean of all vertices of the intersection polygons. The vertices of the intersection polygons are denoted as... Then the coordinates of the centroid O are:
[0135]
[0136] Subsequently, the system generates an offset vector along the centerline direction of the shared boundary to eliminate overlap. Specifically, for each original vertex P on the shared boundary line string with coordinates (x, y), the normal vector n at that point is calculated. Since the shared boundary is composed of discrete vertices, continuous tangents cannot be directly obtained. Therefore, the tangent and normal directions are estimated using the preceding and following points of the vertex. Let the previous vertex of the current vertex P be... The next vertex is Then the tangential vector t at point P can be approximated as: (If P is an endpoint, then only adjacent points on one side are used), and then the tangent direction is rotated 90 degrees clockwise to obtain the normal vector n pointing out of the polygon. The rotation formula is: And normalize it to a unit vector.
[0137] The system determines the offset direction based on the position of the overlapping region relative to the shared boundary. As for how to determine which side of the shared boundary the overlapping region is located on, this can be done by calculating the signed distance from the centroid O to the shared boundary.
[0138] Using the shared boundary line string as a reference, for each shared boundary line segment, calculate the directed distance from O to the line segment. The sign is determined by the line segment normal, and the sign corresponding to the smallest absolute distance among all line segments is taken as the judgment criterion.
[0139] If the center point O is located on one side of the shared boundary, the overlapping area is on that side; if the overlapping area is located on one side of the shared boundary, the corresponding vertices on that side of the polygon are offset outwards along the normal vector direction, while the corresponding vertices on the other side of the polygon are offset inwards in the opposite direction, i.e., in the opposite direction of the normal vector. The offset distance d is uniformly taken as 0.05 meters, and the vertex coordinate update formula is:
[0140] The sign is selected based on the offset direction: + for offsets to the outside and - for offsets to the inside. This operation ensures that overlapping areas are precisely eliminated while maintaining collinearity of common boundaries.
[0141] Step S405: After completing the breakpoint repair or overlap correction, repeat the verification steps S401 and S402 to verify whether the repair operation was successful. If topological defects still exist, the repair mechanism can be repeated, but to prevent infinite loops, the maximum number of iterations is set to 3. If the repair still fails after iterations, the geometric unit is marked as requiring manual intervention, and a detailed error report is generated. The report includes the defect type, location coordinates, and records of attempted repairs for subsequent manual processing.
[0142] S5: The system performs geometric optimization and outputs the verified geometric units in a standard format.
[0143] Step S501: The system starts the vector optimization engine and performs node simplification on the geometric units that have been verified and repaired in step S4. The simplification algorithm uses the Douglas-Peucker algorithm, which simplifies the shape by reducing the number of polygon vertices while preserving the overall contour features. The algorithm's distance threshold... The default value is 0.2 meters. This threshold can be adjusted according to the drawing scale or user configuration to control the degree of simplification. During the simplification process, the perpendicular distance from the vertex to the line segment needs to be calculated. Assuming the line segment consists of points A and B, the formula for calculating the perpendicular distance from vertex P to line segment AB is:
[0144] in , The modulus of the cross product The denominator is the length of the line segment. .
[0145] If the foot of the perpendicular falls on the extension of the line segment, the distance is the smaller of the distances from the point to the two endpoints. However, the Douglas-Peucker algorithm typically uses the perpendicular distance from the point to the line segment; that is, the above formula is used when the foot of the perpendicular lies on the line segment, otherwise the distance from the point to the endpoints is used. This system uses the standard Douglas-Peucker implementation, which only considers the perpendicular distance, and when the foot of the perpendicular is not on the line segment, the distance is the smaller of the distances from the point to the two endpoints to ensure the correctness of the algorithm.
[0146] Step S502, the specific execution process of the Douglas-Peucker algorithm is as follows: For each polygon, the algorithm first connects its first and last vertices to form an initial line segment. Then, it iterates through all other vertices of the polygon, calculating the perpendicular distance from each vertex to the initial line segment. If all distances are less than or equal to... If the distance is greater than 0, discard all intermediate vertices and keep only the first and last vertices; if there exists a distance greater than 0, discard all intermediate vertices and keep only the first and last vertices. If the vertex is the largest distance from the point, then find the vertex with the largest distance as the dividing point. Divide the polygonal contour into two sub-contours using this point, and recursively perform the above process on each sub-contour.
[0147] After the recursion ends, all the remaining vertices are recombined in their original order to form a simplified polygon vertex sequence. This process retains key inflection points such as building corners while reducing the number of redundant vertices, thereby reducing the overhead of subsequent storage and rendering.
[0148] Step S503: After simplifying the nodes, perform right-angle fitting on the simplified polygons.
[0149] The right-angle fitting module iterates through all interior angles of each polygon and calculates the angle value of each interior angle. , interior angle From the current vertex Adjacent vertices , The included angle between the two sides is calculated using the vector angle formula.
[0150] Let vector and , then the interior angle For vectors and The angle between the vectors is obtained by using the dot product of the vectors and the inverse cosine function:
[0151] The dot product , module length , The calculated angle is in degrees.
[0152] Step S504, for each interior angle If its angle value falls within the preset right-angle tolerance range of 85° to 95°, it is forcibly corrected to a strict 90°. The correction method adopts a geometric transformation based on vector rotation and projection, and the specific steps are as follows:
[0153]
[0154]
[0155]
[0156]
[0157] In step S505, after geometric optimization, the output format adaptation module dynamically selects the output mode according to the requirements of the target registration platform, supporting two mainstream vector formats: SVG and WKT.
[0158] The system can automatically make decisions based on the target platform identifier recorded in the user configuration or task metadata. For example, if the target platform is a real estate registration system, it will output WKT format by default, and if visualization is required, it will output SVG format.
[0159] In step S506, if the SVG output mode is selected, the system calls the Apache Batik library to render each geometric unit as an SVG element.
[0160] In practice, first create a polygon <polygon>The element, whose points property is determined by the sequence of vertex coordinates of the polygon according to... The format is generated, where the first and last coordinates are the same to ensure closure, and the coordinate values are retained to three decimal places; then, polygons are grouped according to semantic tags, for example, polygons belonging to the boundary of a plot are placed in a group. <g>In the layer group, set the id to parcel-layer, and put the building outline into another layer group, setting the id to building-layer.
[0161] The semantic label of each polygon is embedded as a custom data attribute. <polygon>Elements such as data-parcel-id and data-land-use have their attribute values extracted from semantic tags.
[0162] Style definitions are based on CSS, including stroke width, color, and fill opacity. They can be defined via inline styles or external style sheets, ultimately generating a .svg file named after the task identifier.
[0163] In step S507, if the WKT output mode is selected, the system uses the JTS topology kit to convert each geometric unit into a WKT string that strictly conforms to the OGC Simple Features standard.
[0164] For a single polygonal plot, the output format is POLYGON( The first and last coordinates are the same to indicate a closed loop, and the coordinate order is counterclockwise from the outer ring; for cases containing multiple unconnected plots, the output is MULTIPOLYGON. Nested form of ).
[0165] All coordinate values are rounded to three decimal places, corresponding to millimeter-level precision, meeting the requirements for data entry into the real estate registration database. The generated WKT file is named with the task identifier and has the extension .wkt. The file contains only the string "WKT" and no other content.
[0166] In step S508, regardless of the output format, the system simultaneously generates a metadata JSON file with the same name, recording the complete processing information of the task.
[0167] This JSON file uses English tags to represent fields and includes the following fields: taskId (task identifier), processTime (processing timestamp), inputType (input source type, such as CAD, GIS, or image), scale (original drawing scale), topologyFixed (boolean value indicating whether topology repair has been performed), repairCount (number of repairs), verticesBefore (total number of vertices before optimization), verticesAfter (total number of vertices after optimization), and outputFormat (output format). This metadata file provides a basis for subsequent quality inspection traceability and process auditing.
[0168] Example 2 In another implementation, the unified intermediate representation model further expands the version management and difference comparison functions, while the system supports parallel parsing in batch processing mode to improve the processing efficiency of large-scale registration business.
[0169] Part 1: Version Management and Difference Comparison of the Unified Intermediate Representation Model
[0170] The system maintains a historical IR object version chain for each land parcel identifier, using a snapshot mechanism to store the complete IR object after each change, and recording the change time, reason, and operator. The version chain is linked via forward pointers, supporting historical state backtracking. When a new drawing involves an existing land parcel, the system loads the latest historical version of that parcel and compares it with the current version for difference analysis. Geometric differences are quantified by calculating the Hausdorff distance and the area of the symmetric difference set between the polygons of the two versions. The Hausdorff distance measures the maximum boundary offset, and the area of the symmetric difference set reflects the size of the changed area. Attribute differences are identified by comparing the hash values of semantic label fields; if the hash values are different, the specific content before and after the change is recorded. Based on the difference calculation results, the system generates a structured change report, including the change type, location, attribute value changes, and confidence score, and pushes it to the registration personnel's interface for review and confirmation.
[0171] Part Two: Parallel Parsing in Batch Processing Mode.
[0172] When the system receives batch drawing inputs, the input module breaks down each drawing into an independent task. Each task carries a unique task identifier and metadata, and enters a task queue to await scheduling. The task queue supports priority settings, allowing urgent tasks to be processed first. The system maintains a multi-threaded worker pool, with the number of threads dynamically configured based on the number of CPU cores. Idle threads retrieve tasks from the queue and independently execute the complete processing flow from step S2 to step S5. Intermediate results from each thread are stored in a shared-memory database, isolated using the task identifier as the key, ensuring data integrity. After a task is completed, the worker thread stores the output file (SVG or WKT) and metadata (JSON) in a designated directory, which is then aggregated and returned by the output module. The system continuously monitors thread status, and abnormal tasks can be rescheduled or marked as failed.
[0173] Through the above mechanism, the traceability and change transparency of land parcel historical data are achieved, while the throughput efficiency of large-scale drawing input is significantly improved through parallel parsing.
[0174] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.< / polygon> < / g> < / polygon>
Claims
1. A method for automatically generating a vector graphic for a real estate registration, characterized by, include: Receive the original drawing input, parse the original drawing input to extract geometric elements and their associated semantic information; Based on the extracted geometric elements and semantic information, a unified intermediate representation model is constructed. The unified intermediate representation model includes geometric units, semantic tags bound to geometric units, and topological relationships that represent the shared boundary information between different geometric units. The model performs topology rule verification on the geometric units in the unified intermediate representation model, and automatically performs targeted topology repair when topology defects are detected. Topology repair includes: for the defect of unclosed polygons, a cubic uniform B-spline interpolation algorithm is used to generate a smooth closed curve to close the polygon; and for the defect of overlapping between adjacent polygons, the overlapping area is corrected based on the normal vector offset. Geometric optimization is performed on the geometric units that pass the topology rule verification. Geometric optimization includes right angle fitting of the interior angles of polygons, and correcting the interior angles within the preset tolerance range to right angles. The geometrically optimized geometric units and their associated semantic tags are converted into vector format files that meet the requirements of the target registration platform and then output.
2. The method of claim 1, wherein, Receive the original drawing input, parse the original drawing input to extract geometric elements and their associated semantic information, specifically including: The original drawing input is double-verified by a file type identifier. The double verification is based on both the file extension and the magic number in the file header to determine the true type of the input file. Based on the determined file type, the original drawing input is dynamically routed to the corresponding preprocessing path. If it is determined to be a structured CAD or GIS format, a structured parser extracts closed polylines or spline curves as geometric elements, and a spatial proximity algorithm is used to associate text entities to extract semantic information. If it is determined to be an unstructured image format, an image preprocessing unit performs edge detection and contour extraction to obtain candidate polygons as geometric elements, and an OCR engine is used to recognize the text and associate it with the corresponding polygons through the shortest spatial distance to extract semantic information.
3. The method of claim 1, wherein the method is characterized by, The unified intermediate representation model is further configured with version management functions, maintaining a version chain containing historical IR objects for each parcel identifier; when processing new drawing inputs involving existing parcels, the current version is loaded and compared with historical versions to generate a structured change report containing geometric changes and attribute changes.
4. The method for automatically generating vector graphics for real estate registration according to claim 1, characterized in that, Constructing a unified intermediate representation model further includes: An R-tree spatial index is established for all geometric units. Based on the R-tree spatial index, the adjacency relationship between different geometric units is traversed and determined. For two geometric units with an adjacency relationship, the vertex coordinate sequence, length and orientation information of their shared boundary are extracted and encapsulated as a topological relationship.
5. The method for automatically generating vector graphics for real estate registration according to claim 1, characterized in that, Topology rule validation further includes: The closure test determines whether the closure flag of a geometric unit is true, or calculates whether the Euclidean distance between its first and last vertices is less than a first preset threshold. The collinearity and gapless test determines whether collinearity exists by calculating whether the root mean square error of the distance between adjacent geometric units with topological relationships is less than a second preset threshold for adjacent geometric units, and by generating a bidirectional buffer of the shared boundary and checking whether it is completely covered by adjacent geometric units.
6. The method for automatically generating vector graphics for real estate registration according to claim 1, characterized in that, A cubic uniform B-spline interpolation algorithm is used to generate smooth closed curves to close polygons, including: Obtain the first and last vertices of the polygon with breakpoint defects; generate at least one intermediate control point by linear interpolation between the first and last vertices, and use the first, intermediate, and last vertices as the control point sequence of the B-spline curve; construct a node vector that interpolates the curve endpoints to the first and last control points; based on the control point sequence and node vector, call the deBoor algorithm to calculate multiple new vertices on the interpolation curve, and insert the new vertices into the original polygon vertex sequence to form a closed loop.
7. The method for automatically generating vector graphics for real estate registration according to claim 1, characterized in that, Correction of overlapping regions based on normal vector offset includes: Calculate the centroid of the intersection region of two adjacent polygons; determine the side where the overlapping region is located based on the position of the centroid relative to the shared boundary; calculate the normal vector at each vertex on the shared boundary; offset the corresponding vertex on the polygon located on the overlapping region side outward by a preset distance along the direction of the normal vector, and simultaneously offset the corresponding vertex on the other polygon inward by a preset distance along the opposite direction of the normal vector, so as to eliminate the overlap.
8. The method for automatically generating vector graphics for real estate registration according to claim 1, characterized in that, Correcting interior angles within a preset tolerance range to right angles includes: Traverse each vertex of the polygon and calculate the interior angle value formed by the current vertex and its adjacent vertices. If the interior angle value falls within the tolerance range of 85° to 95°, it is taken as the angle to be corrected. Using the vertex of the angle to be corrected as the base point, perform a geometric transformation based on vector rotation and projection on the two sides that make up the angle, transforming one side into a perpendicular side to the other side while keeping its length unchanged, thereby correcting the interior angle to 90°.
9. The method for automatically generating vector graphics for real estate registration according to claim 1, characterized in that, Geometric optimization of geometric units that pass topology rule verification further includes: Before performing right-angle fitting, the Douglas-Peucker algorithm is used to simplify the nodes of the geometric units to reduce the number of vertices.
10. A vector graphics automatic generation system for real estate registration, applied to the vector graphics automatic generation method for real estate registration as described in any one of claims 1 to 9, characterized in that, include: The multi-source input module is used to receive original drawing inputs, parse the original drawing inputs to extract geometric elements and their associated semantic information; The model building module is used to construct a unified intermediate representation model based on the extracted geometric features and semantic information. The unified intermediate representation model includes geometric units, semantic labels bound to the geometric units, and topological relationships that represent the shared boundary information between different geometric units. The topology verification and repair module is used to perform topology rule verification on the geometric units in the unified intermediate representation model, and automatically perform targeted topology repair when topology defects are detected. Topology repair includes: for the breakpoint defects of non-closed polygons, a cubic uniform B-spline interpolation algorithm is used to generate a smooth closed curve to close the polygon; and for the overlapping defects between adjacent polygons, the overlapping area is corrected based on the normal vector offset. The geometry optimization module is used to perform geometry optimization on geometric units that have passed the topology rule verification. Geometry optimization includes right angle fitting processing of the interior angles of polygons, correcting the interior angles within the preset tolerance range to right angles. The output adaptation module is used to convert the geometrically optimized geometric units and their bound semantic tags into vector format files that meet the requirements of the target registration platform and then output them.