Method, device and electronic equipment for drawing regional new structural zoning map
Through the automation method, we respond to the area range information input by the user, crop and number layers to generate the target workspace, solving the problem of time-consuming and costly drawing the new area structure partition map manually, and improving the drawing efficiency and automation level.
Patent Information
- Application Number
- CN202210525816.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-05-12
AI Technical Summary
In the prior art, manually operating Gis software to draw a new area structure partition map takes a long time, has high labor costs, and low drawing efficiency.
By responding to the area range information entered by the user, the area range of the newly constructed partition map of the area to be drawn is determined, the layer is cropped based on the range, field numbers are performed, and the target workspace is generated to automatically complete the drawing of the newly constructed partition map of the area.
The labor cost of drawing new structural partition maps in the area is reduced, the drawing efficiency is improved, and the automated drawing process is realized.
Smart Images

Figure CN114842110B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of earthquake safety assessment of engineering sites, and in particular to a method, device and electronic equipment for drawing a regional new structural zoning map. Background Art
[0002] Neotectonic movement refers to the crustal movement that has occurred since the Neogene (Miocene). The preparation of regional neotectonic zoning maps is an indispensable and important task in the seismic safety assessment of engineering sites. At present, the preparation of neotectonic zoning maps usually involves manually drawing the regional scope in GIS software, using the clipping tool of GIS software to clip elements one by one or in batches, manually numbering the clipped neotectonic zones and basins, and manually finishing them to form a map. However, this method is time-consuming when the workload is large, resulting in high labor costs and low drawing efficiency. Summary of the invention
[0003] The purpose of the present application is to provide a method, device and electronic equipment for drawing a regional new structural zoning map, so as to alleviate the technical problems of high labor cost and low drawing efficiency in the current use of manual operation of Gis software to draw regional new structural zoning maps.
[0004] In a first aspect, the present invention provides a method for drawing a regional new structural zoning map, comprising: determining the regional scope of the regional new structural zoning map to be drawn in response to regional scope information input by a user; performing a clipping operation on a layer corresponding to the regional new structural zoning map to be drawn based on the regional scope to obtain a target layer file; performing field numbering on a target layer in the target layer file to obtain numbering data; and generating a target workspace based on the original workspace, the regional scope, the target layer file and the numbering data to complete the drawing of the regional new structural zoning map.
[0005] In an optional embodiment, in response to the area range information input by the user, the area range of the newly constructed partition map of the area to be drawn is created, including: creating a shape file; in response to the area range longitude and latitude start and end coordinate information input by the user, creating the area range of the newly constructed partition map of the area to be drawn in the shape file.
[0006] In an optional implementation, a layer corresponding to the newly constructed zoning map of the area to be drawn is clipped based on the area range to obtain a target layer file, including: traversing all layers corresponding to the newly constructed zoning map of the area to be drawn; calling a layer clipping function during the traversal process, and clipping the layer according to the area range through the layer clipping function to obtain a target layer file.
[0007] In an optional implementation, the target layer in the target layer file is field numbered to obtain numbering data, including: creating a first field numbering function for the basin surface layer in the target layer file, and a second field numbering function for the third-level newly constructed partition surface layer in the target layer file; based on the first field numbering function, numbering the field labeled basin number in the basin surface layer in the target layer file to obtain first numbering data; based on the second field numbering function, numbering the field labeled partition surface number in the third-level newly constructed partition surface layer in the target layer file to obtain second numbering data; and obtaining numbering data based on the first numbering data and the second numbering data.
[0008] In an optional implementation, before determining the area range of the newly constructed partition map of the area to be drawn, the method further includes: determining a file storage location in response to file path information input by a user, where the file storage location is used to store files created and generated during the drawing process.
[0009] In an optional implementation, a target workspace is generated based on the original workspace, the area range, the target layer file and the numbering data, including: storing the area range, the target layer file and the numbering data to a file storage location; copying the original workspace to the file storage location; and synthesizing the area range, the target layer file and the numbering data with the original workspace to generate the target workspace.
[0010] In an optional embodiment, after the target workspace is generated, it also includes: in response to an opening operation on the target workspace, displaying a drawing interface in layout mode; in response to a legend insertion operation initiated by the user, and / or, in response to a layout adjustment operation initiated by the user, generating a new structural partition map of the drawn area.
[0011] In a second aspect, the present invention provides a device for drawing a regional new structural zoning map, comprising: an area range determination module, which is used to determine the area range of the regional new structural zoning map to be drawn in response to the area range information input by the user; a layer clipping module, which is used to perform a clipping operation on the layer corresponding to the regional new structural zoning map to be drawn based on the area range, and obtain a target layer file; a field numbering module, which is used to perform field numbering on the target layer in the target layer file to obtain numbering data; and a drawing module, which is used to generate a target workspace based on the original workspace, the area range, the target layer file and the numbering data to complete the drawing of the regional new structural zoning map.
[0012] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement a method for drawing a new structural zoning map of a region according to any of the aforementioned implementations.
[0013] In a fourth aspect, the present invention provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for drawing a new structural zoning map of a region according to any one of the aforementioned implementations.
[0014] The present application provides a method, device and electronic device for drawing a new structural zoning map of a region. The method determines the regional range of the new structural zoning map of the region to be drawn in response to the regional range information input by the user, performs a clipping operation on the layer corresponding to the new structural zoning map of the region to be drawn based on the regional range, obtains a target layer file, performs field numbering on the target layer in the target layer file, obtains numbering data, and then generates a target workspace based on the original workspace, the regional range, the target layer file and the numbering data to complete the drawing of the new structural zoning map of the region. The above method only requires the user to input a small amount of information during the operation, and the regional range information can be automatically determined, and the target layer file and numbering data can be determined based on the regional range information, so that the target workspace corresponding to the user input can be generated in combination with the original workspace to complete the drawing of the new structural zoning map of the region, thereby reducing the labor cost of drawing the new structural zoning map of the region and improving the drawing efficiency of the new structural zoning map of the region. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 A flowchart of a method for drawing a new regional structural zoning map provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of basin numbering provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of layer numbering of a three-level new structural partition surface provided in an embodiment of the present application;
[0019] Figure 4 A new structural zoning map of a region provided in an embodiment of the present application;
[0020] Figure 5 A flowchart of a specific method for drawing a regional new structural zoning map provided in an embodiment of the present application;
[0021] Figure 6A structural diagram of a device for drawing a new regional structural zoning map provided in an embodiment of the present application;
[0022] Figure 7 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0024] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0025] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0026] Neotectonic movement refers to the crustal movement that has occurred since the Neogene (Miocene), and the corresponding era is called the neotectonic period (Cao Boxun, 1995). In the earthquake safety assessment of engineering sites (GB17741-2005), the "regional scope" refers to the scope that affects the earthquake safety assessment of engineering sites, which should not be less than 150km outside the engineering site.
[0027] The regional neotectonic zoning map includes the distribution of Cenozoic strata, volcanoes and igneous rocks, basins and uplifts active since the Late Tertiary, as well as earthquake activity and current deformation characteristics, and marks 4 3 / Earthquakes of magnitude 4 or above. The regional neotectonic zoning map is an important result obtained by focusing on the analysis of the types, activity characteristics, activity amplitudes of neotectonic movements and their relationship with seismic activity. Therefore, the compilation of the regional neotectonic zoning map is an indispensable and important task in the seismic safety assessment of engineering sites.
[0028] At present, the process of compiling regional neotectonic zoning maps is to manually draw the regional scope in GIS software, use the clipping tool of GIS software to clip elements one by one or in batches, manually number the clipped neotectonic zones and basins, and then draw the map after manual finishing. This method is time-consuming, labor-intensive, labor-intensive, and has low drawing efficiency.
[0029] Based on this, the embodiments of the present application provide a method, device and electronic device for drawing a new structural zoning map of a region. The user only needs to input file path information and area range information during the operation to automatically complete the drawing of the new structural zoning map of the region, thereby reducing the labor cost of drawing the new structural zoning map of the region and improving the efficiency of drawing the new structural zoning map of the region.
[0030] The present application embodiment provides a method for drawing a new structural zoning map of a region, see Figure 1 As shown, the method comprises the following steps:
[0031] Step S110 , in response to the area range information input by the user, determining the area range of the new constructed partition map of the area to be drawn.
[0032] The above-mentioned area range information can be determined by the starting and ending coordinate information of the longitude and latitude of the area range, and the starting and ending coordinate information of the longitude and latitude of the area range can include the coordinate information of the lower left vertex, lower right vertex, upper left vertex, and upper right vertex of the longitude and latitude of the area range. For example, the starting and ending longitude and latitude of the area range are 114.13°-E118.51° east longitude and 33.30°-36.88° north latitude, then the lower left vertex, lower right vertex, upper left vertex, and upper right vertex of the area range are represented by the coordinates (114.13, 33.30)(118.51, 33.30)(114.13, 36.88)(118.51, 36.88) respectively, and a rectangular surface of 114.13°-E118.51° east longitude and 33.30°-36.88° north latitude is generated by the coordinate information of the vertex to determine the area range information.
[0033] Step S120 , based on the area range, a layer corresponding to the newly constructed zoning map of the area to be drawn is clipped to obtain a target layer file.
[0034] The layers corresponding to the regional neotectonic zoning map may include at least: strata, rivers, oceans, county-level administrative districts, secondary neotectonic zoning surfaces, tertiary neotectonic zoning surfaces, neotectonic zoning lines, Quaternary isopach lines, historical earthquakes (M≥4 3 / 4 level), Quaternary basin surface, Quaternary basin boundary line, tectonic stress direction, etc.
[0035] When clipping is performed, the layer is clipped based on the above-determined area range to obtain a layer corresponding to the newly constructed partition map of the area matching the area range.
[0036] Step S130, numbering the fields of the target layer in the target layer file to obtain numbering data.
[0037] In one embodiment, the target layer may include a basin surface layer and a third-level new structural partition surface layer. The fields marked with numbers corresponding to the basin surface layer and the third-level new structural partition surface layer are numbered respectively, and the numbering data corresponding to the basin surface layer and the third-level new structural partition surface layer can be obtained.
[0038] Step S140, generating a target workspace based on the original workspace, the area range, the target layer file and the numbering data to complete the drawing of the new structural zoning map of the area.
[0039] The original workspace is an original workspace file that only performs symbol settings. By matching the area range, target layer file and numbering data with the original workspace, a target workspace corresponding to the area range information input by the user can be obtained. The target workspace is a workspace for editing and displaying the newly constructed zoning map of the area. For example, the target workspace can be a workspace of the Gis software.
[0040] The method for drawing a regional new structural zoning map provided in the present application only requires the user to input a small amount of information during the operation, and the regional range information can be automatically determined, and the target layer file and numbering data can be determined based on the regional range information, so that a target workspace corresponding to the user input can be generated in combination with the original workspace to complete the drawing of the regional new structural zoning map, thereby reducing the labor cost of drawing the regional new structural zoning map and improving the efficiency of drawing the regional new structural zoning map.
[0041] The functions of this embodiment can be implemented using Python language, and the specific implementation method of the embodiment of the present application is described in detail below.
[0042] First, before determining the area range of the newly constructed partition map of the area to be drawn, a file storage location is determined in response to file path information input by the user, and the file storage location is used to store files created and generated during the drawing process.
[0043] In the specific implementation, you can use Python to write a script to create a folder and specify the storage path and file name of the folder, which may include:
[0044] Import the os library;
[0045] Create a function named creat_folder(path,name), which is used to create a folder according to the given path and name. The function creat_folder() includes two parameters, path and name. The parameter path is the path where the new folder is located, and the parameter name is the name of the new folder;
[0046] In the custom function creat_folder(path,name), use the function os.path.join() to concatenate the value of path and the value of name into a new path and assign it to the variable project_far. Then, use the function os.mkdir() to create a folder with the value of the variable project_far.
[0047] Run the creat_folder() function to create a folder with the specified path and name.
[0048] Take the creation of a folder named "jining" under the path "E:\FarFieldRegion" as an example: first assign "E:\Far field region" to the parameter path, assign "jining" to the parameter name, and run creat_folder(path,name); run the function creat_folder(path,name): os.path.join() combines the value of path and the value of name into a new path, and assigns it to the variable project_far, that is, project_far = "E:\Far fieldregion\jining"; the function os.mkdir() creates the value of the variable project_far as the "jining" folder under the path "E:\Far fieldregion" to create a folder named "jining" under the path "E:\Far field region".
[0049] Further, after creating a file for storing the files created and generated during the drawing process, when the user inputs the file path information and the area range information, the area range of the new construction partition map of the area to be drawn can be created at the storage location of the file path information knowledge. First, a shape file is created, and then in response to the latitude and longitude start and end coordinate information of the area range input by the user, the area range of the new construction partition map of the area to be drawn is created in the shape file.
[0050] In the specific implementation, you can first import the os library and arcpy library. Then create a function named creat_far_region(pathf,coordList), which creates a shape file named "FarRegion.shp" according to the given path and area range, and creates regional surface features in the shape file. The function creat_far_region(pathf,coordList) includes two parameters pathf and coordList. The parameter pathf is the above file path information, and the parameter coordList is the latitude and longitude start and end coordinate information of the area range.
[0051] Inside the creat_far_region(pathf,coordList) function: use the function os.path.join() to create new variables outfile and outfile2 to store the complete path of the new shape file. During the creation of variables outfile and outfile2, the file names of the shape files are specified as FarRegion.shp and FarRegion_process.shp respectively.
[0052] Use the function arcpy.SpatialReference(4326) to create a new variable outSR, where 4326 represents the GCS_WGS_1984 coordinate system;
[0053] Use the arcpy.Point() function to create new variables lowerLeft, lowerRight, upperLeft, and upperRight, which are the lower left, lower right, upper left, and upper right vertices of the area range respectively;
[0054] Use the function arcpy.Array() to create a new variable array to store the vertices of the area range;
[0055] Use the .append() method to add the five points at the bottom left, top left, top right, bottom right, and bottom left (5 points clockwise, point 1 to point 5) to the variable array in sequence;
[0056] Use the arcpy.Polygon() function to create the variable array as a surface feature and assign it to the newly created variable polygon;
[0057] Use arcpy.CopyFeatures_management(polygon,outfile) to create polygon to the path represented by outfile2;
[0058] Use arcpy.DefineProjection_management(outfile2,outSR) to specify the coordinate system of outfile2 as GCS_WGS_1984.
[0059] Use arcpy.FeatureToPolygon_management(outfile2,outfile) to create a shapefile of the path represented by outfile.
[0060] Run the creat_far_region(path,name) function to complete the creation of the region range shape file FarRegion.shp and the creation of the region range surface features.
[0061] Furthermore, when performing a cropping operation on the layer corresponding to the newly constructed zoning map of the area to be drawn, firstly, all the layers corresponding to the newly constructed zoning map of the area to be drawn are traversed, and then the layer cropping function is called during the traversal process. The layer cropping function is used to crop the layer according to the area range to obtain the target layer file, and the cropped target layer file is stored in the file storage location originally created.
[0062] During the specific implementation, the os library and arcpy library are imported.
[0063] Create a function named clip_far(), which clips all layer files in a specific workspace file (.mxd) according to the specified range, which is the above-mentioned layer clipping function. The function clip_far() includes a parameter pathf. The parameter pathf is the path of the file storage location initially created. Inside the clip_far() function:
[0064] Define the script's working directory to be the folder indicated by the initially established file storage location;
[0065] Use the arcpy.mapping.MapDocument() function to assign the workspace file (.mxd) to the newly created variable mxd;
[0066] Use arcpy.maping.ListLayers() to create a layer list and assign it to the newly created variable layers;
[0067] Iterate over each layer in layers. During the traversal process, concatenate the layer name with ".shp" and assign it to the newly created variable outname; use the os.path.join() function to determine the clipped file path; use arcpy.Clip_analysis() to clip each layer.
[0068] Run the clip_far() function to clip all layers and store the clipped files to the file storage location originally created.
[0069] To make it easier to understand, here is an example:
[0070] All layers in the workspace with the path "E:\Far field region\Fartoclip.mxd" are clipped according to the above determined area range "E:\FarFieldRegion\jining\FarRegion.shp", and the clipped files are saved in the folder "E:\FarFieldRegion\jining", and the clipped file name is made the same as the clipped file name.
[0071] Import the os library and the arcpy library.
[0072] Import arcpy.mapping and simply call it mapping.
[0073] Create a function named clip_far(), which clips all layer files in a specific workspace file (.mxd) according to the specified range. Parameter pathf = "E:\FarFieldRegion\jining". Inside the clip_far() function:
[0074] Specify the script's working directory as "E:\FarFieldRegion\jining", that is, arcpy.env.workspace = "E:\FarFieldRegion\jining";
[0075] Use arcpy.mapping.MapDocument() function to assign "E:\Far field region\Fartoclip.mxd" to the variable mxd;
[0076] Use arcpy.maping.ListLayers() to create a list of all the images contained in "E:\Far field region\Fartoclip.mxd" and assign it to the variable layers;
[0077] Use a for loop to traverse each layer in layers. During the traversal process, the variable outName is the file name of the clipped layer; outfiles is the full path of the clipped layer file; arcpy.Clip_analysis() is used to clip each layer layer according to os.path.join(pathf,"FarRegion.shp") (i.e. "E:\FarFieldRegion\jining\FarRegion.shp") and save it to "E:\FarFieldRegion\jining". The clipped file name is the same as the clipped file name.
[0078] Run the clip_far() function to clip all layers.
[0079] Further, the fields of the target layer in the target layer file are numbered. First, a first field numbering function is created for the basin surface layer in the target layer file, and a second field numbering function is created for the three-level newly constructed partition surface layer in the target layer file. Then, based on the first field numbering function, the fields marked with basin numbers in the basin surface layer in the target layer file are numbered to obtain first numbering data. Based on the second field numbering function, the fields marked with partition surface numbers in the three-level newly constructed partition surface layer in the target layer file are numbered to obtain second numbering data, thereby obtaining numbering data based on the first numbering data and the second numbering data.
[0080] When numbering the fields labeled with basin numbers in the basin surface layer in the target layer file based on the first field numbering function, Python IDLE can be used to write a script to implement it, which may include:
[0081] Import the os library and arcpy library.
[0082] Create a function named basin_number(), which is used to number the "noumber" field of the "QuaternaryBasin_polygon.shp" file in the specified path. The function basin_number() includes a parameter pathf. The parameter pathf is the path indicated by the initially created file storage location.
[0083] Inside the basin_number() function:
[0084] Define the script's working directory to be the folder indicated by the initially established file storage location;
[0085] Use the with keyword and arcpy.da.UpdateCursor() to get the "noumber" and "name" fields of "QuaternaryBasin_polygon.shp" and define them as cursor;
[0086] Inside the with statement: define a variable i and assign it a value of 1; use the for loop statement to get all the elements of the variable crusor;
[0087] Assign "noumber" the value of "(1)", use the .updateRow() method to update the cursor; increase the variable i by 1; until the for loop is completed, all "noumber" fields are numbered.
[0088] For ease of understanding, an example is provided. In this example, the "nomuber" field in the path "E:\FarFieldRegion\jining\QuaternaryBasin_polygon.shp" is modified to the basin number. The basin number format is "(1), (2), ...", see Figure 2 The following are the specific steps:
[0089] Import the os library and arcpy library.
[0090] Create a function named basin_number(), which is used to number the "noumber" field of the "E:\Far field region\QuaternaryBasin_polygon.shp" file. Inside the basin_number() function:
[0091] Define the script's working directory as the path "E:\FarFieldRegion\jining";
[0092] Use the with keyword and arcpy.da.UpdateCursor() to get the "noumber" and "name" fields of "QuaternaryBasin_polygon.shp" and define them as the variable cursor;
[0093] Inside the with statement: define a variable i and assign it a value of 1; use the for loop statement to get the element list of the variable crusor, assign "noumber" to "(1)", use the .updateRow() method to update the cursor, and increase the variable i by 1; execute the for loop until all "noumber" fields are numbered.
[0094] Furthermore, when the fields of the labeled partition surface numbers in the three-level newly constructed partition surface layer in the target layer file are numbered based on the second field numbering function, a script is written using Python IDLE to sequentially number the labeled number fields in the three-level newly constructed partition surface layer. For a schematic diagram of the numbering of the three-level newly constructed partition surface layer, see Figure 3 As shown, specifically including:
[0095] Import the os library and arcpy library.
[0096] Create a function named Neotect_number(), which is used to number the "superscr" field of the "NeotectonicsLe3Polygon.shp" file in the specified path. The function Neotect_number() includes a parameter pathf. The parameter pathf is the path of the pre-created folder.
[0097] Inside the Neotect_number() function:
[0098] Define the script's working directory as a pre-created folder;
[0099] Use the keyword with and arcpy.da.UpdateCursor() to get the "symbol", "subscript", "superscr", "L1_name", "L2_name", and "name" fields of "NeotectonicsLe3Polygon.shp" and define them as the variable cursor;
[0100] Inside the with statement, use the for loop to number "superscr" according to "symbol" and "subscript"; until the for loop is completed, all "superscr" fields are numbered.
[0101] In one example, the "superscr" field of the path "E:\FarFieldRegion\jining\NeotectonicsLe3Polygon.shp" can be modified to the new structure partition number, and the numbering format is "1, 2, ...", which specifically includes the following steps:
[0102] Import the os library and arcpy library.
[0103] Create a function named Neotect_number(), which is used to number the "superscr" field of "E:\FarFieldRegion\jining\NeotectonicsLe3Polygon.shp".
[0104] Inside the Neotect_number() function:
[0105] Define the script's working directory as the path "E:\FarFieldRegion\jining";
[0106] Use the keyword with and arcpy.da.UpdateCursor() to get the "symbol", "subscript", "superscr", "L1_name", "L2_name", and "name" fields of "NeotectonicsLe3Polygon.shp" and define them as the variable cursor;
[0107] Inside the with statement, the "superscr" is numbered using a for loop according to "symbol" and "subscript". During the numbering process, for each combination of "symbol" and "subscript", "superscr" is numbered sequentially starting from 1. This is done until the for loop is completed, and all "superscr" fields are numbered.
[0108] Furthermore, when generating a target workspace based on the original workspace, the area range, the target layer file and the numbering data, the area range, the target layer file and the numbering data can be stored in a file storage location, copied to the original workspace to the file storage location, and the area range, the target layer file and the numbering data are synthesized with the original workspace to generate the target workspace. The area range, the target layer file and the numbering data can be stored in the file storage location after the file is generated.
[0109] When generating the target workspace, you can use Python's IDLE to write a script to copy the original workspace file with symbol settings to the folder indicated by the file storage location initially created. In actual application, use Python to import the os and shutil modules; create a function named copy_3mxd(), which copies the file in the specified path to the specified path. The copy_3mxd() function includes a parameter name. The parameter name is the name of the newly created folder. Create variables sourcef and targetf inside the creat_folder() function, which are the path and target path of the copied file respectively. Use the "try-except" structure and shutil.copy() function to implement the copy function. If the copy is unsuccessful, prompt.
[0110] In one example, copy "E:\Far field region\FarNtoclip.mxd" to the "E:\Farfield region\jining" folder and name it "jiningFarNtoclip.mxd". Use Python to import the os and shutil modules; create a function named copy_3mxd(), which includes a parameter name. The parameter name is the name of the pre-created folder, that is, "jining". Create variables sourcef = E:\Far field region\FarNtoclip.mxd and targetf = E:\Far field region\jining\FarNtoclip.mxd inside the creat_folder() function. Use the "try-except" structure and shutil.copy() function to implement the copy function. If the copy is unsuccessful, a prompt will be given.
[0111] Furthermore, after the target workspace is generated, the drawing surface can be manually adjusted. In one embodiment, in response to an opening operation for the target workspace, a drawing interface in layout mode can be displayed, and in response to a legend insertion operation initiated by a user, and / or in response to a layout adjustment operation initiated by a user, a new structural partition map of the drawn area can be generated. Figure 4 shown.
[0112] In summary, Figure 5 A flowchart of a specific method for drawing a regional neotectonic zoning map is provided to characterize the overall process of the method, which specifically includes the following steps:
[0113] Step S1, creating a folder for storing files of the newly constructed partition map.
[0114] Step S2, creating a shape file of the region and a region surface element. The created file is stored in the folder created in step S1.
[0115] Step S3, clipping layers. All layers are clipped using the area range face element created in step S2, and the clipped files are stored in the folder created in step S1.
[0116] Step S4, numbering the basins: Sequentially numbering the fields marked with basin numbers in the basin surface layer.
[0117] Step S5, numbering the three-level new structural partitions. Numbering the annotation fields of the three-level new structural partitions in the new structural partition surface layer.
[0118] Step S6, copying the workspace (.MXD): Copy the original workspace file with symbol settings to the folder created in step S1.
[0119] Step S7, drawing finishing: Manually insert the legend into the workspace file copied in step S6 and adjust the layout.
[0120] Through the above method, the user only needs to input file path information and area range information to complete the drawing of the regional new structure zoning map, thereby reducing the labor cost of drawing the regional new structure zoning map and improving the drawing efficiency of the regional new structure zoning map.
[0121] Based on the above method embodiment, the present application embodiment also provides a device for drawing a new regional structural zoning map, see Figure 6 As shown, including:
[0122] The area range determination module 61 is used for determining the area range of the new construction partition map of the area to be drawn in response to the area range information input by the user;
[0123] A layer clipping module 62 is used to perform a clipping operation on the layer corresponding to the new construction partition map of the area to be drawn based on the area range to obtain a target layer file;
[0124] A field numbering module 63 is used to number the fields of the target layer in the target layer file to obtain numbering data;
[0125] The drawing module 64 is used to generate a target workspace based on the original workspace, the area range, the target layer file and the numbering data to complete the drawing of the new structural zoning map of the area.
[0126] In some embodiments, in response to the area range information input by the user, the area range determination module 61 is also used to: create a shape file; in response to the area range longitude and latitude start and end coordinate information input by the user, create the area range of the new construction partition map of the area to be drawn in the shape file.
[0127] In some embodiments, the above-mentioned layer clipping module 62 is also used to: traverse all layers corresponding to the newly constructed partition map of the area to be drawn; call the layer clipping function during the traversal process, and use the layer clipping function to clip the layer according to the area range to obtain the target layer file.
[0128] In some embodiments, the field numbering module 63 is also used to: create a first field numbering function for the basin surface layer in the target layer file, and a second field numbering function for the third-level new structural partition surface layer in the target layer file; based on the first field numbering function, number the field marked with basin numbers in the basin surface layer in the target layer file to obtain first numbering data; based on the second field numbering function, number the field marked with partition surface numbers in the third-level new structural partition surface layer in the target layer file to obtain second numbering data; and obtain numbering data based on the first numbering data and the second numbering data.
[0129] In some embodiments, before determining the area range of the newly constructed partition map of the area to be drawn, it also includes a file creation module for: determining a file storage location in response to file path information input by a user, and the file storage location is used to store files created and generated during the drawing process.
[0130] In some embodiments, the above-mentioned drawing module 64 is also used to: store the area range, target layer file and numbered data to a file storage location; copy the original workspace to the file storage location; synthesize the area range, target layer file and numbered data with the original workspace to generate a target workspace.
[0131] In some embodiments, after the target workspace is generated, it also includes a finishing module for: responding to an opening operation on the target workspace, displaying a drawing interface in layout mode; responding to a legend insertion operation initiated by a user, and / or, responding to a layout adjustment operation initiated by a user, generating a new structural partition map of the drawn area.
[0132] The device for drawing a new structural zoning map of a region provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the device for drawing a new structural zoning map of a region, reference may be made to the corresponding contents in the aforementioned method embodiment of drawing a new structural zoning map of a region.
[0133] The present application also provides an electronic device, such as Figure 7 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device 100 includes a processor 71 and a memory 70, the memory 70 stores computer executable instructions that can be executed by the processor 71, and the processor 71 executes the computer executable instructions to implement any of the above-mentioned methods for drawing a new structural zoning map of an area.
[0134] exist Figure 7 In the illustrated embodiment, the electronic device further includes a bus 72 and a communication interface 73 , wherein the processor 71 , the communication interface 73 and the memory 70 are connected via the bus 72 .
[0135] Among them, the memory 70 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 73 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 72 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 72 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0136] The processor 71 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 71. The above processor 71 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 71 reads the information in the memory and completes the steps of the method for drawing a new regional structural partition map in the aforementioned embodiment in combination with its hardware.
[0137] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method for drawing a new structural partition map of the region. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.
[0138] The computer program product of the method, device and electronic device for drawing a new structural zoning map of a region provided in the embodiments of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0139] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0140] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0141] In the description of the present application, it should be noted that the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for drawing a regional neotectonic zoning map, characterized in that: include: In response to the area range information input by the user, determining the area range of the new construction partition map of the area to be drawn; Based on the area range, a layer corresponding to the new structural partition map of the area to be drawn is clipped to obtain a target layer file; Perform field numbering on the target layer in the target layer file to obtain numbering data; Generate a target workspace based on the original workspace, the area range, the target layer file and the numbering data to complete the drawing of a new structural zoning map of the area; The original workspace is the original workspace file that only has symbol settings; The target layer in the target layer file is numbered to obtain numbering data, including: creating a first field numbering function for the basin surface layer in the target layer file, and a second field numbering function for the third-level new structure partition surface layer in the target layer file; Based on the first field numbering function, the field labeled with basin number in the basin surface layer in the target layer file is numbered to obtain first numbering data; based on the second field numbering function, the field labeled with partition surface number in the third-level new structure partition surface layer in the target layer file is numbered to obtain second numbering data; the numbering data is obtained based on the first numbering data and the second numbering data; Before determining the area range of the newly constructed zoning map of the area to be drawn, the method further includes: determining a file storage location in response to file path information input by a user; the file storage location is used to store files created and generated during the drawing process; The target workspace is generated based on the original workspace, the area range, the target layer file and the numbering data, including: storing the area range, the target layer file and the numbering data in the file storage location; copying the original workspace to the file storage location; synthesizing the area range, the target layer file and the numbering data with the original workspace to generate the target workspace.
2. The method for drawing a regional new structural zoning map according to claim 1, characterized in that: In response to the area range information input by the user, the area range of the newly constructed partition map of the area to be drawn is created, including: Create shapefile; In response to the latitude and longitude start and end coordinate information of the area range input by the user, the area range of the new construction zoning map of the area to be drawn is created in the shape file.
3. The method for drawing a regional new structural zoning map according to claim 1, characterized in that: Based on the area range, a layer corresponding to the new structural zoning map of the area to be drawn is clipped to obtain a target layer file, including: Traversing all layers corresponding to the newly constructed partition map of the area to be drawn; The layer clipping function is called during the traversal process, and the layer is clipped according to the area range by the layer clipping function to obtain a target layer file.
4. The method for drawing a regional new structural zoning map according to claim 1, characterized in that: After the target workspace is generated, it also includes: In response to an opening operation on the target workspace, displaying a drawing interface in a layout mode; In response to a legend insertion operation initiated by a user, and / or in response to a layout adjustment operation initiated by a user, a newly constructed partition map of the drawn area is generated.
5. A device for drawing a regional new structural zoning map, characterized in that: For implementing the method according to claim 1, the device comprises: An area range determination module is used to determine the area range of the new construction partition map of the area to be drawn in response to the area range information input by the user; A layer clipping module is used to clip the layer corresponding to the new constructed partition map of the area to be drawn based on the area range to obtain a target layer file; A field numbering module, used for numbering the fields of the target layer in the target layer file to obtain numbering data; The drawing module is used to generate a target workspace based on the original workspace, the area range, the target layer file and the numbering data to complete the drawing of the new structural zoning map of the area.
6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method for drawing a new regional structural zoning map as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for drawing a new regional structural zoning map as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Remote sensing image map tile real-time fusion and online updating method
CN110502594A
Electronic map making method and system for partitioning and cutting based on discrete data
CN112233205A