A CAD software-based adaptive map tile generation method

By performing graphic feature analysis, dynamic parameter construction, and view-driven rendering in CAD software, high-precision map tiles are generated, solving the problems of cumbersome processes, low efficiency, and insufficient accuracy when converting CAD drawings to GIS platforms. This achieves efficient and accurate tile generation and multi-platform compatibility.

CN121902235BActive Publication Date: 2026-06-19TIANJIN SURVEYING & MAPPING INST CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN SURVEYING & MAPPING INST CO LTD
Filing Date
2026-03-26
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies for converting CAD drawings to GIS platforms suffer from problems such as cumbersome processes, low efficiency, data loss, insufficient accuracy, and poor compatibility. In particular, they are unable to meet sub-millimeter accuracy requirements in high-precision engineering applications.

Method used

In CAD software, the target slice area is obtained through graphic feature analysis, slice control parameters are dynamically calculated, a tile pyramid grid is constructed, view-driven rendering is performed to generate raster tile images, symbolic enhancement and boundary compensation are combined, and finally, the metadata file of the GIS platform is configured.

Benefits of technology

It enables efficient and high-precision generation of map tiles in the native CAD environment, preserving the fine symbolization effect of CAD drawings, solving the data loss and compatibility issues in the traditional conversion process, and meeting the needs of high-precision engineering applications.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

This invention discloses an adaptive map tile generation method based on CAD software, comprising: a graphic feature analysis step; a dynamic parameter construction step; a grid planning step; a view-driven rendering step; and a service configuration generation step. According to a preset geographic information system platform specification, a metadata configuration file describing the raster tile image is generated, and the raster tile image and the metadata configuration file are combined and stored. This invention provides an adaptive map tile generation method based on CAD software, which, through steps such as graphic feature analysis, dynamic parameter construction, grid planning, view-driven rendering, and service configuration generation, achieves efficient and high-precision generation of map tiles in the native CAD environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geographic information system (GIS) and computer-aided design (CAD) data processing, and more specifically, to an adaptive map tile generation method based on CAD software. Background Technology

[0002] In numerous fields such as engineering design, urban planning, transportation and water conservancy, and natural resource management, computer-aided design (CAD) drawings, especially DWG format engineering drawings, serve as core data carriers, containing highly detailed and precise symbolic information. This information, including custom linetypes, gradient fills, complex blocks, and precise annotations, is irreplaceable in accurately expressing design intent and effectively guiding engineering construction. However, the closed nature of CAD data formats makes it difficult to efficiently browse and share them directly on modern Geographic Information System (GIS) platforms, especially WebGIS platforms. Typically, CAD data requires a series of complex and time-consuming conversion processes to adapt to the needs of GIS platforms.

[0003] Existing technologies face numerous challenges and pain points in this conversion process. First, traditional conversion methods often rely heavily on multi-step, multi-software collaborative operations, resulting in fragmented processes and low efficiency. For example, CAD drawings may first need to be exported as image files from software such as AutoCAD, and then perform grid creation, coordinate transformation, and tile publishing operations using professional GIS software such as ArcMap. This cross-software, multi-stage operation is not only cumbersome but also easily leads to the loss of the original fine symbolic effects of the CAD drawings during the conversion process, thus affecting the visual quality and information expression ability of the final map tiles. Although some web-based conversion solutions may support multi-threaded processing, they usually rely on server environments, which not only poses potential data security risks but also makes it difficult to fully preserve the rich and detailed symbolic information in CAD drawings.

[0004] Secondly, existing tile slicing methods generally employ fixed resolution and scale parameters. This rigid approach leads to serious deficiencies in accuracy and adaptability. For simple drawings with sparse graphic entities, a fixed high resolution may generate a large amount of redundant data, significantly increasing storage volume, while the improvement in visual quality is not significant. Conversely, for complex drawings with highly dense graphic entities, such as city master maps containing thousands of entities, a fixed low resolution may cause distortion of key symbols, line overlap, or loss of small tiles, severely affecting map usability and information accuracy. Furthermore, during tile splicing, insufficient coordinate calculation accuracy can easily lead to jagged edges or misalignments at tile boundaries. Traditional coordinate matching errors are typically greater than 0.001 meters, which is far from meeting the stringent requirements for sub-millimeter accuracy in high-precision engineering applications, such as high-precision engineering layout and precision pipe gallery construction in specific CAD fields.

[0005] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention

[0006] The purpose of this invention is to provide an adaptive map tile generation method based on CAD software, which has the advantages of achieving efficient and high-precision map tile generation in the native CAD environment and solving problems such as data loss, low efficiency and poor compatibility in traditional conversion processes.

[0007] This invention provides an adaptive map tile generation method based on CAD software, the technical solution of which is as follows: The method includes:

