Method for dynamically creating graticule of religious position map
By automatically calculating and adjusting the scale, the longitude and latitude grid of the Zonghai location map is dynamically created, which solves the problems of cumbersome operations and excessive labeling in the existing technology, and realizes the efficient one-click creation of the Zonghai location map.
Patent Information
- Application Number
- CN202410670162.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-10
AI Technical Summary
The existing method for creating the latitude and longitude network of the Zonghai location map is cumbersome. The setting of longitude and latitude intervals and the replacement of label symbols are separated, making adjustments difficult and time-consuming. It is easy to make omissions and cannot automatically confirm whether the text label exceeds the map frame.
By obtaining the map frame size ratio, the range of the number of latitude and longitude grids is determined, the scale is automatically calculated and adjusted, and the latitude and longitude grids are dynamically created to standardize text annotations and ensure that the annotations do not exceed the map frame.
It realizes the one-click dynamic creation of Zonghai location map, automatically adjusts the scale and intervals, reduces manual intervention, and improves the creation efficiency and accuracy.
Smart Images

Figure CN118628609A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of surveying and mapping and geographic information science and technology, and in particular relates to a method for dynamically creating a longitude and latitude grid of a Zonghai location map. Background Art
[0002] The Zonghai map is an important basis for declaring the ownership of the sea area, and accurately records the location of the Zonghai, the boundary points and lines, and its relationship with the adjacent Zonghai. The Zonghai map can be divided into the Zonghai location map, the Zonghai plane layout map, and the Zonghai boundary map. The Zonghai location map mainly describes the location and scope of the Zonghai, focusing on reflecting the plane outline of the project's sea area, its geographical location, and its positional relationship with surrounding important features.
[0003] Zonghai Location Figure 1 Generally, the scale is small, and the map elements include longitude and latitude grids. The creation of longitude and latitude grids requires determining the map scale, map range, longitude interval, latitude interval, and text annotation direction, and replacing the English symbols for minutes and seconds in the annotation text with Chinese symbols. The existing solution is: move and zoom in the map window, adjust the map scale, manually enter the longitude interval and latitude interval, set the text annotation direction, and create the map longitude and latitude grid; when it is found that the longitude and latitude grid does not meet the requirements, delete it and then move and zoom the map window again, reset the longitude interval and latitude interval, and create the map longitude and latitude grid again; break up the longitude and latitude grid elements, manually select the annotation text, and replace the English symbols for minutes and seconds "'" and """ with Chinese symbols "′" and """. The current method has the following shortcomings: (1) The operation steps are cumbersome, and the longitude and latitude interval setting and the annotation text symbol replacement belong to different dialog boxes. (2) It is impossible to confirm in advance whether the text annotation of the largest longitude and latitude grid line in the map window exceeds the map frame, and it is necessary to try to adjust the longitude and latitude interval continuously. (3) The latitude and longitude grids contain many text elements, and text modification and symbol replacement are time-consuming and prone to omissions. Summary of the invention
[0004] In view of the problems existing in the prior art, the purpose of the embodiments of the present application is to provide a method for dynamically creating a latitude and longitude grid of a Zonghai location map.
[0005] According to a first aspect of an embodiment of the present application, a method for dynamically creating a latitude and longitude grid of a Zonghai location map is provided, comprising:
[0006] S1: Get the X-axis length and Y-axis width of the map frame of the layout page, calculate the ratio K of the map frame length and width, and determine the range of the number of longitude grids and the range of the number of latitude grids;
[0007] S2: For a given Zonghai map, obtain the center coordinates of its circumscribed rectangle and determine the expansion range and scale, and zoom the view to the specified scale with the fixed center point;
[0008] S3: Determine the longitude grid interval and the latitude grid interval according to the number range of the longitude and latitude grids;
[0009] S4: Calculate the distance between the maximum latitude and longitude grid inside the expanded range and the border of the map frame on the layout page, move the center point and adjust the scale;
[0010] S5: Dynamically create a longitude and latitude grid based on the external expansion range, longitude interval and latitude interval, and traverse the longitude and latitude grid elements to perform labeling and standardization processing.
[0011] Further, in step S1, the length Pxlen and width Pylen of the map frame of the layout page are obtained, and the ratio of the length and width of the map frame K = Pxlen / Pylen is calculated. According to the ratio K, the minimum number of longitude grids Lleast, the maximum number of longitude grids Lmost, the minimum number of latitude grids Bleast, and the maximum number of latitude grids Bmost are determined:
[0012] (1) If the map frame is in horizontal layout, when 1.1≤K<1.5, the number of longitude grids ranges from 2m to 4m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 4m; when K≥1.5, the minimum number of longitude grids Lleast is 2mK rounded down, and the maximum number of longitude grids Lmost is 4mK rounded down; the number of latitude grids ranges from m to 3m, that is, the minimum number of latitude grids Bleast is m, and the maximum number of latitude grids Bmost is 3m, where m is the preset grid number parameter;
[0013] (2) If the map frame is in a square layout, that is, 0.9≤K<1.1, the number of longitude grids ranges from 2m to 3m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 3m; the number of latitude grids ranges from 2m to 3m, that is, the minimum number of latitude grids Bleast is 2m, and the maximum number of latitude grids Bmost is 3m;
[0014] (3) If the map frame is in vertical layout, that is, 0.5≤K<0.9, the number of latitude grids ranges from m to 3m, that is, the minimum number of latitude grids Bleast is m, and the maximum number of latitude grids Bmost is 3m; when K<0.5, the minimum number of latitude grids Bleast is m / K rounded down, and the maximum number of latitude grids Bmost is 3m / K rounded down; the number of longitude grids is between 2m and 4m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 4m.
[0015] Further, step S2 includes:
[0016] Get the maximum horizontal coordinate Xmax, minimum horizontal coordinate Xmin, maximum vertical coordinate Ymax, and minimum vertical coordinate Ymin of the circumscribed rectangle of the Zonghai map spot, and its center coordinates Xcen=(Xmax+Xmin) / 2.0, Ycen=(Ymax+Ymin) / 2.0. The length and width of the extended range are both determined to be n times the length and width of the circumscribed rectangle. Calculate the horizontal and vertical scales according to the size of the extended range and the size of the page map frame.
[0017] Compare the horizontal scale and the vertical scale, and record the larger value as the map scale ScaleC. Adjust the map scale ScaleC according to the cartographic specifications. The adjusted map scale is recorded as ScaleF. Fix the center point to zoom the view to the specified scale ScaleF.
[0018] Further, in step S3, the longitude grid interval and the latitude grid interval are determined by user input or automatic calculation, wherein the automatic calculation process includes:
[0019] S31: Calculate the maximum longitude Lmax, minimum longitude Lmin, maximum latitude Bmax, and minimum latitude Bmin of the expansion range according to the length and width of the map frame of the layout page and the scale ScaleF;
[0020] S32: Determine the longitude grid interval Linteval2 according to the longitude grid quantity range, the maximum longitude Lmax, and the minimum longitude Lmin;
[0021] S33: Determine the latitude grid interval Binteval2 according to the latitude grid quantity range, the maximum latitude Bmax, and the minimum latitude Bmin.
[0022] Furthermore, in S31, the maximum horizontal coordinate Xmax_k, the minimum horizontal coordinate Xmin_k, the maximum vertical coordinate Ymax_k, and the minimum vertical coordinate Ymin_k of the extended range are calculated by converting the length and width of the layout page map frame into Gaussian projection plane coordinates:
[0023] Xmax_k=Xcen+Pxlen×ScaleF / 200.0;
[0024] Xmin_k=Xcen-Pxlen×ScaleF / 200.0;
[0025] Ymax_k=Ycen+Pylen×ScaleF / 200.0;
[0026] Ymin_k=Ycen-Pylen×ScaleF / 200.0;
[0027] Based on the maximum horizontal coordinate Xmax_k, the minimum horizontal coordinate Xmin_k, the maximum vertical coordinate Ymax_k, and the minimum vertical coordinate Ymin_k, the coordinate points (Xmin_k, Ymin_k) and (Xmax_k, Ymax_k) are constructed. After Gaussian projection inversion, they are converted into coordinate points (Lmin, Bmin) and (Lmax, Bmax) corresponding to the maximum longitude Lmax, the minimum longitude Lmin, the maximum latitude Bmax, and the minimum latitude Bmin.
[0028] Further, S32 includes:
[0029] Calculate the number of longitude grids countMin and countSec with longitude intervals of 1 minute and 1 second respectively, countMin = (int)((Lmax-Lmin)×60), countSec = (int)((Lmax-Lmin)×3600);
[0030] When the number countMin of the longitude interval Linteval with 1 minute as the interval unit is greater than or equal to the minimum number of longitude grids Lleast, compare countMin with the maximum number of longitude grids Lmost. When countMin is less than or equal to Lmost, the longitude grid interval Linteval is 1 minute, otherwise the longitude grid interval Linteval is increased, and the number of longitude grids countMin is recalculated until countMin is less than or equal to Lmost;
[0031] When the number countMin of the longitude interval Linteval with 1 minute as the interval unit is less than the minimum number of longitude grids Lleast, the longitude interval Linteval is in seconds as the interval unit, the loop step perPlus is set according to countSec, the longitude grid interval Linteval is perPlus, and the number of longitude grids countSec is calculated as (int)((Lmax-Lmin) / Linteval×3600). When the number of longitude grids countSec is greater than the maximum number of longitude grids Lmost, the initial loop index index is set to 1, and the loop is entered: the longitude grid interval Linteval=Linteval+index×perPlus, and countSec is recalculated until the number of longitude grids countSec is less than or equal to the maximum number of longitude grids Lmost;
[0032] Convert the calculated longitude interval Linteval to the decimal longitude interval Linteval2.
[0033] Furthermore, S4 includes:
[0034] According to the maximum longitude Lmax, minimum longitude Lmin, maximum latitude Bmax, minimum latitude Bmin, longitude interval Linteval2, and latitude interval Binteval2, calculate the values of the left label Lleft, right label Lright, top label Btop, and bottom label Bbotton:
[0035] Lleft=((int)(Lmin / Linteval2)+1)×Linteval2;
[0036] Lright=((int)(Lmax / Linteval2))×Linteval2;
[0037] Btop=((int)(Bmax / Binteval2))×Binteval2;
[0038] Bbotton=((int)(Bmin / Binteval2)+1)×Binteval2;
[0039] The above longitude and latitude coordinates are used to construct the coordinate points (Lleft, Btop) and (Lright, Bbotton), and the projection transformation is converted into the corresponding plane coordinate points (Xleft, Ytop) and (Xright, Ybottom);
[0040] Calculate the distance Xdeltaleft, Xdeltaright, Ydeltatop, and Ydeltabottom between the maximum latitude and longitude grid in the extended range rectangle and the border of the map frame on the layout page:
[0041] Xdeltaleft = Xleft - Xmin_k;
[0042] Xdeltaright=Xmax_k-Xright;
[0043] Ydeltatop=Ymax_k-Ytop;
[0044] Ydeltabottom=Ybotton-Ymim_k;
[0045] Compare the distance between the maximum latitude and longitude grid in the extended range rectangle and the border of the layout page map frame with the corresponding annotation text size Fontleft, Fontright, Fonttop, Fontbottom to obtain the results Xresultleft, Xresultright, Yresulttop, Yresultbottom:
[0046] Xresultleft=Xdeltaleft×100 / ScaleF-Fontleft / 2.0;
[0047] Xresultright=Xdeltaright×100 / ScaleF-Fontright / 2.0;
[0048] Yresulttop=Ydeltatop×100 / ScaleF-Fonttop / 2.0;
[0049] Yresultbottom=Ydeltabottom×100 / ScaleF-Fontright / 2.0;
[0050] When Xresultleft, Xresultright, Yresulttop, and Yresultbottom are all greater than or equal to 0, there is no need to move the center point or adjust the scale;
[0051] When at least one of Xresultleft, Xresultright, Yresulttop, and Yresultbottom is less than 0, it is necessary to move the center point, adjust the scale, and recalculate the distance between the maximum latitude and longitude grid and the boundary until the requirements are met.
[0052] According to a second aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program / instruction, which implements the method described in the first aspect when executed by a processor.
[0053] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including:
[0054] one or more processors;
[0055] A memory for storing one or more programs;
[0056] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.
[0057] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0058] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0059] It can be seen from the above embodiments that the present application adopts a method for dynamically creating a latitude and longitude grid of a Zonghai location map, which realizes automatic adjustment of map scale and map range, automatic calculation of latitude and longitude intervals, and automatic replacement of latitude and longitude grid text annotations. The latitude and longitude grid of a Zonghai location map can be generated with one click, overcoming the problems of cumbersome operation steps for creating a latitude and longitude grid, constant attempts to adjust the latitude and longitude intervals, time-consuming modification and replacement of annotation text elements, and easy omissions, thereby achieving a Zonghai location map. Figure 1 A technical effect that is created dynamically by keys and does not require human intervention.
[0060] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0062] Figure 1 The present invention is a flowchart of a method for dynamically creating a latitude and longitude grid of a Zonghai location map according to an exemplary embodiment.
[0063] Figure 2 It is a schematic diagram of a map frame of a Zonghai location map according to an exemplary embodiment.
[0064] Figure 3 It is a schematic diagram showing that the Chinese characters on the latitude and longitude grid of the Zonghai location map exceed the map frame according to an exemplary embodiment.
[0065] Figure 4 It is a schematic diagram of the latitude and longitude grid results of the Zonghai location map according to an exemplary embodiment.
[0066] Figure 5 It is a block diagram of a device for dynamically creating a latitude and longitude grid of a Zonghai location map according to an exemplary embodiment.
[0067] Figure 6 The diagram is a schematic diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0068] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0069] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0070] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0071]
Term explanation
[0072] Layout page map frame: The paper on which map data is typeset when printed is called a layout page. The map frame is a rectangular range frame used to display the map.
[0073] Round(int): Rounds a number down to the nearest integer.
[0074] Circumscribed rectangle: The circumscribed rectangle refers to the maximum range of a figure expressed in two-dimensional coordinates, that is, a rectangle whose lower boundary is defined by the maximum horizontal coordinate, minimum horizontal coordinate, maximum vertical coordinate, and minimum vertical coordinate of each vertex of a given two-dimensional figure.
[0075] Rounding: When rounding a decimal number, if the highest digit of the mantissa is 4 or less than 4, discard the mantissa. If the highest digit of the mantissa is 5 or greater than 5, discard the mantissa and add "1" to the previous digit.
[0076] Gauss projection inverse calculation: refers to calculating the corresponding longitude and latitude coordinates when the Gauss projection plane coordinates are known.
[0077] like Figure 1 As shown, the present application provides a method for dynamically creating a latitude and longitude grid of a Zonghai location map, which method may include:
[0078] S1: Get the X-axis length and Y-axis width of the map frame on the layout page, calculate the ratio K of the map frame length and width, and determine the range of the number of longitude and latitude grids;
[0079] S2: For a given Zonghai map, obtain the center coordinates of its circumscribed rectangle and determine the expansion range and scale, and zoom the view to the specified scale with the fixed center point;
[0080] S3: Determine the longitude grid interval and the latitude grid interval according to the number range of the longitude and latitude grids;
[0081] S4: Calculate the distance between the maximum latitude and longitude grid inside the expanded range and the boundary, move the center point and adjust the scale;
[0082] S5: Dynamically create a longitude and latitude grid based on the external expansion range, longitude interval and latitude interval, and traverse the longitude and latitude grid elements to perform labeling and standardization processing.
[0083] In the specific implementation of step S1, the length Pxlen and width Pylen of the map frame of the layout page are obtained, and the ratio K of the length and width of the map frame is calculated, that is, K=Pxlen / Pylen, and the minimum number of longitude grids Lleast, the maximum number of longitude grids Lmost, the minimum number of latitude grids Bleast, and the maximum number of latitude grids Bmost are determined according to the ratio K.
[0084] (1) If the map frame is in horizontal layout, when 1.1≤K<1.5, the number of longitude grids ranges from 2m to 4m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 4m; when K≥1.5, the minimum number of longitude grids Lleast is 2mK rounded down, and the maximum number of longitude grids Lmost is 4mK rounded down; the number of latitude grids ranges from m to 3m, that is, the minimum number of latitude grids Bleast is m, and the maximum number of latitude grids Bmost is 3m;
[0085] (2) If the map frame is in a square layout, that is, 0.9≤K<1.1, the number of longitude grids ranges from 2m to 3m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 3m; the number of latitude grids ranges from 2m to 3m, that is, the minimum number of latitude grids Bleast is 2m, and the maximum number of latitude grids Bmost is 3m;
[0086] (3) If the map frame is in vertical layout, that is, 0.5≤K<0.9, the number of latitude grids ranges from m to 3m, that is, the minimum number of latitude grids Bleast is m, and the maximum number of latitude grids Bmost is 3m; when K<0.5, the minimum number of latitude grids Bleast is m / K rounded down, and the maximum number of latitude grids Bmost is 3m / K rounded down; the number of longitude grids is between 2m and 4m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 4m.
[0087] m is the preset grid quantity parameter. It can be an integer value greater than 1 according to actual needs. The default value is 2.
[0088] For example, for a layout page of A4 paper size, the map frame size is set to Pxlen 26.7cm and width Pylen 18.0cm. Figure 2 Schematic diagram of the map frame. Calculate the ratio of the length and width of the map frame K = 26.7 / 18.0 = 1.48. Since 1.1≤K≤1.5, the number of longitude grids is between 4 and 8, that is, the minimum number of longitude grids Lleast is 4 and the maximum number of longitude grids Lmost is 8; the number of latitude grids ranges from 2 to 6, that is, the minimum number of latitude grids Bleast is 2 and the maximum number of latitude grids Bmost is 6.
[0089] In the specific implementation of step S2, for a given Zonghai map spot, the center coordinates of its circumscribed rectangle are obtained and the expansion range and scale are determined, and the center point is fixed to zoom the view to the specified scale.
[0090] Get the maximum horizontal coordinate Xmax, minimum horizontal coordinate Xmin, maximum vertical coordinate Ymax, and minimum vertical coordinate Ymin of the bounding rectangle of the Zonghai map spot, and its center coordinates Xcen=(Xmax+Xmin) / 2.0, Ycen=(Ymax+Ymin) / 2.0. The length and width of the outer expansion range are determined to be n times the length and width of the outer rectangle. The default value of n is 10. Calculate the horizontal and vertical scales according to the size of the outer expansion range and the size of the page map frame, that is:
[0091] Horizontal scale ScaleH = (100 × (Xmax-Xmin) × n) / Pxlen,
[0092] Vertical scale ScaleV = (100 × (Ymax-Ymin) × n) / Pylen,
[0093] Compare the horizontal scale and the vertical scale, and the larger value is recorded as the map scale Scale C. Adjust the map scale Scale C according to the mapping specifications such as nautical charts and basic topographic maps, as shown in Table 1. The adjusted map scale is recorded as Scale F, and the center point is fixed to zoom the view to the specified scale Scale F.
[0094] Table 1 Map scale ScaleC and map scale ScaleF adjustment correspondence table
[0095] ScaleF ScaleC 1000 (0,1500] 2000 (1500,3000] 4000 (3000,4500] 5000 (4500,6500] 8000 (6500,9000] 10000 (9000,11000] 12000 (11000,13500] ((round)(ScaleC / 5000))×5000 (13500,50000] ((round)(ScaleC / 10000))×10000 (50000,+∞)
[0096] For example, the maximum horizontal coordinate of the circumscribed rectangle of the Zonghai map is Xmax=507445.37, the minimum horizontal coordinate is Xmin=504078.19, the maximum vertical coordinate is Ymax=3132562.13, and the minimum vertical coordinate is Ymin=3130792.73. The calculated center coordinates are Xcen=(Xmax+Xmin) / 2.0=(507445.37+504078.19) / 2.0=505761.78, and Ycen=(Ymax+Ymin) / 2.0=(3132562.13+3130792.73) / 2.0=3131677.43.
[0097] The length and width of the extended range are determined as n times the length and width of the circumscribed rectangle. The default value of n is 10. The horizontal and vertical scales are calculated based on the size of the extended range and the size of the page map frame, that is:
[0098] Horizontal scale ScaleH = (100 × (Xmax-Xmin) × n) / Pxlen = (100 × (507445.37-504078.19) × 10 / 26.7 = 126111.60
[0099] Vertical scale ScaleV = (100 × (Ymax-Ymin) × n) / Pylen = (100 × (3132562.13-3130792.73) × 10 / 18.0) = 98300.19
[0100] Comparing the horizontal scale and the vertical scale, the larger value is recorded as the map scale ScaleC = 126111.60. Since it is located at (50000, +∞), it is adjusted according to the cartographic convention and recorded as the map scale ScaleF = ((round)(ScaleC / 10000))×10000=((round)(126111.60 / 10000))×10000=130000.
[0101] In the specific implementation of step S3, the longitude grid interval and the latitude grid interval are determined according to the number range of the longitude and latitude grids.
[0102] Specifically, there are two ways to determine the longitude grid interval and latitude grid interval. The first is user input and the second is automatic calculation. The process of automatically calculating the longitude grid interval and latitude grid interval is as follows:
[0103] S31: Calculate the maximum longitude Lmax, minimum longitude Lmin, maximum latitude Bmax, and minimum latitude Bmin of the expansion range according to the length and width of the map frame of the layout page and the scale ScaleF;
[0104] Calculate the maximum horizontal coordinate Xmax_k, the minimum horizontal coordinate Xmin_k, the maximum vertical coordinate Ymax_k, and the minimum vertical coordinate Ymin_k of the expansion range. Since Pxlen and Pylen are the length and width of the layout page map frame, they need to be converted into Gaussian projection plane coordinates, and the formula is:
[0105] Xmax_k=Xcen+Pxlen×ScaleF / 200.0;
[0106] Xmin_k=Xcen-Pxlen×ScaleF / 200.0;
[0107] Ymax_k=Ycen+Pylen×ScaleF / 200.0;
[0108] Ymin_k=Ycen-Pylen×ScaleF / 200.0;
[0109] Based on the maximum horizontal coordinate Xmax_k, the minimum horizontal coordinate Xmin_k, the maximum vertical coordinate Ymax_k, and the minimum vertical coordinate Ymin_k, the coordinate points (Xmin_k, Ymin_k) and (Xmax_k, Ymax_k) are constructed. After Gaussian projection inversion, they are converted into coordinate points (Lmin, Bmin) and (Lmax, Bmax) corresponding to the maximum longitude Lmax, the minimum longitude Lmin, the maximum latitude Bmax, and the minimum latitude Bmin.
[0110] For example, calculate the maximum horizontal coordinate Xmax_k, the minimum horizontal coordinate Xmin_k, the maximum vertical coordinate Ymax_k, and the minimum vertical coordinate Ymin_k of the rectangle extending the range in step S2.
[0111] Xmax_k=Xcen+Pxlen×ScaleF / 200.0=505761.78+26.7×130000 / 200.0=523116.78
[0112] Xmin_k=Xcen-Pxlen×ScaleF / 200.0=505761.78-26.7×130000 / 200.0=488406.78
[0113] Ymax_k=Ycen+Pylen×ScaleF / 200.0=3130792.73+18.0×130000 / 200.0=3143377.43
[0114] Ymin_k=Ycen-Pylen×ScaleF / 200.0=3130792.73-18.0×130000 / 200.0=3119977.43
[0115] The maximum abscissa Xmax_k, the minimum abscissa Xmin_k, the maximum ordinate Ymax_k, and the minimum ordinate Ymin_k are constructed into coordinate points (488406.78, 3119977.43) and (523116.78, 3143377.43), and after projection transformation, they are converted into longitude and latitude coordinates (121.381925, 28.194278) and (121.735906, 28.405269), that is, the maximum longitude Lmax is 121.735906, the minimum longitude Lmin is 121.381925, the maximum latitude Bmax is 28.405269, and the minimum latitude Bmin is 28.194278.
[0116] S32: Determine the longitude grid interval Linteval according to the minimum number of longitude grids Lleast, the maximum number of longitude grids Lmost, the maximum longitude Lmax, and the minimum longitude Lmin determined in step S1.
[0117] 1) Since the location range of Zonghai is generally within 1 degree, special cases such as cross-sea bridges and pipelines may span multiple degrees in long-distance distribution, with degrees as the interval, but this is extremely rare. Therefore, the number of longitude grids countMin and countSec with longitude intervals of 1 minute (') and 1 second (") are calculated respectively. The formula is:
[0118] countMin=(int)((Lmax-Lmin)×60)
[0119] countSec=(int)((Lmax-Lmin)×3600)
[0120] For example, first calculate the number of longitude grids countMin and countSec in units of 1 minute (') and 1 second (") respectively, using the formula:
[0121] countMin=(int)((Lmax-Lmin)×60)=(int)((121.735906-121.381925)×60)=21
[0122] countSec=(int)((Lmax-Lmin)×3600)=(int)((121.735906-121.381925)×3600)=1274
[0123] 2) When the number countMin of the longitude interval Linteval with 1 minute (′) as the interval unit is greater than or equal to the minimum number of longitude grids Lleast, compare countMin with the maximum number of longitude grids Lmost. When countMin is less than or equal to Lmost, the longitude grid interval Linteval is 1 minute (1 / 60 degree), otherwise increase the longitude grid interval Linteval (such as increasing by 0.5 each time), and recalculate the number of longitude grids countMin until countMin is less than or equal to Lmost;
[0124] When the longitude interval Linteval is 1 minute (') as the interval unit, the calculation formula for countMin is:
[0125] countMin=(int)((Lmax-Lmin) / Linteval×60)
[0126] When the number of longitude grids countMin is less than or equal to the maximum number of longitude grids Lmost, the loop is terminated.
[0127] For example, when the minimum number of longitude grids Lleast is 4, the maximum number of longitude grids Lmost is 8, and the countMin value is 21, which is greater than the minimum number of longitude grids Lleast, compare countMin with the maximum number of longitude grids Lmost. Since countMin is greater than Lmost, enter a loop: the first loop longitude grid interval Linteval = Linteval + 0.5 = 1 + 0.5 = 1.5, recalculate the number of longitude grids countMin, the formula is
[0128] countMin=(int)((Lmax-Lmin) / Linteval×60)=(int)((121.735906-121.381925) / 1.5×60)=14,
[0129] Since the number of longitude grids countMin is 14, which is still greater than the maximum number of longitude grids Lmost, the second loop is entered. Set the longitude grid interval Linteval = Linteval + 0.5 = 1.5 + 0.5 = 2.0, and recalculate the number of longitude grids countMin. The formula is:
[0130] countMin=(int)((Lmax-Lmin) / Linteval×60)=(int)((121.735906-121.381925) / 2.0×60)=10,
[0131] Since the number of longitude grids countMin is 10, which is still greater than the maximum number of longitude grids Lmost, the third cycle is entered. Set the longitude grid interval Linteval = Linteval + 0.5 = 2.0 + 0.5 = 2.5, and recalculate the number of longitude grids countMin. The formula is:
[0132] countMin=(int)((Lmax-Lmin) / Linteval×60)=(int)((121.735906-121.381925) / 2.5×60)=8,
[0133] Since the number of longitude grids countMin is 8, which is less than or equal to the maximum number of longitude grids Lmost, the loop is terminated and the longitude interval Linteval is 2.5 minutes.
[0134] 3) When the number countMin of the longitude interval Linteval with 1 minute (′) as the interval unit is less than the minimum number Lleast of the longitude grids, the longitude interval Linteval is in seconds (″) as the interval unit. The loop step perPlus is set according to the number countSec. The default value of perPlus is 1 second (1 / 3600 degree). When the conditions in Table 2 are met, perPlus takes the corresponding value.
[0135] Table 2 perPlus and countSec correspondence table
[0136] perPlus(″) countSec 30 [120,+∞) 20 [60,120) 10 [30,60) 5 [10,30) 2 (0,30), countSec>Lmost
[0137] The longitude grid interval Linteval is perPlus, and the number of longitude grids countSec is calculated using the formula:
[0138] countSec=(int)((Lmax-Lmin) / Linteval×3600)
[0139] When the number of longitude grids countSec is greater than the maximum number of longitude grids Lmost, the initial loop index index is set to 1, and the loop is entered: the longitude grid interval Linteval = Linteval + index × perPlus, and countSec is recalculated until the number of longitude grids countSec is less than or equal to the maximum number of longitude grids Lmost.
[0140] 4) The longitude interval Linteval conversion unit is expressed in decimal degrees and is recorded as longitude interval Linteval2.
[0141] For example, the longitude interval Linteval is 2.5 minutes. When converted to decimal degrees, the longitude interval Linteval2 is 0.0416667.
[0142] S33: Determine the latitude grid interval Binteval according to the minimum number of latitude grids Bleast, the maximum number of latitude grids Bmost, the maximum latitude Bmax, and the minimum latitude Bmin determined in step S1. The calculation method is the same as step (2) and will not be expanded. The latitude interval Binteval is converted to a unit expressed in decimal degrees and is recorded as the latitude interval Binteval2.
[0143] For example, the minimum latitude grid number Bleast is 2, the maximum latitude grid number Bmost is 6, the maximum latitude Bmax is 28.405269, and the minimum latitude Bmin is 28.194278. From Table 3, it can be seen that when the latitude grid interval Binteval = 2.0 minutes, the number of latitude grids is 6, which is less than or equal to the maximum latitude grid number Bmost. The latitude interval Binteval conversion unit is expressed in decimal degrees, and the latitude interval Binteval2 is 0.0333333.
[0144] Table 3 Grid quantity table at different latitude intervals
[0145] Latitude range difference (degrees) Convert units (1 degree = 60 minutes) Latitude interval (minutes) Grid quantity 0.210991 60 1.0 12 0.210991 60 1.5 8 0.210991 60 2.0 6 0.210991 60 2.5 5 0.210991 60 3.0 4 0.210991 60 3.5 3
[0146] In the specific implementation of step S4, the distance between the maximum latitude and longitude grid inside the expanded range and the boundary is calculated, and the center point is moved and the scale is adjusted.
[0147] Since the grid text annotation cannot exceed the map outline, it is necessary to determine the distance between the maximum longitude and latitude grid within the expanded range rectangle constructed by the maximum longitude Lmax, minimum longitude Lmin, maximum latitude Bmax, and minimum latitude Bmin in step S3 and the boundary of the layout page map frame. There are 8 annotation positions (upper left L, upper left B, lower left L, lower left B, upper right L, upper right B, lower right L, and lower right B). Since the annotation position coordinates X of the upper left L and lower left L are the same, they are merged into the left annotation Lleft. Similarly, the upper right L and lower right L are merged into the right annotation Lright. The annotation positions Y coordinates of the upper left B and upper right B are the same, so they are merged into the top annotation Btop. Similarly, the lower left B and lower right B are merged into the bottom annotation Bbotton.
[0148] S41: According to the maximum longitude Lmax, minimum longitude Lmin, maximum latitude Bmax, minimum latitude Bmin, longitude interval Linteval2, and latitude interval Binteval2, calculate the values of the left label Lleft, right label Lright, top label Btop, and bottom label Bbotton. The formula is as follows
[0149] Lleft=((int)(Lmin / Linteval2)+1)×Linteval2
[0150] Lright=((int)(Lmax / Linteval2))×Linteval2
[0151] Btop=((int)(Bmax / Binteval2))×Binteval2
[0152] Bbotton=((int)(Bmin / Binteval2)+1)×Binteval2
[0153] For example, the maximum longitude Lmax is 121.735906, the minimum longitude Lmin is 121.381925, the maximum latitude Bmax is 28.405269, the minimum latitude Bmin is 28.194278, the longitude interval Linteval2 is 0.0416667 degrees, the latitude interval Binteval2 is 0.0333333 degrees, calculate the left label Lleft, right label Lright, top label Btop, bottom label Bbotton values, the formula is as follows
[0154] Lleft=((int)(Lmin / Linteval2)+1)×Linteval2=((int)(121.381925 / 0.0416667)+1)×0.0416667=121.416667
[0155] Lright=((int)(Lmax / Linteval2))×Linteval2=((int)(121.735906 / 0.0416667))×0.0416667=121.416667
[0156] Btop=((int)(Bmax / Binteval2))×Binteval2=((int)(28.405269 / 0.0333333))×0.0333333=28.400000
[0157] Bbotton=((int)(Bmin / Binteval2)+1)×Binteval2=((int)(28.194278 / 0.0333333)+1)×0.0333333=28.200000
[0158] The above longitude and latitude coordinates are used to construct the coordinate points (Lleft, Btop) and (Lright, Bbotton), namely (121.416667, 28.400000) and (121.416667, 28.200000), and the projection transformation is converted into the corresponding plane coordinate points (Xleft, Ytop) and (Xright, Ybottom), namely (491833.68, 3142773.65) and (520454.09, 3120623.53), where Xleft is 491833.68, Xright is 520454.09, Ytop is 3142773.65, and Ybottom is 3120623.53.
[0159] (3) The distances between the maximum latitude and longitude grid in the extended range rectangle and the border of the layout page map frame are Xdeltaleft, Xdeltaright, Ydeltatop, and Ydeltabottom, respectively. The calculation formula is:
[0160] Xdeltaleft=Xleft-Xmin_k
[0161] Xdeltaright=Xmax_k-Xright
[0162] Ydeltatop=Ymax_k-Ytop
[0163] Ydeltabottom=Ybotton-Ymim_k
[0164] The above steps calculate that the maximum horizontal coordinate Xmax_k is 523116.78, the minimum horizontal coordinate Xmin_k is 488406.78, the maximum vertical coordinate Ymax_k is 3143377.43, and the minimum vertical coordinate Ymin_k is 3119977.43. The distances between the maximum longitude and latitude grid and the boundary in the extended range rectangle are Xdeltaleft, Xdeltaright, Ydeltatop, and Ydeltabottom, respectively. The calculation formula is:
[0165] Xdeltaleft=Xleft-Xmin_k=491833.68-488406.78=3426.90
[0166] Xdeltaright=Xmax_k-Xright=523116.78-520454.09=2662.69
[0167] Ydeltatop=Ymax_k-Ytop=3143377.43-3142773.65=603.78
[0168] Ydeltabottom=Ybotton-Ymim_k=3120623.53-3119977.43=646.10
[0169] (4) The size of the annotation text is determined by the annotation content and the font size. Assume that the left, right, top, and bottom annotation text sizes are Fontleft, Fontright, Fonttop, and Fontbottom. The distance between the maximum latitude and longitude grid and the boundary within the extended range rectangle is compared with the corresponding annotation text size to obtain the results Xresultleft, Xresultright, Yresulttop, and Yresultbottom. The calculation formula is:
[0170] Xresultleft=Xdeltaleft×100 / ScaleF-Fontleft / 2.0
[0171] Xresultright=Xdeltaright×100 / ScaleF-Fontright / 2.0
[0172] Yresulttop=Ydeltatop×100 / ScaleF-Fonttop / 2.0
[0173] Yresultbottom=Ydeltabottom×100 / ScaleF-Fontright / 2.0
[0174] For example, the label is marked with Songti font and size 7.09, the left label font size Fontleft value is 1.5478, the right label font size Fontright value is 1.5478, the top label font size Fonttop value is 1.4288, and the bottom label font size. The distance between the maximum latitude and longitude grid and the boundary in the extended range rectangle is compared with the corresponding label font size to obtain the results Xresultleft, Xresultright, Yresulttop, and Yresultbottom. The calculation formula is:
[0175] Xresultleft=Xdeltaleft×100 / ScaleF-Fontleft / 2.0=3426.90×100 / 130000-1.5478 / 2.0=1.86
[0176] Xresultright=Xdeltaright×100 / ScaleF-Fontright / 2.0=2662.90×100 / 130000-1.5478 / 2.0=1.27
[0177] Yresulttop=Ydeltatop×100 / ScaleF-Fonttop / 2.0=603.78×100 / 130000-1.4288 / 2.0=-0.25
[0178] Yresultbottom=Ydeltabottom×100 / ScaleF-Fontright / 2.0=646.10×100 / 130000-1.4288 / 2.0=-0.22
[0179] Based on the current interval, the latitude and longitude grid dynamically generates a display Figure 3 As shown, the dimension text at the upper left, upper right, lower left, and lower right exceeds the boundary.
[0180] 1) When Xresultleft, Xresultright, Yresulttop, and Yresultbottom are all ≥ 0, the requirements are met and there is no need to move the center point or adjust the scale.
[0181] 2) When any of Xresultleft, Xresultright, Yresulttop, or Yresultbottom is less than 0, it is necessary to move the center point, adjust the scale, and recalculate the distance between the maximum longitude and latitude grid and the boundary until the requirements are met.
[0182] For example, if and only if Xresultleft < 0, the map view moves to the right by a distance Xmoveleft, and the formula is
[0183] Xmoveleft=-1.5×Xresultleft×ScaleF / 100
[0184] Accordingly, the maximum longitude distance on the right and the boundary distance Xdeltaright change, and the formula is:
[0185] Xdeltaright=Xdeltaright-Xmoveleft
[0186] Again compare the maximum longitude distance on the right with the boundary distance Xdeltaright and the corresponding annotation text size Xresultright. If Xresultright≥0, it meets the requirements. If Xresultright<0, ScaleF needs to be adjusted, that is, ScaleF takes the next level value, and re-execute steps S3 and S4 until it meets the requirements.
[0187] When one or all of the other Xresultright, Yresulttop, and Yresultbottom are less than 0, refer to the above steps and move the center and adjust the scale until Xresultleft, Xresultright, Yresulttop, and Yresultbottom are all ≥ 0.
[0188] For example, since Yresulttop and Yresultbottom are both less than 0, the scale needs to be adjusted. The map scale ScaleF is adjusted from 130000 to 140000. Steps S3 and S4 are re-executed. When Xresultleft, Xresultright, Yresulttop, and Yresultbottom are all ≥ 0, the requirements are met. Figure 4 shown.
[0189] In the specific implementation of step S5, a longitude and latitude grid is dynamically created according to the external expansion range, longitude interval and latitude interval, and the longitude and latitude grid elements are traversed to perform labeling normalization processing.
[0190] Dynamically create a latitude and longitude grid based on the external expansion range, minimum longitude interval and latitude interval. The latitude and longitude grid is a whole, including borders, longitudes, latitudes and text annotations. Traverse the latitude and longitude grid elements and determine the element type: when the type is text, replace "'" and "" with Chinese symbols "′" and "″", and traverse the next element; when the type is not text, directly traverse the next element.
[0191] For example, according to the expansion range, the minimum longitude interval and the latitude interval, a latitude and longitude grid is dynamically created. When traversing the latitude and longitude grid, when traversing to the element 121°24'00", it is determined that the type is a text element, and the "'" and """ are replaced with the Chinese symbols "′" and "″". After replacement, it is 121°24′00", and the next element is traversed; when the type is not text, the next element is traversed directly until all elements are traversed.
[0192] Corresponding to the aforementioned embodiment of the method for dynamically creating a latitude and longitude grid of a Zonghai location map, the present application also provides an embodiment of a device for dynamically creating a latitude and longitude grid of a Zonghai location map.
[0193] Figure 5 The present invention is a block diagram of a device for dynamically creating a latitude and longitude grid of a Zonghai location map according to an exemplary embodiment. Figure 5 , the device may include:
[0194] The latitude and longitude grid quantity determination module 21 is used to obtain the X-axis length and Y-axis width of the map frame of the layout page, calculate the ratio K of the map frame length and width, and determine the range of the longitude grid quantity and the range of the latitude grid quantity;
[0195] The module 22 for determining the expansion range and scale is used to obtain the center coordinates of the circumscribed rectangle of a given Zonghai map spot and determine the expansion range and scale, and to zoom the view to a specified scale by fixing the center point;
[0196] The latitude and longitude grid interval determination module 23 is used to determine the longitude grid interval and the latitude grid interval according to the number range of the longitude and latitude grids;
[0197] The distance calculation module 24 is used to calculate the distance between the maximum latitude and longitude grid inside the expansion range and the border of the map frame of the layout page, and to move the center point and adjust the scale;
[0198] The latitude and longitude grid dynamic creation module 25 is used to dynamically create the latitude and longitude grid according to the external expansion range, longitude interval and latitude interval, and traverse the latitude and longitude grid elements to perform labeling and normalization processing.
[0199] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0200] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0201] Correspondingly, the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the above-mentioned method for dynamically creating a latitude and longitude grid of a Zonghai location map.
[0202] Accordingly, the present application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for dynamically creating a latitude and longitude grid of a Zonghai location map. Figure 6 As shown, it is a hardware structure diagram of any device with data processing capability where a device for dynamically creating a latitude and longitude grid of a Zonghai location map provided by an embodiment of the present invention is located, except Figure 6 In addition to the processor, memory and network interface shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capability, which will not be described in detail.
[0203] Correspondingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the method for dynamically creating the latitude and longitude network of the Zonghai location map as described above is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.
[0204] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0205] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A method for dynamically creating a latitude and longitude grid of a Zonghai location map, characterized in that: include: S1: Get the X-axis length and Y-axis width of the map frame of the layout page, calculate the ratio K of the map frame length and width, and determine the range of the number of longitude grids and the range of the number of latitude grids; S2: For a given Zonghai map, obtain the center coordinates of its circumscribed rectangle and determine the expansion range and scale, and zoom the view to the specified scale with the fixed center point; S3: Determine the longitude grid interval and the latitude grid interval according to the number range of the longitude and latitude grids; S4: Calculate the distance between the maximum latitude and longitude grid inside the expanded range and the border of the map frame on the layout page, move the center point and adjust the scale; S5: Dynamically create a longitude and latitude grid based on the external expansion range, longitude interval and latitude interval, and traverse the longitude and latitude grid elements to perform labeling and standardization processing.
2. The method according to claim 1, characterized in that In step S1, the length Pxlen and width Pylen of the map frame of the layout page are obtained, and the ratio of the length and width of the map frame K = Pxlen / Pylen is calculated. According to the ratio K, the minimum number of longitude grids Lleast, the maximum number of longitude grids Lmost, the minimum number of latitude grids Bleast, and the maximum number of latitude grids Bmost are determined: (1) If the map frame is in horizontal layout, when 1.1≤K<1.5, the number of longitude grids ranges from 2m to 4m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 4m; when K≥1.5, the minimum number of longitude grids Lleast is 2mK rounded down, and the maximum number of longitude grids Lmost is 4mK rounded down; the number of latitude grids ranges from m to 3m, that is, the minimum number of latitude grids Bleast is m, and the maximum number of latitude grids Bmost is 3m, where m is the preset grid number parameter; (2) If the map frame is in a square layout, that is, 0.9≤K<1.1, the number of longitude grids ranges from 2m to 3m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 3m; the number of latitude grids ranges from 2m to 3m, that is, the minimum number of latitude grids Bleast is 2m, and the maximum number of latitude grids Bmost is 3m; (3) If the map frame is in vertical layout, that is, 0.5≤K<0.9, the number of latitude grids ranges from m to 3m, that is, the minimum number of latitude grids Bleast is m, and the maximum number of latitude grids Bmost is 3m; when K<0.5, the minimum number of latitude grids Bleast is m / K rounded down, and the maximum number of latitude grids Bmost is 3m / K rounded down; the number of longitude grids is between 2m and 4m, that is, the minimum number of longitude grids Lleast is 2m, and the maximum number of longitude grids Lmost is 4m.
3. The method according to claim 1, characterized in that Step S2 includes: Get the maximum horizontal coordinate Xmax, minimum horizontal coordinate Xmin, maximum vertical coordinate Ymax, and minimum vertical coordinate Ymin of the circumscribed rectangle of the Zonghai map spot, and its center coordinates Xcen=(Xmax+Xmin) / 2.0, Ycen=(Ymax+Ymin) / 2.
0. The length and width of the extended range are both determined to be n times the length and width of the circumscribed rectangle. Calculate the horizontal and vertical scales according to the size of the extended range and the size of the page map frame. Compare the horizontal scale and the vertical scale, and record the larger value as the map scale ScaleC. Adjust the map scale ScaleC according to the cartographic specifications. The adjusted map scale is recorded as ScaleF. Fix the center point to zoom the view to the specified scale ScaleF.
4. The method according to claim 1, characterized in that: In step S3, the longitude grid interval and the latitude grid interval are determined by user input or automatic calculation, wherein the automatic calculation process includes: S31: Calculate the maximum longitude Lmax, minimum longitude Lmin, maximum latitude Bmax, and minimum latitude Bmin of the expansion range according to the length and width of the map frame of the layout page and the scale ScaleF; S32: Determine the longitude grid interval Linteval2 according to the longitude grid quantity range, the maximum longitude Lmax, and the minimum longitude Lmin; S33: Determine the latitude grid interval Binteval2 according to the latitude grid quantity range, the maximum latitude Bmax, and the minimum latitude Bmin.
5. The method according to claim 4, characterized in that In S31, the maximum horizontal coordinate Xmax_k, the minimum horizontal coordinate Xmin_k, the maximum vertical coordinate Ymax_k, and the minimum vertical coordinate Ymin_k of the extended range are calculated by converting the length and width of the layout page map frame into Gauss projection plane coordinates: Xmax_k=Xcen+Pxlen×ScaleF / 200.0; Xmin_k=Xcen-Pxlen×ScaleF / 200.0; Ymax_k=Ycen+Pylen×ScaleF / 200.0; Ymin_k=Ycen-Pylen×ScaleF / 200.0; Based on the maximum horizontal coordinate Xmax_k, the minimum horizontal coordinate Xmin_k, the maximum vertical coordinate Ymax_k, and the minimum vertical coordinate Ymin_k, the coordinate points (Xmin_k, Ymin_k) and (Xmax_k, Ymax_k) are constructed. After Gaussian projection inversion, they are converted into coordinate points (Lmin, Bmin) and (Lmax, Bmax) corresponding to the maximum longitude Lmax, the minimum longitude Lmin, the maximum latitude Bmax, and the minimum latitude Bmin.
6. The method according to claim 4, characterized in that S32 includes: Calculate the number of longitude grids countMin and countSec with longitude intervals of 1 minute and 1 second respectively, countMin = (int)((Lmax-Lmin)×60), countSec = (int)((Lmax-Lmin)×3600); When the number countMin of the longitude interval Linteval with 1 minute as the interval unit is greater than or equal to the minimum number of longitude grids Lleast, compare countMin with the maximum number of longitude grids Lmost. When countMin is less than or equal to Lmost, the longitude grid interval Linteval is 1 minute, otherwise the longitude grid interval Linteval is increased, and the number of longitude grids countMin is recalculated until countMin is less than or equal to Lmost; When the number countMin of the longitude interval Linteval with 1 minute as the interval unit is less than the minimum number of longitude grids Lleast, the longitude interval Linteval is in seconds as the interval unit, the loop step perPlus is set according to countSec, the longitude grid interval Linteval is perPlus, and the number of longitude grids countSec is calculated as (int)((Lmax-Lmin) / Linteval×3600). When the number of longitude grids countSec is greater than the maximum number of longitude grids Lmost, the initial loop index index is set to 1, and the loop is entered: the longitude grid interval Linteval=Linteval+index×perPlus, and countSec is recalculated until the number of longitude grids countSec is less than or equal to the maximum number of longitude grids Lmost; Convert the calculated longitude interval Linteval to the decimal longitude interval Linteval2.
7. The method according to claim 1, characterized in that S4 includes: According to the maximum longitude Lmax, minimum longitude Lmin, maximum latitude Bmax, minimum latitude Bmin, longitude interval Linteval2, and latitude interval Binteval2, calculate the values of the left label Lleft, right label Lright, top label Btop, and bottom label Bbotton: Lleft=((int)(Lmin / Linteval2)+1)×Linteval2; Lright=((int)(Lmax / Linteval2))×Linteval2; Btop=((int)(Bmax / Binteval2))×Binteval2; Bbotton=((int)(Bmin / Binteval2)+1)×Binteval2; The above longitude and latitude coordinates are used to construct the coordinate points (Lleft, Btop) and (Lright, Bbotton), and the projection transformation is converted into the corresponding plane coordinate points (Xleft, Ytop) and (Xright, Ybottom); Calculate the distance Xdeltaleft, Xdeltaright, Ydeltatop, and Ydeltabottom between the maximum latitude and longitude grid in the extended range rectangle and the border of the map frame on the layout page: Xdeltaleft=Xleft–Xmin_k; Xdeltaright=Xmax_k–Xright; Ydeltatop=Ymax_k–Ytop; Ydeltabottom=Ybotton–Ymim_k; Compare the distance between the maximum latitude and longitude grid in the extended range rectangle and the border of the layout page map frame with the corresponding annotation text size Fontleft, Fontright, Fonttop, Fontbottom to obtain the results Xresultleft, Xresultright, Yresulttop, Yresultbottom: Xresultleft=Xdeltaleft×100 / ScaleF–Fontleft / 2.0; Xresultright=Xdeltaright×100 / ScaleF–Fontright / 2.0; Yresulttop=Ydeltatop×100 / ScaleF–Fonttop / 2.0; Yresultbottom=Ydeltabottom×100 / ScaleF–Fontright / 2.0; When Xresultleft, Xresultright, Yresulttop, and Yresultbottom are all greater than or equal to 0, there is no need to move the center point or adjust the scale; When at least one of Xresultleft, Xresultright, Yresulttop, and Yresultbottom is less than 0, it is necessary to move the center point, adjust the scale, and recalculate the distance between the maximum latitude and longitude grid and the boundary until the requirements are met.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
