Method and device for determining map grid, electronic equipment and storage medium
By calculating the latitude and longitude coordinates of the grid vertices in the Moccato coordinate system, the problem of unequal grid areas in high-latitude regions is solved, and the accuracy of counting statistics is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2026-03-17
AI Technical Summary
When drawing square grids on a planar map unfolded in the Moccato coordinate system, the actual area of the grids is not equal due to the stretching of high-latitude regions, resulting in inaccurate counting and statistical results.
By obtaining the latitude and longitude intervals of the rectangular drawing area, determining the latitude and longitude variation values according to the preset grid precision, and calculating the latitude and longitude coordinates of the vertices of each grid, the grid area is ensured to be consistent.
This improves the accuracy of grid drawing and ensures the accuracy of counting and statistical results.
Smart Images

Figure CN116342746B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image generation technology, specifically to the fields of map making and map grid drawing, and can be applied to scenarios such as event statistics and area statistics. In particular, it relates to a method, apparatus, electronic device and storage medium for determining map grids. Background Technology
[0002] When displaying content using a flat map based on business needs, the front-end page needs to count and analyze the content contained in the display area.
[0003] Currently, the counting method involves drawing square grids on a flat map, mapping the latitude and longitude coordinates of the displayed content to the square grids and marking the grids, and finally counting the number of marked grids to count the displayed content.
[0004] However, when drawing a square grid on a planar map unfolded in the Moccato coordinate system, because the map is stretched in high-latitude regions, the actual distance corresponding to the upper side length of the square grid is smaller than the actual distance corresponding to the lower side length. This results in the actual area of the grid drawn based on the latitude and longitude coordinates of the grid vertices being unequal. Consequently, the grid marked by the latitude and longitude coordinates of the displayed content is inaccurate, ultimately leading to inaccurate counting and statistical results of the displayed content. Summary of the Invention
[0005] This disclosure provides a method, apparatus, electronic device, and storage medium for determining map grids, which can accurately obtain the latitude and longitude coordinates of the vertices of grids with the same actual area, thereby improving the accuracy of the actual area represented by the drawn grid.
[0006] According to a first aspect of this disclosure, a method for determining a map grid is provided, comprising:
[0007] Obtain the latitude and longitude intervals of the rectangular drawing area, with one side of the rectangular drawing area parallel to the equator; determine the latitude variation value based on the preset first grid precision, which is the difference in latitude between the upper and lower edges of any horizontal grid to be drawn in the rectangular drawing area; determine the latitude and longitude coordinates of the vertices of each grid based on the latitude interval, longitude interval, latitude variation value, and the preset second grid precision.
[0008] According to a second aspect of this disclosure, an apparatus for determining a map grid is provided, the apparatus comprising: an acquisition module and a processing module.
[0009] The acquisition module is used to obtain the latitude and longitude intervals of the rectangular drawing area, with one side of the rectangular drawing area parallel to the equator.
[0010] The processing module is used to determine the latitude variation value based on the preset first grid precision. The latitude variation value is the difference in latitude between the upper and lower edges of any horizontal grid to be drawn in the rectangular drawing area. It is also used to determine the latitude and longitude coordinates of the vertices of each grid based on the latitude interval, longitude interval, latitude variation value, and preset second grid precision.
[0011] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0012] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the method according to the first aspect.
[0013] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method according to the first aspect.
[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0015] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0016] Figure 1 A flowchart illustrating the method for determining a map grid provided in an embodiment of this disclosure;
[0017] Figure 2 This is a schematic diagram illustrating the determination of a rectangular drawing area provided in an embodiment of this disclosure;
[0018] Figure 3 Another flowchart illustrating the method for determining a map grid provided in this disclosure embodiment;
[0019] Figure 4 This is yet another flowchart illustrating a method for determining a map grid provided in an embodiment of the present disclosure;
[0020] Figure 5 This is yet another flowchart illustrating a method for determining a map grid provided in an embodiment of the present disclosure;
[0021] Figure 6 This is yet another flowchart illustrating a method for determining a map grid provided in an embodiment of the present disclosure;
[0022] Figure 7 This is yet another flowchart illustrating a method for determining a map grid provided in an embodiment of the present disclosure;
[0023] Figure 8 This is yet another flowchart illustrating a method for determining a map grid provided in an embodiment of the present disclosure;
[0024] Figure 9 A schematic diagram illustrating the composition of an apparatus for determining a map grid according to an embodiment of this disclosure;
[0025] Figure 10 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0026] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0027] It should be understood that in the embodiments of this disclosure, the character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0028] When displaying content using a flat map based on business needs, the front-end page needs to count and analyze the content contained in the display area.
[0029] Currently, the counting method involves drawing square grids on a flat map, mapping the latitude and longitude coordinates of the displayed content to the square grids and marking the grids, and finally counting the number of marked grids to count the displayed content.
[0030] For example, when using a flat map to display traffic accident events, the latitude and longitude coordinates of the traffic accident events in the display area are obtained, and the grids containing these latitude and longitude coordinates are marked. Finally, the number of marked grids is counted to determine the number of traffic accident events.
[0031] However, when drawing a square grid on a planar map unfolded in the Moccato coordinate system, the actual distance corresponding to the upper side length of the square grid is less than the actual distance corresponding to the lower side length because the map is stretched in high-latitude regions. This results in the grid area drawn based on the latitude and longitude coordinates of the grid vertices being inaccurate, which in turn makes the grid marked by the latitude and longitude coordinates of the displayed content inaccurate, ultimately leading to inaccurate counting and statistical results.
[0032] The actual distance corresponding to the top side length of the square grid refers to the actual distance on Earth corresponding to the length of the grid drawn on the map.
[0033] For example, on a flat map, 1cm at the equator represents a real distance of 1km. However, as latitude increases, 1cm at that latitude will represent a real distance of less than 1km. Therefore, the real area represented by different square grids is also different, and the grid marked using the latitude and longitude coordinates of the displayed content is also inaccurate.
[0034] Against this background, this disclosure provides a method for determining map grids, which can accurately obtain the latitude and longitude coordinates of the vertices of grids with the same actual area, thereby improving the accuracy of the actual area represented by the drawn grid.
[0035] The execution entity of the method for determining a map grid provided in this disclosure can be a computer or server, or other electronic devices with data processing capabilities; alternatively, the execution entity can be a processor (e.g., a central processing unit (CPU)) in the aforementioned electronic device; furthermore, the execution entity can be an application program (APP) installed in the aforementioned electronic device that can implement the function of the method; or the execution entity can be a functional module or unit in the aforementioned electronic device that has the function of the method, etc. No limitation is placed on the execution entity of this method.
[0036] For example, a server could be a backend server that determines the map grid. A computer or electronic device could be a computing unit that determines the map grid, etc.
[0037] In some embodiments, the server can be a single server, or it can be a server cluster consisting of multiple servers. In some embodiments, the server cluster can also be a distributed cluster. This disclosure does not limit the specific implementation of the server.
[0038] The method for determining the map grid is illustrated below with reference to the accompanying drawings.
[0039] Figure 1This is a flowchart illustrating a method for determining a map grid according to an embodiment of this disclosure. Figure 1 As shown, the method may include:
[0040] S101. Obtain the latitude and longitude intervals of the rectangular drawing area. One side of the rectangular drawing area is parallel to the equator.
[0041] The rectangular drawing area is a rectangular region of a grid to be drawn on a planar map. The latitude interval is determined by the latitude of the upper and lower edges of the rectangular drawing area, and the longitude interval is determined by the latitude of the left and right edges of the rectangular drawing area.
[0042] For example, the upper edge latitude of the rectangular drawing area is 30 degrees north latitude and the lower edge latitude is 10 degrees north latitude, thus defining the latitude range as 10 degrees north latitude to 30 degrees north latitude; similarly, the longitude range will not be elaborated further.
[0043] S102. Based on the preset first grid precision, determine the latitude variation value. The latitude variation value is the difference between the latitude of the upper and lower edges of any horizontal grid to be drawn in the rectangular drawing area.
[0044] The first grid precision is the actual distance corresponding to the grid edge in the latitudinal direction.
[0045] For example, the latitude variation value can be determined by determining the actual distance between the upper and lower edges of the rectangular drawing area based on the latitude interval, then determining the number of horizontal rows of the grid to be drawn in the rectangular drawing area, and finally determining the latitude variation value; or the latitude variation value can be determined directly based on the precision of the first grid.
[0046] S103. Determine the latitude and longitude coordinates of the vertices of each grid based on the latitude interval, longitude interval, latitude variation value, and preset second grid precision.
[0047] The second grid precision is the actual distance corresponding to the grid edge in the longitude direction.
[0048] For example, the latitude and longitude coordinates of the vertices of each grid can be determined by determining the longitude variation value based on the latitude interval, longitude interval, latitude variation value, and the preset second grid precision, and then determining the latitude and longitude coordinates of the vertices of the grid row by row (horizontal row) and grid by grid based on the latitude variation value and the longitude variation value; or the latitude of the upper and lower edges of each horizontal row can be determined first, and then the longitude of the left and right edges of each grid in each horizontal row can be determined based on the longitude variation value, and finally the latitude and longitude coordinates of the vertices of each grid can be determined.
[0049] According to the embodiments of this disclosure, the latitude change value corresponding to the first grid precision is determined based on the latitude interval and the first grid precision. Then, according to the latitude interval, the longitude interval, the latitude change value, and the preset second grid precision, the longitude change value corresponding to the second grid precision is determined. Based on the latitude change value and the longitude change value, the latitude and longitude coordinates of the vertices of the grid with the same actual area can be accurately obtained, thereby improving the accuracy of the actual area represented by the drawn grid.
[0050] Using the latitude and longitude coordinates of the grid obtained by the embodiments of this disclosure, the corresponding grid can be accurately marked by the latitude and longitude coordinates of the event, thereby improving the accuracy of the event counting and statistical results.
[0051] In one possible implementation, before obtaining the latitude and longitude intervals of the rectangular drawing area, the method further includes:
[0052] Obtain the extreme points of latitude and longitude coordinates of the area to be drawn, and determine the latitude and longitude intervals of the rectangular drawing area based on the extreme points of latitude and longitude coordinates of the area to be drawn.
[0053] The area to be drawn is a region on a flat map where a grid needs to be drawn; it can be a regular shape or an irregular shape.
[0054] The extreme points of latitude and longitude coordinates of the area to be drawn can be the minimum longitude point, the minimum latitude point, the maximum longitude point, and the maximum latitude point in the area to be drawn. The minimum longitude point and the minimum latitude point can coincide, and the maximum longitude point and the maximum latitude point can coincide.
[0055] For example, Figure 2 This is a schematic diagram illustrating the determination of a rectangular drawing area provided in an embodiment of this disclosure, such as... Figure 2 As shown, the shaded area is the area to be drawn, A is the minimum longitude point, B is the minimum latitude point, C is the maximum longitude point, and D is the maximum latitude point. The determined rectangular drawing area is the area corresponding to the rectangular box. The latitude interval is the latitude between B and D (including the latitude of B and D), and the longitude interval is the longitude between A and C (including the longitude of A and C).
[0056] This implementation method obtains the extreme points of latitude and longitude coordinates of the area to be drawn, and determines the latitude and longitude intervals of the rectangular drawing area based on the extreme points of latitude and longitude coordinates of the area to be drawn. This allows for the accurate acquisition of the latitude and longitude coordinates of the vertices of the grid with the same actual area for any regular or irregular area to be drawn.
[0057] Figure 3 This is another flowchart illustrating the method for determining a map grid provided in an embodiment of this disclosure. Figure 3As shown, based on the preset first grid precision, the latitude variation value is determined, specifically including:
[0058] S301. Determine the vertical distance of the rectangular drawing area based on the latitude range. The vertical distance is the actual distance between the upper and lower edges of the rectangular drawing area.
[0059] Actual distance refers to the distance on a flat map corresponding to the actual distance on Earth. Vertical distance is the distance between the top and bottom edges of a rectangular area drawn on a map, corresponding to the actual distance on Earth.
[0060] For example, after obtaining the latitude range, the difference between the maximum and minimum latitudes within the range can be calculated first to obtain the first difference value. Then, the product of the first difference value and 111 can be calculated to obtain the first product, which is the longitudinal distance of the rectangular drawing area. On Earth, when the latitudes on the same meridian differ by 1 degree, the actual arc length (i.e., the actual distance) differs by approximately 111 km. Therefore, the product of the first difference value and 111 is the longitudinal distance.
[0061] Alternatively, the vertical distance of the rectangular drawing area can be calculated using the following formula (1):
[0062] y_length=(y_max–y_min)*111 formula (1)
[0063] In formula (1), y_length represents the vertical distance of the rectangular drawing area, y_max represents the maximum latitude in the latitude interval, and y_min represents the minimum latitude in the latitude interval.
[0064] S302. Based on the first grid precision and vertical distance, determine the number of horizontal rows to be drawn in the rectangular drawing area.
[0065] For example, after obtaining the first grid precision and vertical distance, the ratio of the vertical distance to the first grid precision can be calculated to obtain the first ratio, which is the number of horizontal rows to be drawn in the rectangular drawing area.
[0066] Optionally, the number of rows to be drawn in the rectangular drawing area can be calculated using the following formula (2):
[0067] y_gridNum=y_length / acc_1 formula (2)
[0068] In formula (2), y_gridNum represents the number of rows, and acc_1 represents the precision of the first grid.
[0069] In some embodiments, the calculated number of rows is not an integer. In this case, the latitude interval can be updated. The goal of the latitude interval update is to recalculate the non-integer number of rows calculated before the update and round it up, and use the updated latitude interval as the latitude interval of the rectangular drawing area.
[0070] S303. Determine the latitude variation value based on the latitude range and the number of rows.
[0071] For example, after obtaining the latitude range and the number of rows, you can first calculate the difference between the maximum and minimum latitude in the latitude range to obtain the first difference value, and then calculate the ratio of the first difference value to the number of rows to obtain the first ratio value. The first ratio value is the latitude change value.
[0072] Alternatively, the latitude variation can be calculated using the following formula (3):
[0073] y_gridRatio=(y_max–y_min) / y_gridNum formula (3)
[0074] In formula (3), y_gridRatio represents the latitude variation value.
[0075] The embodiments of this disclosure determine the longitudinal distance and the number of horizontal rows by using the latitude range and the first grid precision, which can accurately determine the latitude change value and thus improve the accuracy of the determined map grid.
[0076] In one possible implementation, the latitude variation value is determined based on a preset first grid precision, specifically including:
[0077] Based on the first grid precision, determine the difference between the upper and lower latitudes of the first grid precision on the same longitude. The difference is the latitude change value.
[0078] For example, after obtaining the preset first grid precision, the ratio of the first grid precision to 111 can be calculated to obtain the first ratio, which is the latitude change value.
[0079] Alternatively, the latitude variation can be calculated using the following formula (4):
[0080] y_gridRatio=y'_max – y'_min = acc_1 / 111 Formula (4)
[0081] In formula (4), y'_max and y'_min represent the upper and lower latitudes of the first grid accuracy on the same longitude, respectively.
[0082] This implementation method, through the first grid precision, can quickly and accurately determine the latitude change value, thereby improving the accuracy of the determined map grid.
[0083] Figure 4 This is another flowchart illustrating the method for determining map grids provided in embodiments of this disclosure, such as... Figure 4 As shown, before determining the latitude and longitude coordinates of the vertices of each grid based on the latitude interval, longitude interval, latitude variation value, and preset second grid precision, the method further includes:
[0084] S401. Determine the vertical distance of the rectangular drawing area based on the latitude range. The vertical distance is the actual distance between the upper and lower edges of the rectangular drawing area.
[0085] In this embodiment, the specific operation of step 401 has been described. Figure 3 The steps in step 301 of the illustrated embodiment are described in detail and will not be repeated here.
[0086] S402. Determine the number of horizontal rows to be drawn in the rectangular drawing area based on the first grid precision and vertical distance.
[0087] In this embodiment, the specific operation of step 402 has been described. Figure 3 Step 302 in the illustrated embodiment is described in detail and will not be repeated here.
[0088] This embodiment of the disclosure determines the longitudinal distance by using the latitude range and the first grid precision, which can accurately determine the number of horizontal rows, and thus accurately determine the latitude and longitude coordinates of the vertices of each grid.
[0089] Figure 5 This is another flowchart illustrating the method for determining map grids provided in embodiments of this disclosure, such as... Figure 5 As shown, based on the latitude interval, longitude interval, latitude variation value, and preset second grid precision, the latitude and longitude coordinates of the vertices of each grid are determined, specifically including:
[0090] S501. Define the number of horizontal rows as M. The rectangular drawing area includes the first horizontal row from south to north to the Mth horizontal row, where M is an integer greater than 1, and m = 2, ..., M.
[0091] For example, the first row can be the southernmost row in the rectangular drawing area, and the mth row can be the northernmost row in the rectangular drawing area.
[0092] Optionally, the first row can also be the northernmost row in the rectangular drawing area, and the mth row can also be the southernmost row in the rectangular drawing area.
[0093] S502. Based on the latitude interval, longitude interval, and latitude variation value, determine the latitude of the upper and lower edges of the first horizontal row, as well as the horizontal distance of the first horizontal row; the horizontal distance is the actual distance between the left edge of the leftmost grid and the right edge of the rightmost grid in the corresponding horizontal row.
[0094] The horizontal distance can be the actual distance between the left edge of the leftmost grid and the right edge of the rightmost grid at any latitude in the upper and lower latitude range of the first horizontal row.
[0095] For example, the latitude of the lower edge of the first horizontal row is the minimum latitude of the latitude region, and the latitude of the upper edge of the first horizontal row can be determined based on the latitude of the lower edge of the first horizontal row and the latitude variation value. The lateral distance of the first horizontal row can be determined based on the latitude of the lower edge of the first horizontal row and the longitude range.
[0096] S503. Based on the longitude interval, the lateral distance of the first horizontal row, and the preset second grid precision, determine the longitude variation value of adjacent grids in the first horizontal row.
[0097] For example, the number of grids in the first horizontal row can be determined first based on the horizontal distance of the first horizontal row and the preset second grid precision, and then the longitude variation value of adjacent grids in the first horizontal row can be determined based on the number of grids in the first horizontal row and the longitude interval.
[0098] S504. Determine the latitude and longitude coordinates of the vertices of the grid in the first row based on the longitude interval, the horizontal distance of the first row, the longitude variation value of the first row, and the latitude variation value.
[0099] For example, firstly, the number of grids in the first horizontal row is determined based on the horizontal distance of the first horizontal row and the preset second grid precision. Then, based on the longitude interval and the longitude variation value of the first horizontal row, the left and right edge longitudes of the leftmost grid in the first horizontal row are determined. Next, based on the upper and lower edge latitudes of the first horizontal row, and the left and right edge longitudes of the leftmost grid in the first horizontal row, the latitude and longitude coordinates of the vertex of the leftmost grid are determined. Finally, based on the right edge longitude of the leftmost grid and the longitude variation value of the first horizontal row, the left and right edge longitudes of the grids to the right of the leftmost grid are determined. Finally, the latitude and longitude coordinates of the vertices of all grids in the first horizontal row are determined.
[0100] S505. Based on the latitude, longitude interval, and latitude variation value of the lower edge of the (m-1)th horizontal row, determine the latitude of the upper and lower edges of the mth horizontal row, as well as the horizontal distance of the mth horizontal row.
[0101] For example, the latitude of the upper edge and the latitude of the lower edge of the (m-1)th horizontal row can be determined based on the latitude of the lower edge and the latitude change value of the lower edge of the (m-1)th horizontal row, and the lateral distance of the mth horizontal row can be determined based on the latitude of the lower edge of the mth horizontal row and the longitude interval.
[0102] S506. Based on the longitude interval, the lateral distance of the m-th row, and the preset second grid precision, determine the longitude variation value of adjacent grids in the m-th row.
[0103] For example, the number of grids in the m-th row can be determined first based on the lateral distance of the m-th row and the preset second grid precision, and then the longitude variation value of adjacent grids in the m-th row can be determined based on the number of grids in the m-th row and the longitude interval.
[0104] S507. Based on the longitude interval, the horizontal distance of the m-th row, the longitude variation value of the m-th row, and the latitude variation value, determine the longitude and latitude coordinates of the vertices of the grid in the m-th row.
[0105] For example, first, the number of grids in the m-th row is determined based on the lateral distance of the m-th row and the preset second grid precision. Then, based on the longitude interval and the longitude variation value of the m-th row, the left and right edge longitudes of the leftmost grid in the m-th row are determined. Next, based on the upper and lower edge latitudes of the m-th row and the left and right edge longitudes of the leftmost grid in the m-th row, the latitude and longitude coordinates of the vertex of the leftmost grid are determined. Finally, based on the right edge longitude of the leftmost grid and the longitude variation value of the m-th row, the left and right edge longitudes of the grids to the right of the leftmost grid are determined. Finally, the latitude and longitude coordinates of the vertices of all grids in the m-th row are determined.
[0106] In this embodiment, the latitude of the upper and lower edges of the first horizontal row is determined based on the latitude interval, the longitude interval, and the latitude variation value, as well as the lateral distance of the first horizontal row. Then, based on the longitude interval, the lateral distance of the first horizontal row, and the preset second grid precision, the longitude variation value of the first horizontal row is determined. Then, based on the longitude interval, the lateral distance of the first horizontal row, the longitude variation value of the first horizontal row, and the latitude variation value, the latitude and longitude coordinates of the vertices of the grid in the first horizontal row are determined. Similarly, based on the latitude of the lower edge of the first horizontal row, the latitude and longitude coordinates of the vertices of the grid in each horizontal row can be accurately determined, thereby improving the accuracy of the actual area represented by the drawn grid.
[0107] Figure 6 This is another flowchart illustrating the method for determining map grids provided in embodiments of this disclosure, such as... Figure 6 As shown, based on the longitude interval, the latitude of the lower edge of the (m-1)th horizontal row, and the latitude variation value, the latitude of the upper and lower edges of the mth horizontal row, as well as the lateral distance of the mth horizontal row, are determined, specifically including:
[0108] S601. Based on the latitude of the lower edge of the (m-1)th row and the latitude change value, determine the latitude of the upper edge and the lower edge of the mth row.
[0109] For example, after obtaining the latitude of the lower edge of the (m-1)th row and the latitude change value, the sum of the latitude of the lower edge of the (m-1)th row and the latitude change value is calculated to obtain the first summation result, which is the latitude of the lower edge of the mth row; then the sum of the latitude of the lower edge of the mth row and the latitude change value is calculated to obtain the second summation result, which is the latitude of the upper edge of the mth row.
[0110] Alternatively, the latitude of the lower edge of the m-th row can be calculated using the following formula (5):
[0111] cur_y_m=cur_y_m-1+y_gridRatio formula (5)
[0112] In formula (5), cur_y_m represents the latitude of the lower edge of the m-th row, and cur_y_m-1 represents the latitude of the lower edge of the m-th row.
[0113] S602. Determine the lateral distance of the m-th row based on the longitude interval and the latitude of the lower edge of the m-th row.
[0114] For example, after obtaining the longitude interval and the latitude of the lower edge of the m-th row, the difference between the maximum and minimum longitude in the longitude interval is calculated to obtain the first difference result. Then, the cosine value of the latitude of the lower edge of the m-th row is calculated to obtain the first cosine result. Finally, the product of the first difference result, the first cosine result, and 111 is calculated to obtain the first product result. The first product result is the horizontal distance of the m-th row.
[0115] Alternatively, the lateral distance of the m-th row can be calculated using the following formula (6):
[0116] m_x_length=(x_max–x_min)*111*cos(cur_y_M) formula (6)
[0117] In formula (6), m_x_length represents the horizontal distance of the m-th row, x_max and x_min represent the maximum and minimum longitude of the longitude interval, respectively, and cos(cur_y_m) represents the cosine value of the latitude of the lower edge of the m-th row.
[0118] In this embodiment, the latitude of the lower edge of the m-th row is determined by the latitude of the lower edge of the (m-1)-th row and the latitude change value. Then, based on the latitude of the lower edge of the m-th row and the longitude interval, the latitude of the lower edge of the m-th row can be accurately determined, and thus the latitude coordinates of the vertices of the grid in the m-th row can be accurately determined.
[0119] Figure 7 This is another flowchart illustrating the method for determining map grids provided in embodiments of this disclosure, such as... Figure 7 As shown, based on the longitude interval, the lateral distance of the m-th row, and the preset second grid precision, the longitude variation value of adjacent grids in the m-th row is determined, including:
[0120] S701. Determine the number of grids in the m-th row based on the horizontal distance of the m-th row and the preset second grid precision.
[0121] For example, after obtaining the horizontal distance of the m-th row and the preset second grid precision, the ratio of the horizontal distance of the m-th row to the second grid precision can be calculated to obtain the first ratio result, which is the number of grids in the m-th row.
[0122] Alternatively, the number of grid cells in the m-th row can be calculated using the following formula (7):
[0123] m_x_gridNum = m_x_length / acc_2 (Formula 7)
[0124] In formula (7), m_x_gridNum represents the number of grids in the m-th row, and acc_2 represents the second grid precision.
[0125] In some embodiments, the number of grids in the m-th row is not an integer. In this case, the longitude interval can be updated. The goal of the longitude interval update is to recalculate the number of grids that are not integers calculated before the update and round them up, and use the updated longitude interval as the longitude interval of the rectangular drawing area.
[0126] S702. Based on the longitude interval and the number of grids in the m-th row, determine the longitude variation between two adjacent grids in the m-th row.
[0127] For example, after obtaining the number of grids and longitude intervals in the m-th row, first calculate the difference between the maximum and minimum longitudes in the longitude interval to obtain the first difference result, and then calculate the ratio of the first difference result to the number of grids in the m-th row to obtain the first ratio result. The first ratio result is the longitude change value between two adjacent grids in the m-th row.
[0128] Optionally, the longitude variation between two adjacent grids in the m-th row can be calculated using the following formula (8):
[0129] Formula (8) = m_x_ratio = (x_max – x_min) / m_x_gridNum
[0130] In formula (8), m_x_ratio represents the longitude variation between two adjacent grids in the m-th row.
[0131] This embodiment of the disclosure determines the number of grids in the m-th horizontal row by using the lateral distance of the m-th horizontal row and the preset second grid precision. Then, based on the number of grids in the m-th horizontal row and the longitude interval, the longitude change value of two adjacent grids in the m-th horizontal row can be accurately determined, thereby accurately determining the longitude coordinates of the vertices of the grids in the m-th horizontal row.
[0132] Figure 8 This is another flowchart illustrating the method for determining map grids provided in embodiments of this disclosure, such as... Figure 8 As shown, based on the longitude interval, the longitude variation value of the m-th row, and the latitude variation value, the longitude and latitude coordinates of the vertices of the grid in the m-th row are determined, including:
[0133] S801. Determine the number of grids in the m-th row based on the horizontal distance of the m-th row and the preset second grid precision; define the number of grids in the m-th row as N, where the m-th row includes the first grid from left to right to the Nth grid, where N is an integer greater than 1, and n = 2, ..., N.
[0134] In this embodiment, the specific operation of step 801 has been described in detail in step 701 of the embodiment shown in 703, and will not be repeated here.
[0135] For example, the first grid can be the leftmost grid in the m-th row, and the n-th grid can be the rightmost grid in the m-th row.
[0136] Alternatively, the first grid can be the northernmost grid in the m-th row, and the M-th grid can be the leftmost grid in the m-th row.
[0137] S802. Based on the longitude interval and the longitude variation value of the m-th horizontal row, determine the longitude of the left and right edges of the first grid.
[0138] For example, after obtaining the longitude interval and the longitude change value of the mth row, the minimum longitude in the longitude interval is the longitude of the left edge of the first grid. The sum of the longitude of the left edge of the first grid and the longitude change value of the mth row is calculated to obtain the first summation result, which is the longitude of the right edge of the first grid.
[0139] S803. Based on the latitude of the upper and lower edges of the m-th row, and the longitude of the left and right edges of the first grid, determine the latitude and longitude coordinates of the vertices of the first grid.
[0140] For example, the longitude of the lower left vertex of the first grid is the longitude of the left edge of the first grid, and the latitude of the lower left vertex is the latitude of the lower edge of the m-th row; the longitude of the upper left vertex of the first grid is the longitude of the left edge of the first grid, and the latitude of the upper left vertex is the latitude of the upper edge of the m-th row; the longitude of the lower right vertex of the first grid is the longitude of the right edge of the first grid, and the latitude of the lower right vertex is the latitude of the lower edge of the m-th row; the longitude of the upper right vertex of the first grid is the longitude of the right edge of the first grid, and the latitude of the upper right vertex is the latitude of the upper edge of the m-th row.
[0141] S804. Based on the longitude of the right edge of the (n-1)th grid and the longitude change value of the mth row, determine the longitude of the left edge and the right edge of the nth grid.
[0142] For example, after obtaining the longitude of the right edge of the (n-1)th grid and the longitude change value of the mth row, the longitude of the right edge of the (n-1)th grid is the longitude of the left edge of the nth grid. The sum of the longitude of the left edge of the nth grid and the longitude change value of the mth row is calculated to obtain the first summation result, which is the longitude of the right edge of the nth grid.
[0143] S805. Based on the latitude and longitude of the top and bottom edges of the m-th row, and the longitude of the left and right edges of the n-th grid, determine the latitude and longitude coordinates of the vertices of the n-th grid.
[0144] For example, the longitude of the bottom left vertex of the nth grid is the longitude of the left edge of the nth grid, and the latitude of the bottom left vertex is the latitude of the bottom edge of the mth row; the longitude of the top left vertex of the nth grid is the longitude of the left edge of the nth grid, and the latitude of the top left vertex is the latitude of the top edge of the mth row; the longitude of the bottom right vertex of the nth grid is the longitude of the right edge of the nth grid, and the latitude of the bottom right vertex is the latitude of the bottom edge of the mth row; the longitude of the top right vertex of the nth grid is the longitude of the right edge of the nth grid, and the latitude of the top right vertex is the latitude of the top edge of the mth row.
[0145] In this embodiment, the number of grids in the m-th row is determined based on the lateral distance of the m-th row and the preset second grid precision. Then, the longitude of the left and right edges of the first grid is determined based on the longitude interval and the longitude variation value of the m-th row. Then, the latitude and longitude coordinates of the vertices of the first grid are determined based on the longitude of the left and right edges of the first grid, as well as the latitude of the upper and lower edges of the m-th row. Similarly, based on the latitude of the right edge of the first grid, the latitude and longitude coordinates of the vertices of the grids in the m-th row can be accurately determined, thereby improving the accuracy of the actual area represented by the drawn grid.
[0146] In one possible implementation, the latitude and longitude coordinates of the vertices of each grid are determined based on the latitude interval, longitude interval, latitude variation value, and preset second grid precision, which may include the following steps 1-3.
[0147] Step 1: Determine the horizontal distance of each row based on the latitude range and latitude variation value. The horizontal distance is the actual distance between the left edge of the leftmost grid and the right edge of the rightmost grid in the corresponding row.
[0148] The horizontal distance can be the actual distance between the left edge of the leftmost grid and the right edge of the rightmost grid at any latitude in the upper and lower latitude range of the first horizontal row.
[0149] For example, the latitude of the bottom edge of the bottommost horizontal row in the rectangular drawing area is the minimum latitude of the latitude region. The latitude of the top edge of the bottommost horizontal row can be determined based on the latitude of the bottom edge of the bottommost horizontal row and the latitude variation value. The lateral distance of the bottommost horizontal row can be determined based on the latitude and longitude interval of the bottom edge of the bottommost horizontal row. Similarly, the lateral distances of other horizontal rows in the rectangular drawing area can be determined based on the latitude of the bottom edges of the adjacent horizontal rows below them.
[0150] Step 2: Determine the longitude variation value of adjacent grids in each row based on the lateral distance of each row and the preset second grid precision.
[0151] For example, the number of grids in each row can be determined first based on the lateral distance of each row and the preset second grid precision, and then the longitude variation value of adjacent grids in each row can be determined based on the number of grids in each row and the longitude interval.
[0152] Step 3: Determine the latitude and longitude coordinates of the grid vertices in each horizontal row based on the latitude interval, longitude interval, latitude variation value, and longitude variation value.
[0153] For example, the latitude of the upper and lower edges of each row can be determined first based on the latitude range and latitude variation value. Then, the longitude of the left and right edges of each grid in each row can be determined based on the longitude range and longitude variation value. Finally, based on the latitude of the upper and lower edges of each row, as well as the longitude of the left and right edges of each grid in each row, the latitude and longitude coordinates of the grid vertices in each row can be accurately determined.
[0154] This implementation method determines the lateral distance of each row based on the latitude interval and latitude variation value. Then, based on the lateral distance of each row and the preset second grid precision, it determines the longitude variation value of adjacent grids in each row. Based on the latitude interval, longitude interval, latitude variation value, and longitude variation value, the latitude and longitude coordinates of the grid vertices in each row can be accurately determined, thereby improving the accuracy of the actual area represented by the drawn grid.
[0155] The foregoing primarily describes the solutions provided by the embodiments of this disclosure from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0156] In an exemplary embodiment, this disclosure also provides an apparatus for determining a map grid, which can be used to implement the method for determining a map grid as described in the foregoing embodiments.
[0157] Figure 9 This is a schematic diagram illustrating the composition of an apparatus for determining a map grid according to an embodiment of this disclosure. Figure 9 As shown, the device may include an acquisition module 901 and a processing module 902.
[0158] The acquisition module 901 is used to acquire the latitude and longitude intervals of the rectangular drawing area, with one side of the rectangular drawing area parallel to the equator.
[0159] The processing module 902 is used to determine the latitude variation value according to the preset first grid precision, the latitude variation value being the difference between the latitude of the upper and lower edges of any horizontal grid to be drawn in the rectangular drawing area; and to determine the latitude and longitude coordinates of the vertices of each grid according to the latitude interval, longitude interval, latitude variation value, and preset second grid precision.
[0160] In one possible implementation, the processing module 902 is further configured to:
[0161] Before obtaining the latitude and longitude intervals of the rectangular drawing area, obtain the extreme points of latitude and longitude coordinates of the area to be drawn, and determine the latitude and longitude intervals of the rectangular drawing area based on the extreme points of latitude and longitude coordinates of the area to be drawn.
[0162] In one possible implementation, the processing module 902 is specifically used for:
[0163] Based on the latitude range, determine the vertical distance of the rectangular drawing area, which is the actual distance between the upper and lower edges of the rectangular drawing area; based on the first grid precision and the vertical distance, determine the number of horizontal rows to be drawn in the rectangular drawing area; based on the latitude range and the number of horizontal rows, determine the latitude variation value.
[0164] In one possible implementation, the processing module 902 is specifically used for:
[0165] Based on the first grid precision, determine the difference between the upper and lower latitudes of the first grid precision on the same longitude. The difference is the latitude change value.
[0166] In one possible implementation, the processing module 902 is further configured to:
[0167] Before determining the latitude and longitude coordinates of the vertices of each grid based on the latitude interval, longitude interval, latitude variation value, and preset second grid precision, the longitudinal distance of the rectangular drawing area is determined based on the latitude interval. The longitudinal distance is the actual distance between the upper and lower edges of the rectangular drawing area. Based on the first grid precision and the longitudinal distance, the number of horizontal rows to be drawn in the rectangular drawing area is determined.
[0168] In one possible implementation, the processing module 902 is specifically used for:
[0169] Define the number of horizontal rows as M. The rectangular drawing area includes the first to the Mth horizontal rows from south to north, where M is an integer greater than 1, and m = 2, ..., M. Based on the latitude interval and latitude variation value, determine the latitude of the upper and lower edges of the first horizontal row, as well as the horizontal distance of the first horizontal row. The horizontal distance is the actual distance between the left edge of the leftmost grid and the right edge of the rightmost grid in the corresponding horizontal row. Based on the horizontal distance of the first horizontal row and the preset second grid precision, determine the longitude variation value of adjacent grids in the first horizontal row. Based on the longitude variation value and latitude variation value of the first horizontal row... The values are used to determine the latitude and longitude coordinates of the vertices of the grid in the first horizontal row; based on the latitude of the lower edge of the (m-1)th horizontal row and the latitude variation value, the latitude of the upper edge and lower edge of the mth horizontal row, as well as the horizontal distance of the mth horizontal row, are determined; the horizontal distance is the actual distance between the left edge of the leftmost grid and the right edge of the rightmost grid in the corresponding horizontal row; based on the horizontal distance of the mth horizontal row and the preset second grid precision, the longitude variation value of adjacent grids in the mth horizontal row is determined; based on the longitude variation value and latitude variation value of the mth horizontal row, the latitude and longitude coordinates of the vertices of the grid in the mth horizontal row are determined.
[0170] In one possible implementation, the processing module 902 is specifically used for:
[0171] Based on the latitude of the lower edge of the (m-1)th row and the latitude variation value, determine the latitude of the upper edge and the lower edge of the mth row; based on the longitude interval and the latitude of the lower edge of the mth row, determine the lateral distance of the mth row.
[0172] In one possible implementation, the processing module 902 is specifically used for:
[0173] Based on the lateral distance of the m-th row and the preset second grid precision, determine the number of grids in the m-th row; based on the longitude interval and the number of grids in the m-th row, determine the longitude variation between two adjacent grids in the m-th row.
[0174] In one possible implementation, the processing module 902 is specifically used for:
[0175] Based on the lateral distance of the m-th row and the preset second grid precision, determine the number of grids in the m-th row; the number of grids in the m-th row is N, and the m-th row includes the first grid to the Nth grid from left to right, where N is an integer greater than 1, and n = 2, ..., N; based on the longitude interval and the longitude variation value of the m-th row, determine the left and right edge longitudes of the first grid; based on the upper and lower edge latitudes of the m-th row, and the left and right edge longitudes of the first grid, determine the latitude and longitude coordinates of the vertex of the first grid; based on the right edge longitude of the (n-1)-th grid and the longitude variation value of the m-th row, determine the left and right edge longitudes of the n-th grid; based on the upper and lower edge latitudes of the M-th row, and the left and right edge longitudes of the n-th grid, determine the latitude and longitude coordinates of the vertex of the n-th grid.
[0176] In one possible implementation, the processing module 902 is specifically used for:
[0177] Based on the latitude range and latitude variation value, determine the lateral distance of each row. The lateral distance is the actual distance between the left edge of the leftmost grid and the right edge of the rightmost grid in the corresponding row. Based on the lateral distance of each row and the preset second grid precision, determine the longitude variation value of adjacent grids in each row. Based on the latitude variation value and the longitude variation value, determine the latitude and longitude coordinates of the grid vertices in each row.
[0178] It should be noted that, Figure 9 The module division described herein is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. For example, two or more functions can be integrated into a single processing module. This disclosure does not impose any limitations on this. The integrated modules described above can be implemented in hardware or as software functional modules.
[0179] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0180] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0181] In an exemplary embodiment, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiments. The electronic device may be the computer or server described above.
[0182] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the above embodiments.
[0183] In an exemplary embodiment, the computer program product includes a computer program that, when executed by a processor, implements the method described in the above embodiments.
[0184] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0185] like Figure 10 As shown, the electronic device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of the device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0186] Multiple components in electronic device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, etc.; output unit 1007, such as various types of displays, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows electronic device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0187] The computing unit 1001 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as the method for determining a map grid. For example, in some embodiments, the method for determining a map grid can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the method for determining a map grid described above can be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured in any other suitable manner (e.g., by means of firmware) to perform a method for determining a map grid.
[0188] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0189] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0190] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0191] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0192] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LAMs), wide area networks (WAMs), and the Internet.
[0193] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0194] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0195] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for determining a map grid, the method comprising: obtaining a latitude interval and a longitude interval of a rectangular drawing area, one side of the rectangular drawing area being parallel to the equator; determining a latitude change value according to a preset first grid precision, the latitude change value being a difference between upper and lower edge latitudes of any horizontal row of grids to be drawn in the rectangular drawing area; determining longitude and latitude coordinates of vertices of each grid according to the latitude interval, the longitude interval, the latitude change value, and a preset second grid precision; wherein the determining of the latitude change value according to the preset first grid precision comprises: determining a longitudinal distance of the rectangular drawing area according to the latitude interval, the longitudinal distance being an actual distance between upper and lower edges of the rectangular drawing area; determining a number of horizontal rows of the rectangular drawing area to be drawn according to the first grid precision and the longitudinal distance; determining the latitude change value according to the latitude interval and the number of horizontal rows; wherein the determining of the longitude and latitude coordinates of the vertices of each grid according to the latitude interval, the longitude interval, the latitude change value, and the preset second grid precision comprises: defining the number of horizontal rows as M, the rectangular drawing area including a first horizontal row to an Mth horizontal row from south to north, M being an integer greater than 1, m = 2, …, M; determining upper and lower edge latitudes of the first horizontal row and a horizontal distance of the first horizontal row according to the latitude interval, the longitude interval, and the latitude change value, the horizontal distance being an actual distance between a left edge of a leftmost grid and a right edge of a rightmost grid in the corresponding horizontal row; determining a longitude change value of adjacent grids in the first horizontal row according to the longitude interval, the horizontal distance of the first horizontal row, and the preset second grid precision; determining longitude and latitude coordinates of vertices of grids in the first horizontal row according to the longitude interval, the horizontal distance of the first horizontal row, the longitude change value of the first horizontal row, and the latitude change value; determining upper and lower edge latitudes of the mth horizontal row and a horizontal distance of the mth horizontal row according to lower edge latitude of the m-1th horizontal row, the longitude interval, and the latitude change value; determining a longitude change value of adjacent grids in the mth horizontal row according to the longitude interval, the horizontal distance of the mth horizontal row, and the preset second grid precision; determining longitude and latitude coordinates of vertices of grids in the mth horizontal row according to the longitude interval, the horizontal distance of the mth horizontal row, the longitude change value of the mth horizontal row, and the latitude change value. 2.The method of claim 1, before the obtaining of the latitude interval and the longitude interval of the rectangular drawing area, the method further comprising: obtaining extreme points of longitude and latitude coordinates of the area to be drawn, and determining the latitude interval and the longitude interval of the rectangular drawing area according to the extreme points of longitude and latitude coordinates of the area to be drawn. 3.The method of any one of claims 1 or 2, wherein the determining of the latitude change value according to the preset first grid precision comprises: determining a difference between upper and lower end latitudes of the first grid precision on the same longitude according to the first grid precision, the difference being the latitude change value.
4. The method of claim 3, before the step of determining the longitude and latitude coordinates of the vertex of each grid according to the latitude interval, the longitude interval, the latitude change value and the preset second grid precision, the method further comprises: determining a vertical distance of the rectangular drawing area according to the latitude interval, the vertical distance being an actual distance between an upper edge and a lower edge of the rectangular drawing area; determining a number of horizontal rows to be drawn in the rectangular drawing area according to the first grid precision and the vertical distance.
5. The method of claim 1, the step of determining the upper edge latitude and the lower edge latitude of the mth horizontal row, and the horizontal distance of the mth horizontal row according to the lower edge latitude of the m-1th horizontal row, the longitude interval, and the latitude change value, comprises: determining the upper edge latitude and the lower edge latitude of the mth horizontal row according to the lower edge latitude of the m-1th horizontal row and the latitude change value; determining the horizontal distance of the mth horizontal row according to the longitude interval and the lower edge latitude of the mth horizontal row.
6. The method of claim 1, the step of determining the longitude change value of adjacent grids in the mth horizontal row according to the longitude interval, the horizontal distance of the mth horizontal row, and the preset second grid precision, comprises: determining a number of grids in the mth horizontal row according to the horizontal distance of the mth horizontal row and the preset second grid precision; determining the longitude change value of adjacent two grids in the mth horizontal row according to the longitude interval and the number of grids in the mth horizontal row.
7. The method of claim 1, the step of determining the longitude and latitude coordinates of the vertex of a grid in the mth horizontal row according to the longitude interval, the horizontal distance of the mth horizontal row, the longitude change value of the mth horizontal row, and the latitude change value, comprises: determining a number of grids in the mth horizontal row according to the horizontal distance of the mth horizontal row and the preset second grid precision; the number of grids in the mth horizontal row is N, the mth horizontal row comprises a first grid to an Nth grid from left to right, N is an integer greater than 1, n = 2, …, N; determining the left edge longitude and the right edge longitude of the first grid according to the longitude interval and the longitude change value of the mth horizontal row; determining the longitude and latitude coordinates of the vertex of the first grid according to the upper edge latitude and the lower edge latitude of the mth horizontal row, and the left edge longitude and the right edge longitude of the first grid; determining the left edge longitude and the right edge longitude of the nth grid according to the right edge longitude of the n-1th grid, and the longitude change value of the mth horizontal row; determining the longitude and latitude coordinates of the vertex of the nth grid according to the upper edge latitude and the lower edge latitude of the mth horizontal row, and the left edge longitude and the right edge longitude of the nth grid.
8. The method of claim 1, the step of determining the longitude and latitude coordinates of the vertex of each grid according to the latitude interval, the longitude interval, the latitude change value and the preset second grid precision, comprises: determining a horizontal distance of each horizontal row according to the latitude interval and the latitude change value, the horizontal distance being an actual distance between a left edge of a leftmost grid and a right edge of a rightmost grid in the corresponding horizontal row; determine the latitude change value according to the latitude interval and the latitude change value, and determine the longitude and latitude coordinates of the grid vertex in each row according to the latitude interval, the longitude interval, the latitude change value, and the longitude change value.
9. A device for determining a map grid, the device comprising: an acquisition module configured to acquire a latitude interval and a longitude interval of a rectangular drawing region, one side of the rectangular drawing region being parallel to the equator line; a processing module configured to determine a latitude change value according to a preset first grid precision, the latitude change value being a difference between upper and lower edge latitudes of a grid of any row to be drawn in the rectangular drawing region, and determine longitude and latitude coordinates of a vertex of each grid according to the latitude interval, the longitude interval, the latitude change value, and a preset second grid precision, the processing module being specifically configured to determine a longitudinal distance of the rectangular drawing region according to the latitude interval, the longitudinal distance being an actual distance between the upper and lower edges of the rectangular drawing region, determine a number of rows to be drawn in the rectangular drawing region according to the first grid precision and the longitudinal distance, and determine the latitude change value according to the latitude interval and the number of rows. the processing module being further specifically configured to, when the number of rows is M, the rectangular drawing region including a first row to an Mth row from south to north, M being an integer greater than 1, m = 2, …, M, determine the upper and lower edge latitudes of the first row and a horizontal distance of the first row according to the latitude interval and the latitude change value, the horizontal distance being an actual distance between a left edge of a leftmost grid and a right edge of a rightmost grid in the corresponding row, determine a longitude change value of adjacent grids in the first row according to the horizontal distance of the first row and the preset second grid precision, determine the longitude and latitude coordinates of the grid vertex in the first row according to the longitude change value of the first row and the latitude change value, determine the upper and lower edge latitudes of the mth row and a horizontal distance of the mth row according to the lower edge latitude of the (m-1)th row and the latitude change value, the horizontal distance being an actual distance between a left edge of a leftmost grid and a right edge of a rightmost grid in the corresponding row, determine a longitude change value of adjacent grids in the mth row according to the horizontal distance of the mth row and the preset second grid precision, and determine the longitude and latitude coordinates of the grid vertex in the mth row according to the longitude change value of the mth row and the latitude change value.
10. The device of claim 9, wherein the processing module is further configured to: acquire extreme points of longitude and latitude coordinates of a region to be drawn before acquiring the latitude interval and the longitude interval of the rectangular drawing region, and determine the latitude interval and the longitude interval of the rectangular drawing region according to the extreme points of longitude and latitude coordinates of the region to be drawn.
11. The device of any one of claims 9 or 10, wherein the processing module is specifically configured to: According to the first grid precision, a difference between an upper end latitude and a lower end latitude of the first grid precision on the same longitude is determined, and the difference is the latitude variation value.
12. The apparatus of claim 11, wherein the processing module is further configured to: Before determining the latitude and longitude coordinates of the vertex of each grid according to the latitude interval, the longitude interval, the latitude variation value, and a preset second grid precision, the processing module is configured to determine a vertical distance of a rectangular drawing area according to the latitude interval, the vertical distance being an actual distance between an upper edge and a lower edge of the rectangular drawing area; According to the first grid precision and the vertical distance, the processing module is configured to determine a number of horizontal rows to be drawn in the rectangular drawing area.
13. The apparatus of claim 9, wherein the processing module is specifically configured to: According to the lower edge latitude of the mth horizontal row and the latitude variation value, the processing module is configured to determine the upper edge latitude and the lower edge latitude of the mth horizontal row; According to the longitude interval and the lower edge latitude of the mth horizontal row, the processing module is configured to determine a horizontal distance of the mth horizontal row.
14. An electronic device comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
15. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-8.
16. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-8.
Citation Information
Patent Citations
Partitioning method of equal-area global discrete grids based on warp and weft
CN102938018A
Satellite remote sensing data processing method and related device
CN113012094A