[0008] Graphic feature analysis steps: In CAD software, obtain the target slice area of ​​the graphic data to be converted, and count the graphic entity feature data within the target slice area;

[0009] Dynamic parameter construction steps: Based on the graphic entity feature data, calculate the slicing control parameters used to generate tiles. The slicing control parameters include at least the tile resolution.

[0010] Grid planning steps: Based on the target slice area and slice control parameters, construct a tile pyramid grid system containing several tile units;

[0011] View-driven rendering steps: Traverse the tile pyramid grid system, control the view window of the CAD software to adjust to the geographical range corresponding to each tile unit, and render the vector graphics in the current view window as a raster tile image;

[0012] Service configuration generation steps: Based on the preset geographic information system platform specifications, generate a metadata configuration file describing the raster tile image, and store the raster tile image and the metadata configuration file together.

[0013] Through the above solution, the present invention can achieve efficient generation of map tiles in the native CAD environment, avoid the complexity of traditional multi-software conversion, and effectively preserve the fine symbolization effect of CAD drawings.

[0014] This invention provides an adaptive map tile generation method based on CAD software. Through steps such as graphic feature analysis, dynamic parameter construction, grid planning, view-driven rendering, and service configuration generation, it achieves efficient and high-precision map tile generation within a native CAD environment. Specifically, the graphic feature analysis step acquires target tile areas and graphic entity feature data, providing a foundation for subsequent intelligent decision-making; the dynamic parameter construction step calculates adaptive tile control parameters based on feature data, overcoming the limitations of traditional fixed parameters; the grid planning step constructs a tile pyramid grid system, providing a structured framework for tile generation; the view-driven rendering step utilizes the view control and rendering capabilities of CAD software to convert vector graphics into high-quality raster tiles, and combines techniques such as symbolic enhancement, boundary compensation, and integer coordinate calculation to ensure visual consistency and sub-millimeter accuracy of the tiles; the service configuration generation step generates metadata configuration files according to GIS platform specifications, achieving multi-platform adaptation and data security. Therefore, this invention has the advantages of achieving efficient and high-precision map tile generation in a native CAD environment and solving problems such as data loss, low efficiency, and poor compatibility in traditional conversion processes. Detailed Implementation

[0015] The technical solutions of this invention will now be clearly and completely described in conjunction with the embodiments thereof. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0016] To address the numerous problems mentioned above, this invention provides an adaptive map tile generation method based on CAD software. This method aims to build a fully automated solution within the native environment of CAD software, achieving a one-stop, high-fidelity, and high-efficiency conversion from raw graphic data to multi-platform compatible map tile services.

[0017] The method includes the following core steps: First, a graphic feature analysis step is performed, in which the target slice area of ​​the graphic data to be converted is obtained in the CAD software, and the graphic entity feature data within the target slice area is statistically analyzed; next, a dynamic parameter construction step is performed, in which slice control parameters for generating tiles are calculated based on the graphic entity feature data, and the slice control parameters include at least the tile resolution; then, a grid planning step is performed, in which a tile pyramid grid system containing several tile units is constructed based on the target slice area and the slice control parameters; subsequently, a view-driven rendering step is performed, in which the tile pyramid grid system is traversed, the view window of the CAD software is adjusted one by one to the geographic range corresponding to each tile unit, and the vector graphics in the current view window are rendered and output as raster tile images; finally, a service configuration generation step is performed, in which a metadata configuration file describing the raster tile image is generated according to the preset geographic information system platform specifications, and the raster tile image and the metadata configuration file are combined and stored.

[0018] The entire method can be understood as a highly integrated, automated workflow running within the CAD software. When a user, such as an architect or urban planner, wants to publish their completed DWG drawings as an interactive map that can be viewed online, there is no need for cumbersome data export and software switching. The user simply loads a script program that implements this method, such as AutoCADLISP, into the CAD software environment and executes a simple startup command.

[0019] After the method is initiated, it first enters the graphic feature analysis step. The core task of this step is to intelligently determine the precise geographical area that needs to be converted into tiles. Traditionally, users need to manually select a rectangular area on the drawing, which is tedious and error-prone. If the selected area is too large, it will include a large amount of useless blank space, increasing unnecessary calculations and storage space; if the area is too small, important information at the edge of the drawing, such as the frame, title block, or key annotations, may be missed. This method solves this problem automatically. The program automatically scans all graphic data in the currently open CAD software, analyzing the spatial location information of each graphic entity, such as lines, circles, polylines, text, and blocks.

[0020] Specifically, graphic entity feature data includes graphic entity density. The steps for obtaining the target slice area of ​​the graphic data to be converted include: scanning the full-map data in the CAD software and analyzing the spatial distribution of graphic entities; calculating the graphic entity density distribution map of the entire map based on the spatial distribution; identifying high-density core areas based on the graphic entity density distribution map, and determining the boundary range of the high-density core areas as the target slice area.

