ArcGIS secondary development-based ecological red line exploration map automatic generation method and system
Through ArcGIS secondary development and Python scripts to automatically process ecological red line demarcation data, the problems of low efficiency and high error rate caused by traditional reliance on manpower were solved, and the efficient and accurate generation of ecological red line demarcation boundary maps was achieved.
Patent Information
- Application Number
- CN202510973044.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-09-12
AI Technical Summary
The production of traditional ecological red line demarcation and calibration results relies on manpower, which is slow, has a high error rate and is difficult to trace back, making it impossible to achieve automation and efficient production.
An automatic generation method for ecological red line boundary survey maps based on ArcGIS secondary development is proposed. By obtaining ecological red line boundary survey data, normalizing it and assigning spatial attributes, a Python script is used to automatically generate boundary result maps in batches, including filling in the attributes of vector data and outputting the maps to tables.
It has realized the batch generation of ecological red line boundary survey results maps, improved generation efficiency, reduced labor costs, provided standardized mapping templates and operation processes, and ensured the accuracy and consistency of the data.
Smart Images

Figure CN120632009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geographic surveying, mapping, analysis and processing technology, and in particular to a method and system for automatically generating ecological red line boundary survey maps based on ArcGIS secondary development. Background Art
[0002] Ecological red lines are the bottom line for ensuring and maintaining national ecological security. During the delineation process, issues such as unclear boundaries and overlapping boundaries arise due to factors such as differing base maps. This requires assessment and adjustment, a process known as ecological red line demarcation and calibration. Data stored in this process includes cartographic output, vector data, tables, text, and multimedia output, with cartographic, table, and multimedia output being particularly voluminous. Traditional methods of generating these outputs rely on manual labor, are slow, prone to errors, and difficult to retrieval.
[0003] In summary, it is necessary to design an automated method for generating ecological red line demarcation and calibration results documents to make up for the above-mentioned defects. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method for automatically generating ecological red line boundary survey maps based on ArcGIS secondary development, which uses a universal template to set mapping constants and variables to automatically generate boundary result maps in batches.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] The method for automatically generating ecological red line boundary survey maps based on ArcGIS secondary development provided by the present invention comprises the following steps:
[0007] S1: Obtain ecological red line demarcation data and extract data from the ecological red line demarcation results;
[0008] S2: Standardize the ecological red line demarcation data;
[0009] S3: Obtain spatial attribute values in the ecological red line boundary survey data from existing geographic data; obtain boundary survey maps based on the spatial attribute values and output the boundary survey maps to the corresponding tables and volumes;
[0010] S4: Classify and archive various tables and books to obtain chart data.
[0011] Furthermore, step S3 is specifically performed in the following manner:
[0012] S31: Obtain the attributes of the ecological red line demarcation data and fill them into the vector data attribute table;
[0013] S32: Output the drawing to the specified folder, and fill the drawing into the corresponding table according to the drawing parameter list.
[0014] Furthermore, the attributes of the data in step S31 include the identification code element code, the number of the boundary stake point, and the number of the boundary map section number.
[0015] Furthermore, step S32 is performed in the following manner:
[0016] Set up data-driven pages in GIS, run scripts, output maps to designated folders, and fill in map parameter lists into tables according to preset table templates.
[0017] Furthermore, the following step S33 is further included, which is specifically performed in the following manner:
[0018] Export the vector data to Excel, then use the email function of WPS to open the data source, then insert the merge field, and fill in the vector data one by one into the corresponding table.
[0019] Furthermore, the ecological red line demarcation data include at least any one of the following data: the national approved results data of the "Three Zones and Three Lines"; the third national land survey and 2022 land change survey data; the national geographic conditions census and natural resources monitoring data; the administrative division 2022 land space planning data and mineral resource planning data, the third national land survey high-definition images, and the land change survey images.
[0020] Furthermore, the normalization processing includes at least the following steps: the vector geographic data such as the national approved results data of the "Three Regions and Three Lines", the third national land survey and the 2022 land change survey data, the national geographic conditions census and natural resources monitoring data, the administrative division 2022 land space planning data and the mineral resources planning data are projected to ensure that their Gauss-Krüger projection coordinate system is the 2000 national geodetic coordinate system under the central meridian of the 3° graduation zone corresponding to the region; or
[0021] The three-level high-definition images and land change survey images are projected into the same projection coordinate system through projection operations.
[0022] Furthermore, step S2 also includes pre-processing the data collected during the field survey and calibration of the ecological protection red line; the data collected during the field calibration includes the coordinates of the supplementary measurement points, important inflection points, boundary stakes, and sign points; the pre-processing process is specifically as follows:
[0023] Obtain the position data of each point through real-time dynamic measurement of the global navigation satellite system;
[0024] The measured point data is stored in a table. Each point is measured multiple times. When the difference between the measured values does not exceed the limit, the average value of the multiple measurements of the north coordinate, east coordinate and elevation is taken as the point coordinate;
[0025] At the same time, the measurement start time of the last measurement is retained;
[0026] The point numbers during measurement are temporary numbers, and each point needs to be assigned a unique process number during preprocessing;
[0027] During the measurement, the measurement process will be photographed on site to keep as evidence, and several photos taken on site will be stored in a table;
[0028] The photos are used to reflect the surrounding environment of the measurement point and the measurement process, and are set according to the corresponding original point number and process number.
[0029] Furthermore, in step S31, the attributes of the ecological red line demarcation data are filled into the vector data attribute table. The specific process is as follows:
[0030] Use the field calculator to directly assign uniform values to the feature codes in the attributes;
[0031] Obtain the ecological red line map number;
[0032] The spatial connection method is adopted to connect the ecological red line map with the attributes of each point element through the nearest neighbor spatial relationship;
[0033] The verification time shall be based on the end time of the last measurement, and the time format shall be unified;
[0034] During the identification process, each geographical element is assigned a unique identification code;
[0035] Set the tile number and map sheet number.
[0036] The present invention provides an automatic generation system for ecological red line boundary survey maps based on ArcGIS secondary development, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor implements the above method when executing the program.
[0037] The beneficial effects of the present invention are:
[0038] The method and system for automatically generating ecological redline boundary survey maps, based on ArcGIS secondary development, first obtain ecological redline boundary survey data and extract data from the survey results. The data is then normalized. Spatial attribute values are assigned to the data from existing geographic data. Based on the spatial attribute values, a bird's-eye view of the boundary survey is generated and automatically generated and stored in a corresponding table. Finally, the table is generated using the linked chart data. This method provides a method for batch generating boundary survey maps for township boundary surveys, proposing a complete technical process involving data organization, map template design, and batch production. Compared with the existing technology, the present invention designs a universal template for township boundary survey result maps, innovatively proposes mapping constants and variables, and realizes the batch generation of boundary survey result maps by replacing the mapping variable values in the mapping template boundary by boundary. It provides standardized mapping templates and operation processes for the production of township boundary survey result maps (including village-level management line result maps, township-level boundary agreement drawings, and county-level and above boundary refinement result maps), greatly improves the generation efficiency of boundary result maps, and reduces the labor cost in township boundary survey work.
[0039] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to make the purpose, technical solutions and beneficial effects of the present invention more clear, the present invention provides the following drawings for illustration.
[0041] Figure 1 This is a flow chart of the method for automatically generating ecological red line boundary maps based on ArcGIS secondary development.
[0042] Figure 2 It is the original RTK measurement data.
[0043] Figure 3 The measured data is sorted.
[0044] Figure 4 Python code to automatically number identification codes.
[0045] Figure 5 Python code for automatically numbering the frame numbers.
[0046] Figure 6 It is an image map for outputting the field verification table.
[0047] Figure 7Output the image of the registration form.
[0048] Figure 8 Figure 1 shows the output boundary.
[0049] Figure 9 To correspond the drawings to tables. DETAILED DESCRIPTION
[0050] The present invention will be further described below with reference to the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention.
[0051] Example 1
[0052] like Figure 1 As shown, the method for automatically generating ecological red line boundary survey maps based on ArcGIS secondary development provided in this embodiment includes the following steps:
[0053] S1: Obtain ecological red line demarcation data and extract data from the ecological red line demarcation results;
[0054] S2: Standardize the ecological red line demarcation data;
[0055] S3: Obtaining spatial attribute values from the ecological red line boundary survey data from the existing geographic data; obtaining a boundary survey map based on the spatial attribute values and outputting the boundary survey map to a corresponding table; the boundary survey map in this embodiment is a bird's-eye view of the boundary survey obtained based on the spatial attribute values;
[0056] S4: Generate table results by linking chart data.
[0057] The following describes in detail the specific process of the method for automatically generating ecological red line boundary maps based on ArcGIS secondary development:
[0058] S1: Obtain the data to be sorted, which includes the following parts:
[0059] According to work needs, we collected data on the nationally approved results of the "Three Regions and Three Lines", the third national land survey and the 2022 land change survey data, the national geographic survey and natural resource monitoring data, the 2022 land space planning data for administrative divisions, mineral resource planning data, high-definition images of the third national land survey, and land change survey images. Due to the different sources and production units of these data, it is necessary to unify the coordinate system and elevation system of these data:
[0060] For vector geographic data, including data from the nationally approved "Three Regions and Three Lines" initiative, the Third National Land Survey and the 2022 Land Change Survey, data from the National Geographic Survey and Natural Resources Monitoring, data from the 2022 National Land Space Planning for Administrative Divisions, and data from mineral resource planning, projection and other operations will be performed to ensure that their Gauss-Krüger projection coordinate system is the 2000 National Geodetic Coordinate System, corresponding to the central meridian of the 3° zone of the region. For Yubei District in Chongqing, for example, all relevant data must be unified to the Gauss-Krüger 3° Zonal Projection Coordinate System (CGCS20003Degree GK CM 108 Coordinate System), with the central meridian at 108° East. The elevation system is uniformly set to the 1985 National Elevation Datum.
[0061] Remote sensing image data such as the third national land survey high-definition images and land change survey images are unified into the same projection coordinate system as the above-mentioned vector data through operations such as projection;
[0062] S2: Standardize the ecological red line demarcation data, and then pre-process the data collected during the field work of ecological protection red line demarcation and marking (including the coordinates of supplementary survey points, important inflection points, boundary stakes, signposts, etc.);
[0063] The measurements of the above points are all carried out by real-time kinematic measurement (RTK) supported by the Global Navigation Satellite System (GNSS). The measured point results are in a table in CSV format, where each point is measured 5 times. When the mutual difference of the measured values does not exceed the limit, the average value of multiple measurements of the north coordinate, east coordinate and elevation is taken as the point coordinate. At the same time, the measurement start time of the last measurement is retained. The point number during measurement is a temporary number, and each point must be assigned a non-repeating process number in the preprocessing. The number starts with the capital letter of the point type, is numbered sequentially, and is 4 digits long. Taking important inflection points as an example, the point number starts from ZYGD-0001 and ends at ZYGD-9999. Figure 2 is the original RTK measurement data, Figure 3 The measured data is sorted.
[0064] During the measurement process, on-site photos will be taken to document the measurement process. These photos should also be included in the multimedia record of the results. Typically, multiple photos will be taken of the same point, reflecting the surrounding environment and the measurement process. Following the correspondence between the original point name and the process number, the photo that most fully reflects the entire measurement scene will be numbered first, with the remaining photos numbered with two digits. For example, if there are four on-site photos of point ZYGD-0001, they will be numbered ZYGD-0001-01, ZYGD-0001-02, ZYGD-0001-03, and ZYGD-0001-04. Photo ZYGD-0001-01 will be added to the results as visual evidence.
[0065] In ArcGIS, vector data of points is created by importing xy data. This data is then merged with empty data containing standard fields to form basic geographic data for filling in.
[0066] S3: Obtain spatial attribute values from the ecological red line boundary survey data from the existing geographic data; obtain a bird's-eye view of the boundary survey based on the spatial attribute values and automatically generate and save the map in the corresponding table;
[0067] S31: Automatically fill in the vector data attribute table according to the attributes of the pre-processed data;
[0068] According to the provisions of the Chongqing Ecological Protection Red Line Demarcation and Marking Plan and Technical Guidelines on feature data structure, the Python script code in the field calculator is used to automatically and batch fill in the content in the vector data attribute table;
[0069] The Python script code in this embodiment is as follows: Batch fill (taking important inflection points as an example, fill in the province field)
[0070]
[0071] The feature code, province, city, district (county), etc. are directly and uniformly assigned using the field calculator. The nature reserve name, nature reserve level, nature reserve type, nature reserve zone, and redline map number are derived from the ecological redline map.
[0072] The map spots in this embodiment are data, that is, an ecological red line is a red line map spot; the map file is the submitted result, which is a word document containing reported data and images.
[0073] Using spatial linkage, the ecological redline patches are connected to the attributes of each point feature using the nearest neighbor spatial relationship. The location and nearby land types are connected to the point features using the third land survey patches. Townships (streets) are connected to the point features using the administrative district patches in the same way.
[0074] The verification time is based on the end time of the last measurement in the RTK measurement results. The format is unified into xxxx year xx month xx day xx hour xx minute through Python code.
[0075] The main places where Python code is used include filling in the identification code element code, numbering the boundary stake points, numbering the boundary attachment section numbers, etc.
[0076] The Python script code in this embodiment is as follows: Number code (taking important inflection points as an example, fill in the identification code)
[0077]
[0078] Verification time unified code
[0079]
[0080] like Figure 4 As shown, Figure 4 Python code that automatically numbers identification codes; such as Figure 5 As shown, Figure 5 This is the Python code for automatically numbering the frame numbers; the Python script code in this embodiment is as follows:
[0081] def fbh(lat,lon):
[0082] car="ABCDEFGHIJKLMNOPQRSTUV"
[0083] num=int(math.floor(int(lat) / 4)+1)
[0084] oid_lat = car[num-1]
[0085] oid_lon=int(math.floor(int(lon) / 6)+31)
[0086] tfbh=oid_lat+str(oid_lon)
[0087] return tfbh
[0088] The identification code is a unique identifier for each geographic element in the identification process. Set a global variable with a step parameter of 1 to obtain the final number of each point feature. Then convert the final number into a four-digit text, and fill it with zeros on the left if it is less than four digits. Finally, combine the location code and the final number. Taking Yubei District as an example, the location code is 50011200000000, and the final code starts at 1754 and ends at 2577. Therefore, the identification code starts at 500112000000001754 and ends at 500112000000002577.
[0089] The map sheet number is guided by the project technical design and adopts longitude and latitude division. The map sheet number is divided into two parts. The longitude number is before the hyphen. The difference between the left and right adjacent maps is 0.200, and the difference between the upper and lower adjacent maps is 1.000. At the same time, in order to facilitate the drawing of boundary figures, it is necessary to obtain the map sheet numbers of the eight adjacent maps at the same time. The map sheet number is text type and is connected by hyphens. First, sort the data, and then convert the sorted results into digital type. For the eight adjacent maps, assign values according to the map sheet difference based on the spatial relationship relative to the current map sheet (upper left, upper, upper right, left, right, lower left, lower, lower right). After the assignment is completed, convert the result into text type again and then connect it with hyphens.
[0090] S32: Obtain various table templates in the technical guide, set up the data-driven page in GIS, open the Python interface, enter the following code, and run the script;
[0091] The Python script code in this embodiment is as follows:
[0092] The satellite imagery screenshots entered into the form must meet certain display requirements, including length and width. After setting the display parameters for point symbols, point labels, and edge color and width for data such as location and ecological redline in ArcGIS, open the Python editor, enable the data-driven option, use the point name as the driver, and use the .mxd file as the loop element. Start the code and batch output the screenshots.
[0093] The Python script codes in this embodiment are all written using existing code rules, as follows:
[0094]
[0095] Click Enter on the keyboard to automatically output the drawing to the specified folder. Through the study of various table templates in the technical guide, the following drawing parameter list is summarized.
[0096] Imagery output is in JGP format. Two types of forms require imagery output: the attached image for the field verification survey form must be 800 pixels wide by 600 pixels high, with a resolution of 500 dpi; the attached image for the boundary stake registration form must be 800 pixels wide by 800 pixels high, with a resolution of 300 dpi.
[0097] In order to be able to better fill in the table; such as Figure 6 As shown, Figure 6 To output the image map of the field verification table; Figure 7 To output an image of the registration form; Figure 8 Figure 1 is the output boundary diagram;
[0098] Taking the ecological protection red line field verification record form as an example, the content that needs to be filled in comes from the attribute data of the point element, including the map number, point number, verification time, location, nearby land type, on-site photo number, whether fine-tuning is needed, coordinates (longitude, latitude, elevation), remarks (satellite image, on-site photo), person filling out the form, (filling) date, reviewer, (review) date.
[0099] S33: Export the vector data that has been quality-checked internally to Excel, then use the email function of WPS to open the data source, and then insert the merge field, so that the vector data can be filled in the corresponding tables one by one. To insert the drawings, use the macro editor function in WPS, fill in the pre-edited code, click Run, and the drawings can be inserted into the corresponding tables one by one.
[0100] Convert geographic data into tabular data. Considering the one-to-one relationship between table fields and template fields, use macro code to map the two. After setting the file paths for the table and the Word template, replace the template content using the point number as a loop element. Finally, output the completed Word file with the point number as the title.
[0101] S4: Split and export various tables and volumes, then use AdvancedRenamer software to rename various table and volume data and multimedia data in accordance with the provisions of the Chongqing Ecological Protection Red Line Demarcation and Demarcation Plan and Technical Guidelines, and finally classify and archive them; Figure 9 To correspond the drawings to tables.
[0102] Taking key inflection points as an example, all results include vector geographic data (ZYGD) of these key inflection points in GDB format, a field verification registration form for each point, corresponding field work photos, and boundary maps for the entire project area. Archives are organized into folders based on geographic data, map data, and multimedia data. GDB data is stored in the geographic data folder, field verification registration forms and boundary maps in the map data folder, and on-site photos in the multimedia data folder.
[0103] The above embodiments are merely preferred embodiments for the purpose of fully illustrating the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are within the scope of protection of the present invention. The scope of protection of the present invention shall be subject to the claims.
Claims
1. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development is characterized by: The following steps are involved: S1: Obtain ecological red line demarcation data and extract data from the ecological red line demarcation results; S2: Standardize the ecological red line demarcation data; S3: Obtain spatial attribute values in the ecological red line boundary survey data from existing geographic data; obtain boundary survey maps based on the spatial attribute values and output the boundary survey maps to the corresponding tables and volumes; S4: Classify and archive various tables and books to obtain chart data.
2. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development as claimed in claim 1, characterized in that: The step S3 is specifically performed in the following manner: S31: Obtain the attributes of the ecological red line demarcation data and fill them into the vector data attribute table; S32: Output the drawing to the specified folder, and fill the drawing into the corresponding table according to the drawing parameter list.
3. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development as claimed in claim 2, characterized in that: The attributes of the data in step S31 include the identification code element code, the number of the boundary stake point, and the number of the boundary map section number.
4. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development as claimed in claim 2, characterized in that: The step S32 is performed as follows: Set up data-driven pages in GIS, run scripts, output maps to designated folders, and fill in map parameter lists into tables according to preset table templates.
5. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development as claimed in claim 2, characterized in that: The following step S33 is further included, which is specifically performed in the following manner: Export the vector data to Excel, then use the email function of WPS to open the data source, then insert the merge field, and fill in the vector data one by one into the corresponding table.
6. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development according to claim 1 is characterized in that: The ecological red line demarcation data shall include at least any one of the following data: the national approved results data of the "Three Zones and Three Lines"; the third national land survey and the 2022 land change survey data; the national geographic survey and natural resources monitoring data; the administrative division 2022 land space planning data and mineral resource planning data, the third national land survey high-definition images, and the land change survey images.
7. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development according to claim 6 is characterized in that: The standardization processing at least includes the following steps: vector geographic data such as the national approved results data of the "Three Regions and Three Lines", the third national land survey and the 2022 land change survey data, the national geographic conditions census and natural resources monitoring data, the 2022 land space planning data of administrative divisions, and the mineral resources planning data are projected to ensure that their Gauss-Krüger projection coordinate system is the 2000 national geodetic coordinate system under the central meridian of the 3° graduation zone corresponding to the region; or The three-level high-definition images and land change survey images are projected into the same projection coordinate system through projection operations.
8. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development according to claim 1 is characterized in that: The step S2 also includes pre-processing the data collected during the field survey and calibration of the ecological protection red line; the data collected during the field calibration include the coordinates of the supplementary measurement points, important inflection points, boundary stakes, and sign points; the pre-processing process is as follows: Obtain the position data of each point through real-time dynamic measurement of the global navigation satellite system; The measured point data is stored in a table. Each point is measured multiple times. When the difference between the measured values does not exceed the limit, the average value of the multiple measurements of the north coordinate, east coordinate and elevation is taken as the point coordinate; At the same time, the measurement start time of the last measurement is retained; The point numbers during measurement are temporary numbers, and each point needs to be assigned a unique process number during preprocessing; During the measurement, the measurement process will be photographed on site to keep as evidence, and several photos taken on site will be stored in a table; The photos are used to reflect the surrounding environment of the measurement point and the measurement process, and are set according to the corresponding original point number and process number.
9. The method for automatically generating ecological red line boundary maps based on ArcGIS secondary development as described in claim 2 is characterized by: In step S31, the attributes of the ecological red line demarcation data are filled into the vector data attribute table. The specific process is as follows: Use the field calculator to directly assign uniform values to the feature codes in the attributes; Obtain the ecological red line map number; The spatial connection method is adopted to connect the ecological red line map with the attributes of each point element through the nearest neighbor spatial relationship; The verification time shall be based on the end time of the last measurement, and the time format shall be unified; During the identification process, each geographical element is assigned a unique identification code; Set the tile number and map sheet number.
10. An automatic generation system for ecological red line boundary survey maps developed based on ArcGIS, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.