[0021] After determining the target tiling region, the method proceeds to the dynamic parameter construction step. This step is the core of the planning for high-quality output, aiming to tailor an optimal tiling scheme for the specific drawing. A key tiling control parameter is the tile resolution, i.e., the number of pixels per inch. As mentioned earlier, using a fixed resolution can lead to numerous problems. Therefore, this method dynamically calculates the tile resolution most suitable for the complexity of the current drawing based on the graphic entity feature data obtained in the previous step.

[0022] Specifically, the steps for calculating the slicing control parameters used to generate tiles based on graphic entity feature data include: obtaining a preset density-resolution mapping model, which defines the functional relationship between graphic entity density and tile resolution; statistically analyzing the graphic entity density within the target slice area and substituting the statistical results into the density-resolution mapping model to calculate the target tile resolution adapted to the current graphic complexity; and calculating the total number of levels in the tile pyramid based on the target tile resolution and the size of the target slice area.

[0023] The purpose of establishing a density-resolution mapping model is to quantify the proportional relationship between graphic complexity and display precision. In practical applications, this model manifests as a pre-defined mathematical formula: the target tile resolution equals the base resolution multiplied by one, plus the product of a complexity coefficient and the logarithm of the graphic entity density. The base resolution is typically set to 200 DPI to ensure basic visual clarity. The complexity coefficient, as an adjustment factor, is usually between 0.25 and 0.4, used to control the sensitivity of resolution to changes in graphic density. The graphic entity density is obtained by dividing the total number of graphic entities within the target tile area by the total area of ​​that area. Through this mapping model, the calculation process can automatically sense the density of the drawing content, thereby automatically increasing the tile resolution in densely graphic areas, ensuring that fine lines or dense annotations do not become pixelated and are not lost or blurred.

[0024] In practical applications, to further improve the visual quality of tile maps, especially at the junctions of adjacent tiles, it is necessary to address potential jagged edges or broken lines. To this end, the step of calculating the slicing control parameters used to generate tiles further includes obtaining the average linewidth value of the graphic entity within the target slice area, and calculating the boundary compensation amount based on the target tile resolution and the average linewidth value. Correspondingly, the step of controlling the CAD software's view window to adjust to the geographic range corresponding to each tile unit includes extending the theoretical boundary of the tile unit outwards by the boundary compensation amount to determine the actual rendering view range, thereby forming an anti-aliasing buffer containing graphic overlap information at the junctions of adjacent tiles.

[0025] The boundary compensation amount refers to the additional width of the graphic range included when rendering a single tile image to eliminate visual defects at seams. The calculation logic for this parameter is based on the average linewidth of the graphic entities within the target slice area and the tile resolution of the current layer. The calculation formula is: boundary compensation amount equals the average linewidth multiplied by a safety factor, then divided by the tile resolution. The safety factor is typically between 1.5 and 2.0 to ensure that the compensation range covers the edges of the thickest lines. When executing view adjustment commands, the program expands the theoretical geometric boundary coordinates of the tile unit outwards by this boundary compensation amount, forming an actual rendering range. After this processing, lines located at the intersection of two tiles are repeatedly drawn on the edges of adjacent tiles. When a user browses the stitched map on a geographic information system platform, these overlapping pixels can be smoothly blended through an anti-aliasing algorithm, thereby eliminating any potential line breaks or misalignments at the tile edges.

[0026] The grid planning step involves constructing a standard tile pyramid grid system based on the determined target tile area and dynamically calculated tile control parameters. This system is the organizational structure of map tiles, consisting of multiple levels, each level composed of several rows and columns of tile cells. It ranges from the top level (level 0) where one or a few tiles cover the entire area, to the bottom level (e.g., level 18) where millions of high-resolution tiles meticulously depict local details. The planning process ensures that the entire target tile area is completely covered by this grid system and calculates the precise geographic coordinate range of each level and each tile cell.

[0027] At this point, all preparations are complete, and the method enters the core view-driven rendering step. This step is the execution phase that actually generates the tile image. The program traverses every tile unit in the tile pyramid grid system in a sequence from top to bottom, from left to right, and from top to bottom. For each tile unit, the program sends view control commands to the CAD software, such as calling AutoCAD's vla-ZoomWindow function to precisely zoom and pan the software's current view window to the geographic area corresponding to that tile unit.

[0028] In the process of rendering vector graphics within a view window into a raster tile image, a series of symbolic enhancement processes are required to ensure good readability and visual effects of the final tile map at different zoom levels. Specifically, the steps for rendering vector graphics within the current view window into a raster tile image include: obtaining the layer depth of the current tile unit in the tile pyramid grid system; performing symbolic enhancement processing on the vector graphics within the current view window based on the layer depth, including adjusting line width, fill color, or annotation font size to adapt to the display ratio of the current layer; and calling the rendering engine of the CAD software to capture and convert the symbolically enhanced content of the current view window into a bitmap format raster tile image.

[0029] Finally, to achieve visual consistency of map symbols across different levels, the symbolization enhancement process can also include screen space sizing processing for tile reference entities. This processing includes: identifying tile reference entities used as map symbols within the current view window; obtaining the preset symbol screen pixel size and calculating the dynamic scaling factor that maps the symbol screen pixel size to the current geographic coordinate system based on the tile resolution of the current tile unit; and applying the dynamic scaling factor to the transformation matrix of the tile reference entity before calling the rendering engine, so that the tile reference entity maintains a constant pixel area in raster tile images at different levels, achieving cross-level visual consistency of map symbols.

[0030] As a specific implementation method, when generating urban municipal pipeline network map tiles containing a large number of facility symbols, a dynamic enhancement strategy based on screen space pixel mapping is implemented to ensure that various valves, fire hydrants, and maintenance well tiles remain clearly distinguishable and of consistent size at different levels. This involves identifying all tile reference entities in the drawing that serve as facility markers. A target display size is pre-set, for example, always occupying 24 by 24 pixels on the display terminal.

[0031] Before rendering tiles at a specific level, the resolution value of the current tile is obtained. The calculation process involves a scaling mapping that converts the target pixel size to a geospatial size. Specifically, the dynamic scaling factor equals the target display size divided by the tile resolution. Before calling the rendering engine, this dynamic scaling factor is applied in real time to the tile's transformation matrix by modifying the scale factor attribute of the tile's reference entity. In high-level macro views, tile entities are automatically enlarged to prevent symbols from shrinking to unrecognizable dots; in low-level micro views, tile entities maintain an appropriate scale to avoid obscuring the background map. This process ensures that map symbols maintain a constant visual area as they switch between city-wide overviews and detailed street-level maps. This cross-level visual consistency allows technicians to quickly identify facility locations at different zoom levels, significantly improving the professionalism and interactive experience of online map services.

[0032] For tile reference entities used as map symbols in drawings, such as symbols representing fire hydrants or transformer boxes, regular scaling can cause them to appear enormous when the map is zoomed in and too small when zoomed out. To address this issue, the program identifies these tiles used as map symbols. When rendering tiles at each level, it dynamically calculates a scaling factor applicable to the tile reference entity based on a preset, desired symbol screen pixel size (e.g., wanting the symbol to always maintain a 16x16 pixel size on the screen) and the current tile resolution. This dynamically calculated scaling factor is applied to the tile's transformation matrix before calling the rendering engine. The result is that regardless of how the user zooms in on the map, these map symbols maintain a constant, visually consistent size in the final raster tile image, greatly improving the map's professionalism and readability.

[0033] After symbolization enhancement, the program calls the CAD software's built-in rendering engine to capture all content displayed in the current view window and convert it into a bitmap image file—a raster tile image. This process fully utilizes the powerful graphics display capabilities of the CAD software, ensuring high fidelity in the conversion from vector data to raster images. All original symbolization effects, such as complex line types and fills, are perfectly preserved.

[0034] When processing specialized CAD drawings with extremely high geometric accuracy requirements, such as precision layout drawings used to guide automated construction or robot path planning, conventional floating-point arithmetic can accumulate significant errors, leading to minor misalignments at tile joints. To fundamentally address this issue, a high-precision geometric processing strategy can be employed to adjust the CAD software's view window to the geographic area corresponding to each tile unit.

[0035] Specifically, the steps include: establishing a local integer coordinate system with the corner coordinates of the current tile unit as the origin; multiplying the floating-point coordinates of the target view range by a preset scaling factor to convert them into integer coordinates; performing geometric transformation operations for view positioning in the local integer coordinate system; and inversely converting the calculation results into floating-point coordinates to drive the view interface of the CAD software, thereby eliminating the accumulated error of floating-point operations.

[0036] As a specific implementation method, when processing high-precision underground utility tunnel construction design drawings, traditional floating-point coordinate calculations can introduce minute rounding errors due to bit limitations during continuous scaling and positioning, especially when sub-millimeter-level sensor positioning and fiber optic path planning are involved. To address this challenge, a coordinate domain transformation operation is performed in the view-driven rendering step. When the view window needs to be adjusted to a specific tile unit, the original floating-point coordinates of the lower left corner of that tile unit are first obtained as the reference origin. Subsequently, the relative offset between the theoretical boundary coordinates of the tile unit in the global coordinate system and the reference origin is calculated.

[0037] In this implementation, a magnification factor of one million is introduced. The floating-point value of the relative offset is multiplied by this magnification factor and forcibly converted to a long integer type. All translation transformations, rotation transformations, and the positioning calculation of the view center point are completed within this local integer coordinate system space, which is measured in micrometers. The characteristics of integer operations ensure that the coordinate values ​​do not suffer from precision decay regardless of the number of geometric transformations. After finally determining the integer position of the view center, the result is divided by the magnification factor and converted back to a floating-point number that meets the requirements of the CAD software view interface. This processing method ensures that the positioning accuracy of each tile in the pipe gallery drawings, which are several kilometers long, remains within 0.1 millimeters. It completely solves the problem of jumps or slight misalignments of fine symbols at tile joints at high zoom levels, providing reliable basic map support for the automated operation and maintenance path of robots in the pipe gallery.

[0038] The core idea behind this method lies in coordinate domain transformation. When performing highly precise geometric calculations such as view positioning, the program does not directly use the global floating-point coordinates of the CAD software. Instead, it uses the coordinates of the lower left corner of the currently processed tile unit as a temporary local coordinate system origin. Then, the floating-point coordinate values ​​of the target view range are multiplied by a very large preset factor, such as one million. Through this operation, the floating-point coordinates, originally in meters and containing multiple decimal places, are converted into huge integers in micrometers without decimal parts. All subsequent view positioning geometric transformations, such as translation and scaling calculations, are completed in this local integer coordinate system. Since integer operations are completely precise and there is no rounding error, the accumulation of tiny errors in floating-point operations can be completely eliminated. Only when all calculations are completed and the final view range coordinates need to be passed to the CAD software's view interface are these precise integer operation results divided by the same factor again, inversely converting them back to floating-point coordinates. This strategy cleverly avoids the precision bottleneck of floating-point operations, ensuring that the geometric alignment accuracy between tiles reaches the sub-millimeter level, thereby eliminating misalignment at the splicing points.

[0039] To further improve processing efficiency and optimize storage space, a pre-detection step can be added before calling the CAD software's rendering engine. Specifically, before calling the CAD software's rendering engine, the method also includes using the CAD software's spatial indexing interface to detect whether a graphic entity exists within the geographic range of the current tile unit; if the detection result is that it does not exist, the current tile unit is marked as an empty tile, and subsequent symbolization enhancement processing and rendering steps are skipped; if the detection result is that it exists, subsequent symbolization enhancement processing and rendering steps are performed.

[0040] Before rendering a tile unit, the program uses the efficient spatial indexing interface of the CAD software to perform a quick query to determine whether any graphic entities exist within the geographic area corresponding to the current tile unit. For a drawing containing large blank areas, such as a site plan with buildings only in the central area, many tile units will actually be empty. If the detection result indicates that no graphic entities exist, the program will mark this tile unit as an empty tile and skip all subsequent time-consuming symbolization enhancement and view rendering steps, immediately starting to process the next tile unit. This simple pre-check step can greatly reduce the total amount of tasks that need to be processed, and is one of the key steps to improve the overall tiling efficiency.

[0041] To handle the massive computational demands of large-scale drawings and improve the efficiency of the entire rendering process, the step of traversing the tile pyramid grid system can be performed in parallel. Specifically, the steps of traversing the tile pyramid grid system include creating multiple parallel processing threads and assigning several tile units from the tile pyramid grid system to each thread. The step of controlling the CAD software's view window to adjust to the geographic range corresponding to each tile unit involves each parallel processing thread sending view control commands to the CAD software to drive the view window to position itself within the assigned coordinate range of the tile unit.

[0042] To enhance the stability and reliability of long-duration tiling tasks, the step of traversing the tile pyramid grid system can also include a mechanism for resuming tiling at breakpoints. Specifically, this step also includes writing the unique code of a tile unit to a local progress log file after each parallel processing thread completes the rendering output of that tile unit; during the method startup phase, the progress log file is read to construct a list of completed tasks, and tile units belonging to the list of completed tasks are removed from the tile pyramid grid system to be processed, thus achieving resuming tiling at breakpoints.

[0043] As a specific implementation method, when processing large-scale land use maps covering the entire county, the number of tiles involved can reach hundreds of thousands, and the tiling task often needs to run continuously for a long time. To prevent task loss due to accidents or program crashes, after performing grid planning, the total task is divided into multiple independent batches. A corresponding number of parallel threads are created based on the number of processor cores in the computer, with each thread responsible for rendering one batch.

[0044] Within each thread's rendering loop, whenever a raster tile image is successfully generated and stored, the thread immediately writes a record to a mutex-protected local text file, including the level, row number, and column number. When an exception occurs and the generation process restarts, the task scheduling module first scans the output directory and reads the progress log file. The scheduling module compares the tile codes in the log file with the overall task grid, automatically discarding tasks that already exist and are fully recorded. This mechanism allows the generation process to automatically resume from the last successfully written tile position.

[0045] During parallel processing, each time a thread successfully generates a tile image and writes it to disk, it appends the unique code of that tile unit—such as its layer, row number, and column number—to a local progress log file. If an unexpected interruption occurs during tiling, when the user restarts the method, the program first checks if this progress log file exists. If it exists, the program reads the file contents and constructs a list of completed tasks. Before starting a new rendering task, all completed tile units are removed from the overall tile pyramid grid.

[0046] Finally, once all the tile images have been generated, the method proceeds to the service configuration generation step. The goal of this step is to package these scattered tile image files into a standard map service that can be directly recognized and published by mainstream geographic information system platforms. Map services on different platforms have different directory structures, configuration file formats, and naming conventions.

[0047] To address this compatibility issue, the pre-defined GIS platform specifications include configuration file templates for various GIS platforms. The steps for generating a metadata configuration file describing a raster tile image include: receiving a user-inputted target publishing platform selection instruction; retrieving the corresponding configuration file template from the pre-defined GIS platform specifications based on the target publishing platform selection instruction; extracting coordinate system parameters and the hierarchical parameters of the tile pyramid grid system from the CAD software; and filling the coordinate system parameters and hierarchical parameters into the configuration file template to generate a metadata configuration file adapted to the target publishing platform.

[0048] Regarding multi-platform adaptation, to achieve more perfect cross-platform compatibility, the step of generating a metadata configuration file adapted to the target publishing platform can also include adaptive coordinate system transformation. Specifically, this step also includes: identifying the preset coordinate systems of various target publishing platforms defined in the configuration file template; obtaining the original coordinate system of the current graphic data in the CAD software; calculating the coordinate transformation parameters from the original coordinate system to the preset coordinate system; and using the coordinate transformation parameters to perform a reprojection transformation on the tile origin coordinates in the metadata configuration file.

[0049] Computer-aided design drawings typically use local or national standard coordinate systems, while WebGIS platforms generally use globally projected coordinate systems such as Web Mercator. When generating the metadata configuration file, the program identifies the coordinate system preset by the target publishing platform selected by the user, and simultaneously obtains the original coordinate system of the current CAD drawing. Then, the program calculates the mathematical parameters required for the transformation from the original coordinate system to the target preset coordinate system. Finally, using these transformation parameters, a reprojection transformation is performed on key information recorded in the metadata configuration file, such as the tile origin coordinates and geographical extent. This step ensures that the generated tile dataset can be correctly overlaid and displayed with other data on standard web maps, achieving a higher level of cross-platform compatibility.

[0050] At the initial stage of the process, an interface is provided allowing users to select their target publishing platform, such as ArcGIS Server, QGIS, or SuperMap. The program pre-loads configuration file templates for these mainstream platforms. Based on the user's selection, the program automatically calls the corresponding template and extracts key metadata from the CAD software's graphic data, such as the original coordinate system parameters and information like the tile pyramid hierarchy parameters, tile size, and geographic extent obtained from the grid planning steps. Then, these extracted parameters are automatically populated into the corresponding fields of the configuration file template, generating a metadata configuration file that fully conforms to the target platform's specifications, such as the conf.xml and conf.cdi files for the ArcGIS platform. Simultaneously, the generated tile image files and the directory structure storing these files strictly adhere to the target platform's naming and organization standards. Finally, all generated raster tile images and this metadata configuration file are combined and stored in a unified folder, forming a ready-to-use, highly optimized final tile dataset. Users simply need to deploy this folder to the appropriate server or load it into desktop software to complete map publishing and use.

[0051] Through the close collaboration of the above steps, this method constructs a fully automated solution within the native environment of CAD software, encompassing intelligent range determination, dynamic parameter planning, efficient parallel rendering, and multi-platform configuration generation. This not only greatly simplifies the operation process and lowers the barrier to entry, but also significantly improves the quality, accuracy, and processing efficiency of output tiles through a series of intelligent technologies, addressing many pain points in existing technologies.

[0052] To optimize storage space, the process of processing tiles marked as empty can be further refined by combining the storage of raster tile images with metadata configuration files. Specifically, this process includes: counting all tile units marked as empty and identifying consecutive empty tile regions; extracting the row and column range information of consecutive empty tile regions; and generating a virtual tile index file to record the row and column range information. The virtual tile index file is used to replace the physical image file of the empty tile for storage.

[0053] The virtual tile index file is a logical file that records geographic blank areas based on a lightweight data format. After performing empty tile detection, the program does not generate any image files for geographic areas without entities. Instead, it merges the row and column numbers of these consecutive empty tile units. The recognition algorithm finds the largest rectangular combination that can cover multiple adjacent empty tiles and extracts the row and column coordinates of the top-left and bottom-right corners of these rectangles. This coordinate range information is written to a JSON file named `empty_tile_index`. This index file is stored at the root of the tile storage directory. The front-end program of the geographic information system platform reads this file before initiating an image request. If the requested tile coordinates fall within the range of the index record, the front-end will directly display a transparent background or a preset background color, instead of requesting a real image file from the server, thus avoiding the consumption of network bandwidth by a large number of invalid requests.

[0054] During the data integration phase after all tiles have been processed, the program counts all tile units marked as empty. It analyzes the distribution of these empty tiles and identifies consecutive rectangular empty tile regions. For these consecutive empty regions, the program does not generate any actual image files. Instead, it generates a lightweight virtual tile index file, such as a JSON text file. This file records the start and end row and column number ranges of these consecutive empty tile regions. When a WebGIS client requests map tiles, it can first read this index file to identify which areas are empty, thus avoiding sending thousands of invalid requests for empty images to the server. This approach can potentially reduce the final storage size by 40%-60% and significantly improve the loading performance of the front-end map.

[0055] Regarding the optimization of the image file itself, an adaptive compression mechanism can be introduced in the step of capturing and converting the current view window content, after symbolic enhancement processing, into a bitmap-formatted raster tile image. Specifically, this step includes analyzing the color complexity or geometric features of the captured view content; when the color complexity is below a preset threshold, encoding the raster tile image using a first compression format; and when the color complexity is above the preset threshold, encoding the raster tile image using a second compression format with a higher compression ratio than the first compression format. The color complexity threshold is a key quantitative indicator used to guide the adaptive compression decision. This threshold is determined through real-time pixel histogram analysis of the captured view window content.

[0056] When generating the image file for each non-empty tile, the program first quickly analyzes the visual features of its content. For example, it determines the color complexity by calculating the image's color histogram. If a tile's content mainly consists of lines with a few colors and solid fills, such as a simple pipeline diagram, its color complexity is below a preset threshold. In this case, a first compression format, such as PNG-8 or high-quality JPEG, is used for encoding because these formats offer good compression ratios and visual effects in such scenarios. Conversely, if the tile content contains rich gradients, complex fill patterns, or photo-textures, such as a colored landscape design drawing, its color complexity exceeds the threshold. In this case, a second compression format with a higher compression ratio, such as WebP, is used for encoding. This targeted adaptive compression strategy ensures that each tile is stored with the smallest possible file size while maintaining visual quality, thereby further optimizing storage efficiency.

[0057] It is worth emphasizing that a key feature of this method is its complete localization. All steps are encapsulated within the CAD software's internal script interpreter environment and executed on the local computer's memory and storage, eliminating the need to upload graphic data to an external web server. This means that from loading the original DWG file to outputting the final tile dataset, the user's core geographic data never leaves their own computer. This is crucial for engineering design projects involving sensitive information, fundamentally eliminating the security risks of data leakage during network transmission or processing on third-party servers.

[0058] To ensure the rendered tile image is clean and free of interference, the view-driven rendering step can also perform an environment purification sub-step before traversing the tile pyramid grid system. This sub-step includes: scanning the current view environment of the CAD software, identifying non-printable auxiliary elements that are active, including at least drawing grids, coordinate system icons, and view navigation controls; generating and executing environment configuration instructions to set the visibility attribute of non-printable auxiliary elements to hidden and clear the graphic selection set in the current view to eliminate visual interference from non-map data; modifying the background color of the view window to a preset transparency key value color, which is used to be identified and converted into the transparency channel when generating the raster tile image later; and restoring the non-printable auxiliary elements and background color to their initial state after traversing the tile pyramid grid system.

[0059] Before starting the rendering loop, the program automatically scans and temporarily hides all non-map auxiliary elements in the CAD software view, such as background drawing grids, coordinate system icons, and view navigation controls. Simultaneously, it clears any existing graphic selection sets to prevent highlight effects from being rendered into the tiles. Furthermore, it temporarily changes the background color of the view window to a preset, rarely used special color in drawings, such as pure magenta. This color will serve as the key value for transparency. When generating tile images subsequently, all magenta pixels can be easily identified and converted into alpha channels, resulting in tiles with transparent backgrounds, facilitating overlay on different base maps. After all tile rendering is complete, the program automatically restores these environmental settings to their initial state, ensuring no permanent impact on the user's normal working environment.

[0060] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A CAD software based adaptive map tile generation method, characterized in that, include: Graphic feature parsing steps: Obtain the target slice region of the graphic data to be converted, and count the graphic entity feature data within the target slice region; Dynamic parameter construction steps: Based on the graphic entity feature data, calculate the slicing control parameters used to generate tiles, wherein the slicing control parameters include at least the tile resolution; Grid planning steps: Based on the target slice area and the slice control parameters, construct a tile pyramid grid system containing several tile units; View-driven rendering steps: Traverse the tile pyramid grid system, control the view window of the CAD software to adjust to the geographical range corresponding to each tile unit, and render the vector graphics in the current view window as a raster tile image; Service configuration generation steps: According to the preset geographic information system platform specifications, generate a metadata configuration file describing the raster tile image, and store the raster tile image and the metadata configuration file together. The graphic entity feature data includes graphic entity density. The step of obtaining the target slice area of ​​the graphic data to be converted includes: scanning the full map data in the CAD software and analyzing the spatial distribution of graphic entities; Calculate the density distribution map of the graphic entities in the entire map based on the spatial distribution. Based on the graphic entity density distribution map, a high-density core region is identified, and the boundary range of the high-density core region is determined as the target slice region. The step of calculating the slice control parameters used to generate the tile includes: obtaining a preset density and resolution mapping model, wherein the density and resolution mapping model defines the functional relationship between graphic entity density and tile resolution. The density of graphic entities within the target slice area is statistically analyzed, and the statistical results are substituted into the density-resolution mapping model to calculate the target tile resolution adapted to the current graphic complexity. The total number of levels of the tile pyramid is calculated based on the target tile resolution and the size of the target slice area.

2. The CAD software-based adaptive map tile generation method of claim 1, wherein, The view-driven rendering step includes: obtaining the current layer depth of the tile unit in the tile pyramid grid system; The vector graphics in the current view window are symbolically enhanced according to the layer depth. The symbolic enhancement process includes adjusting the line width, fill color, or annotation font size to adapt to the display ratio of the current layer. The rendering engine of the CAD software is invoked to capture and convert the content of the current view window, after the symbolization enhancement process, into a bitmap format raster tile image.

3. The CAD software-based adaptive map tile generation method of claim 1, wherein, The preset geographic information system platform specifications include configuration file templates for various geographic information system platforms; The step of generating a metadata configuration file describing the raster tile image includes: receiving a target publishing platform selection instruction input by the user; According to the target publishing platform selection instruction, the corresponding configuration file template is called from the preset geographic information system platform specification; Extract the coordinate system parameters and the hierarchical parameters of the tile pyramid grid system from the CAD software; The coordinate system parameters and the hierarchy parameters are filled into the configuration file template to generate the metadata configuration file adapted to the target publishing platform.

4. The CAD software-based adaptive map tile generation method of claim 2, wherein, The step of controlling the view window of the CAD software to adjust to the geographical range corresponding to each tile unit in the view-driven rendering step includes: taking the average line width value of the graphic entity in the target slice area, calculating the boundary compensation amount according to the target tile resolution and the average line width value, extending the theoretical boundary of the tile unit outward by the boundary compensation amount, and determining the actual rendering view range to form an anti-aliasing buffer containing graphic overlap information at the splicing of adjacent tiles.

5. The CAD software-based adaptive map tile generation method of claim 1, wherein, The step of controlling the view window of the CAD software to adjust to the geographical range corresponding to each tile unit in the view-driven rendering step includes: establishing a local integer coordinate system with the corner coordinates of the current tile unit as the origin; Multiply the floating-point coordinates of the target view range by a preset magnification factor to convert them into integer coordinates; Perform geometric transformation operations for view positioning in the local integer coordinate system; The calculation result is converted back to floating-point coordinates to drive the view interface of the CAD software, thereby eliminating the accumulated error of floating-point calculations.

6. The CAD software-based adaptive map tile generation method of claim 1, wherein, Before invoking the rendering engine of the CAD software, the method further includes: using the spatial indexing interface of the CAD software to detect whether there are graphic entities within the geographical range of the current tile unit; When the detection result is that the tile unit does not exist, the current tile unit is marked as an empty tile, and the subsequent symbolization enhancement processing and rendering steps are skipped; If the detection result indicates that the symbolization enhancement process exists, the subsequent symbolization enhancement and rendering steps are executed.

7. The CAD software-based adaptive map tile generation method of claim 6, wherein, The step of combining and storing the raster tile image with the metadata configuration file includes: counting all tile units marked as empty tiles and identifying continuous empty tile regions; Extract the row and column range information of the continuous empty tile regions; A virtual tile index file is generated to record the row and column range information. The virtual tile index file is used to replace the physical image file of the empty tile for storage.

8. The CAD software-based adaptive map tile generation method of claim 1, wherein, The view-driven rendering step also includes an environment purification sub-step performed before traversing the tile pyramid grid system: scanning the current view environment of the CAD software and identifying non-printing auxiliary elements that are enabled, the non-printing auxiliary elements including at least drawing grids, coordinate system icons and view navigation controls; Generate and execute environment configuration instructions to set the visibility attribute of the non-printing auxiliary elements to hidden and clear the graphic selection set in the current view to eliminate visual interference from non-map data; The background color of the view window is modified to a preset transparency key value color, which is used to be identified and converted into a transparency channel when the raster tile image is subsequently generated; After traversing the tile pyramid grid system, the non-printing auxiliary elements and the background color are restored to their initial state.