Grid division method, grid division device, electronic device and storage medium

By dividing grids based on the grid size of irregular areas in the digital map, the problem of inaccurate division of irregular shape areas in the prior art is solved, and the precise division of irregular areas and the improvement of grid readability are achieved.

CN113963077BActive Publication Date: 2025-03-14CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010699188.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-20
Publication Date
2025-03-14
Estimated Expiration
2040-07-20

AI Technical Summary

Technical Problem

When prior art divides irregularly shaped geographical areas, the division results are inaccurate.

Method used

By obtaining irregular areas in the digital map and performing grid division based on the corresponding grid size of the area, the first set of grids is obtained. Then, the raster map is drawn based on the first raster set and the raster map is displayed.

Benefits of technology

The precise division of irregular shape areas is achieved, and the readability of the grid is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113963077B_ABST
    Figure CN113963077B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a grid division method, a grid division device, an electronic device and a storage medium. The grid division method includes: obtaining a first area in a digital map; based on a grid size corresponding to the first area, performing grid division on the first area to obtain a first grid set; drawing a grid map based on the first grid set, and displaying the grid map; in this way, accurate division of irregularly shaped areas is achieved, thereby improving grid readability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a grid division method, a grid division device, an electronic device and a storage medium. Background Art

[0002] In various current geographic information systems (GIS), the related technology roughly abstracts irregular geographical areas into rectangular boundaries, and the abstracted rectangular boundaries are still irregular regional ranges. At present, in the process of raster division of the irregular regional range, the division is based on a fixed grid size. This method at least has the problem of inaccurate division results for the division of irregular geographical areas. Summary of the invention

[0003] The embodiments of the present application are intended to provide a grid division method, a grid division device, an electronic device and a storage medium to solve at least the problem in the related art that the division results obtained for the division of irregularly shaped geographical areas are inaccurate.

[0004] The technical solution of this application is implemented as follows:

[0005] The present application provides a grid partitioning method, the method comprising:

[0006] obtaining a first region in a digital map;

[0007] Based on a grid size corresponding to the first area, the first area is divided into grids to obtain a first grid set;

[0008] A grid map is drawn based on the first grid set, and the grid map is displayed.

[0009] Optionally, obtaining the first area in the digital map includes:

[0010] Obtaining a second area in the digital map;

[0011] A minimum bounding rectangle of the second area is determined as the first area.

[0012] Optionally, the grid-dividing the first area based on the grid size corresponding to the first area to obtain a first grid set includes:

[0013] Based on the grid size, the first area is divided into grids to obtain a second grid set;

[0014] Obtaining boundary coordinates of the second area;

[0015] Based on the boundary coordinates, screening out a plurality of target grids from the second grid set;

[0016] The first grid set is constructed based on the multiple target grids.

[0017] Optionally, at least one vertex coordinate of the target grid is located within the second area enclosed by the boundary coordinates.

[0018] Optionally, drawing a grid map based on the first grid set includes:

[0019] Generate the underlying canvas;

[0020] Based on the first grid set, the grid map is drawn on the underlying canvas.

[0021] Optionally, drawing the grid map on the underlying canvas based on the first grid set includes:

[0022] Obtaining grid configuration parameters associated with the first grid set;

[0023] Based on the configuration parameters and the first grid set, a scalable vector grid map is generated; the grid map is the scalable vector grid map;

[0024] The scalable vector grid map is drawn on the underlying canvas.

[0025] Optionally, generating a scalable vector grid map based on the configuration parameters and the first grid set includes:

[0026] Determine each target configuration parameter corresponding to each grid subset in the first grid set having different grid attribute information; the grid configuration parameters include the target configuration parameters, and the target configuration parameters corresponding to the grids having different grid attribute information are different;

[0027] The scalable vector grid map is generated based on each grid subset and each target configuration parameter.

[0028] The present application provides a grid division device, the grid division device comprising:

[0029] A first obtaining unit, used for obtaining a first area in the digital map;

[0030] A first processing unit, configured to divide the first area into grids based on a grid size corresponding to the first area, to obtain a first grid set;

[0031] The second processing unit is used to draw a grid map based on the first grid set and display the grid map.

[0032] An embodiment of the present application provides an electronic device, the electronic device comprising:

[0033] A memory for storing executable instructions;

[0034] The processor is used to execute the executable instructions stored in the memory to implement the grid division method described above.

[0035] An embodiment of the present application provides a storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the grid division method described above.

[0036] A grid division method, a grid division device, an electronic device and a storage medium provided in an embodiment of the present application obtain a first area in a digital map; based on the grid size corresponding to the first area, the first area is grid-divided to obtain a first grid set; based on the first grid set, a grid map is drawn and the grid map is displayed; that is, the electronic device divides the first area into grids based on the grid size corresponding to the first area in the acquired data map, and displays the divided grid map; in this way, accurate division of irregularly shaped areas is achieved, thereby improving the readability of the grid. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of a flow chart of a grid division method provided in an embodiment of the present application;

[0038] Figure 2 A schematic diagram of a flow chart of another grid division method provided in an embodiment of the present application;

[0039] Figure 3 A schematic diagram of a grid division result of a grid division method provided in an embodiment of the present application;

[0040] Figure 4 A schematic diagram of the division results of another grid division method provided in an embodiment of the present application;

[0041] Figure 5 A schematic diagram of a division result of another grid division method provided in an embodiment of the present application;

[0042] Figure 6 A schematic diagram of a flow chart of another grid division method provided in an embodiment of the present application;

[0043] Figure 7 A schematic diagram of the structure of a grid division device provided in an embodiment of the present application;

[0044] Figure 8A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0046] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0047] The present application embodiment provides a grid division method applied to electronic equipment, referring to Figure 1 As shown, the method comprises the following steps:

[0048] Step 101: Obtain a first area in a digital map.

[0049] The first area has area attribute information.

[0050] In the embodiment of the present application, the first area can be understood as the smallest circumscribed rectangle that includes a certain range of areas in the geographical area.

[0051] Here, the first region has regional attribute information, and the first region is different, and the regional attributes of the first region are different. Exemplarily, according to the administrative division and management system, China's regions are basically divided into countries, provinces (municipalities directly under the central government, autonomous regions, special administrative regions), prefecture-level cities (states, banners), counties (districts, county-level cities), and townships (towns, streets); if the first region is a national-level region, the regional attribute information is the attribute information corresponding to the national-level region; if the first region is a provincial-level region, the regional attribute information is the attribute information corresponding to the provincial-level region; if the first region is a prefecture-level city-level region, the regional attribute information is the attribute information corresponding to the prefecture-level city-level region; if the first region is a county-level region, the regional attribute information is the attribute information corresponding to the county-level region. Here, this application does not make a specific description.

[0052] In the embodiment of the present application, the electronic device obtains the minimum bounding rectangle having area attribute information in the digital map, that is, the first area.

[0053] In the embodiment of the present application, after the electronic device obtains the first area in the digital map, it can also obtain the grid size corresponding to the area attribute information, and use the grid size corresponding to the area attribute information as the grid size corresponding to the first area.

[0054] The grid can be understood as a fine map statistical unit under the first area, and the grid size refers to the size of the grid.

[0055] Here, the electronic device obtains the grid size corresponding to the regional attribute information of the first area, and the grid size can be a*a, where a is the length of the grid. Exemplarily, if the regional attribute information is the attribute information corresponding to the national level area, the grid size can be a*a, where a is the grid length of 20 kilometers; if the regional attribute information is the attribute information corresponding to the provincial level area, the grid size can be a*a, where a is the grid length of 15 kilometers; if the regional attribute information is the attribute information corresponding to the county level area, the grid size can be a*a, where a is the grid length of 1 kilometer; if the regional attribute information is the attribute information corresponding to the cell level area, the grid size can be a*a, where a can be the grid length of 1 kilometer, and a can also be the grid length of 500 meters; it should be noted that different first areas have different regional attribute information, and different regional attribute information can correspond to the same grid size, and different regional attribute information can also correspond to different grid sizes. This application does not make specific restrictions, so as to realize the normalized grid data storage of the first area and effectively fit the administrative boundary.

[0056] In the embodiment of the present application, after obtaining the first area having area attribute information in the digital map, the electronic device obtains a grid size corresponding to the area attribute information of the first area.

[0057] Step 102: Based on the grid size corresponding to the first area, the first area is divided into grids to obtain a first grid set.

[0058] In the embodiment of the present application, the first grid set can be understood as a grid set in which all vertices and some vertices of the grids fall on the first area after the first area is divided into grids.

[0059] In the embodiment of the present application, the electronic device divides the first area into grids based on the boundary information and the grid size to obtain a first grid set.

[0060] In practical applications, after obtaining the grid size, the electronic device uses the size of a single grid as the segmentation step, and traverses the longitude and latitude directions of the first area in a loop to obtain the divided first area, that is, the first grid set.

[0061] Step 103: Draw a grid map based on the first grid set, and display the grid map.

[0062] In the embodiment of the present application, the grid map can be understood as a grid data map that is consistent with the topographic map in content, accuracy and color after each grid image is color processed.

[0063] In an embodiment of the present application, after obtaining the first grid set, the electronic device renders each grid graphic in the first grid set to obtain a rendered first grid set, draws a grid map based on the rendered first grid set, and displays the drawn grid map through a display module on the electronic device.

[0064] A grid division method provided in an embodiment of the present application obtains a first area in a digital map; based on a grid size corresponding to the first area, the first area is grid-divided to obtain a first grid set; a grid map is drawn based on the first grid set, and the grid map is displayed; that is, the electronic device divides the first area into grids based on the grid size corresponding to the first area in the acquired data map, and displays the divided grid map; in this way, accurate division of irregularly shaped areas is achieved, thereby improving the readability of the grid.

[0065] The present application embodiment provides a grid division method applied to electronic equipment, referring to Figure 2 As shown, the method comprises the following steps:

[0066] Step 201: Obtain a second area in the digital map.

[0067] In the embodiment of the present application, the second area can be understood as a region including a certain range in a geographical area.

[0068] Here, the second region has regional attribute information, and the second region is different, and the regional attributes of the second region are different. Exemplarily, according to the administrative division and management system, China's regions are basically divided into countries, provinces (municipalities directly under the central government, autonomous regions, special administrative regions), prefecture-level cities (states, banners), counties (districts, county-level cities), and townships (towns, streets); if the second region is a national-level region, the regional attribute information is the attribute information corresponding to the national-level region; if the second region is a provincial-level region, the regional attribute information is the attribute information corresponding to the provincial-level region; if the second region is a prefecture-level city-level region, the regional attribute information is the attribute information corresponding to the prefecture-level city-level region; if the second region is a county-level region, the regional attribute information is the attribute information corresponding to the county-level region. Here, this application does not make a specific description.

[0069] In an embodiment of the present application, the electronic device can obtain the second area with regional attribute information using a GIS map, wherein the GIS map can be an Amap, a Baidu map, or a Google map, which is not specifically limited in the present application.

[0070] In actual applications, for example, the electronic device uses Amap to obtain an administrative area such as Beijing, and obtains regional attribute information corresponding to the level of the area where Beijing is located.

[0071] Step 202: Determine the minimum bounding rectangle of the second area as the first area.

[0072] In the embodiment of the present application, the minimum circumscribed rectangle may be understood as the minimum rectangle including the second area.

[0073] As an optional embodiment, after acquiring the second area, the electronic device determines the maximum and minimum points of the second area in the longitude direction, as well as the maximum and minimum points in the latitude direction, and determines that the minimum enclosing rectangle of the second area is the first area based on the maximum and minimum points in the longitude direction, as well as the maximum and minimum points in the latitude direction.

[0074] As another optional embodiment, the electronic device obtains the position coordinates corresponding to each boundary point in the boundary of the second area, the position coordinates including longitude and latitude, and forms a position coordinate list based on the geographical location coordinates corresponding to each boundary point; obtains the maximum longitude, maximum latitude, minimum longitude and minimum latitude in the position coordinate list; based on the maximum longitude, maximum latitude, minimum longitude and minimum latitude, determines that the minimum enclosing rectangle of the second area is the first area.

[0075] Step 203: divide the first area into grids based on the grid size corresponding to the first area to obtain a second grid set.

[0076] In the embodiment of the present application, the second grid set can be understood as a grid set for performing grid division on the minimum circumscribed rectangle.

[0077] In the embodiment of the present application, after obtaining the minimum circumscribed rectangle, the electronic device divides the minimum circumscribed rectangle into grids based on the grid size corresponding to the first area to obtain a second grid set.

[0078] Step 204: Obtain boundary coordinates of the second area.

[0079] In the embodiment of the present application, the electronic device can obtain the boundary coordinates corresponding to each boundary point in the boundary of the second area through the GIS map, and the boundary coordinates include longitude and latitude.

[0080] Step 205: Filter out a plurality of target grids from the second grid set based on the boundary coordinates.

[0081] In the embodiment of the present application, the target grid can be understood as a grid in which the vertex coordinates in the grid are located within the second area surrounded by the boundary coordinates.

[0082] In actual applications, since the minimum circumscribed rectangle includes the second area, the electronic device divides the minimum circumscribed rectangle into grids based on the grid size, and part of the divided grids falls in the outer area of ​​the second area, and part falls in the inner area of ​​the second area; therefore, it is necessary to filter out multiple target grids that fall in the inner area of ​​the second area from the second grid set based on the boundary coordinates of the second area, that is, to filter out multiple target grids that are within the second area surrounded by the boundary coordinates from the second grid set.

[0083] In other embodiments of the present application, at least one vertex coordinate of the target grid is located within the second area surrounded by the boundary coordinates.

[0084] Here, the electronic device selects, based on the boundary coordinates of the second area, a plurality of target grids from the second grid set, the plurality of target grids having at least one vertex coordinate located within the second area surrounded by the boundary coordinates.

[0085] Step 206: construct a first grid set based on the multiple target grids.

[0086] In the embodiment of the present application, after obtaining a plurality of target grids in the first area, the electronic device constructs a first grid set based on the plurality of target grids.

[0087] In practical applications, refer to Figure 3 As shown, Figure 3 What is shown is that the electronic device selects multiple target grids in the first area from the second grid set based on the boundary coordinates of the first area, such as Beijing, and constructs a first grid set based on the multiple target grids in the first area. Here, the first grid set includes grids whose at least one vertex coordinate is located in the second area surrounded by the black boundary line 31. Exemplarily, the first grid set includes 1414 grids corresponding to the dotted lines.

[0088] Step 207: Draw a grid map based on the first grid set, and display the grid map.

[0089] In the embodiment of the present application, step 207 draws a grid map based on the first grid set, which can be implemented by the following steps:

[0090] Step 207a: Generate the bottom canvas.

[0091] In the embodiment of the present application, the bottom canvas can be understood as a drawable area with drawing function in the digital map.

[0092] In practical applications, electronic devices can create canvas elements and use them to generate digital maps, such as the underlying canvas on a GIS map. The Canvas element is a new element in HyperText Markup Language (HTML) that is used to generate a graphic container (canvas) to draw and render graphics in the canvas.

[0093] In the embodiment of the present application, after acquiring the first area of ​​the digital map, the electronic device can generate the bottom canvas based on the first area; the electronic device can also generate the bottom canvas based on the entire digital map. In this implementation, since the electronic device acquires vector data with a certain area, that is, the width and height data of the area, it is not necessary to acquire the relevant parameters of the raster, and the massive data in the GIS map is quickly rendered, thereby improving the processing efficiency of the electronic device.

[0094] Step 207b: Obtain grid configuration parameters associated with the first grid set.

[0095] In the embodiment of the present application, the grid configuration parameters can be understood as the characteristic information of the grid, and the grid configuration parameters can include the shape of the grid, the color of the grid filling, the pattern filled inside the grid, and the transparency of the grid filling. For example, the shape of the grid can be a quadrilateral, a pentagon, or other polygons; the color of the grid filling can be none, red, blue, or yellow, etc.; the pattern filled inside the grid can be none, a dot, a slash, or a cross, etc.; the grid filling transparency is 30%, etc.

[0096] Step 207c: Generate a scalable vector grid map based on the configuration parameters and the first grid set.

[0097] Raster maps are scalable vector raster maps.

[0098] In the embodiment of the present application, the scalable vector grid map can be understood as a map with an arbitrary zoom function.

[0099] Specifically, when the scalable vector raster map is arbitrarily scaled, the clarity of the raster graphics will not be affected, so as to ensure that the drawn raster graphics can adapt to the first area requirements with different area attributes in the digital map.

[0100] In the embodiment of the present application, after the electronic device obtains the grid configuration parameters and the first grid set, it dynamically generates a grid scalable vector (SVG) graphic based on the grid configuration parameters and the first grid set, and converts the format of the generated SVG raster graphic using base64 encoding to obtain the encoded graphic, and transmits the encoded graphic in the form of a binary code stream. In this way, there is no need to store the image locally in the form of an address or load it in the form of an address, which improves the transmission rate of the image and greatly improves the user experience. Moreover, the electronic device transmits the image in the form of a binary code stream, and the image will not appear on the page, but will only be displayed after the program is run, which indirectly realizes the protection of the image.

[0101] In the embodiment of the present application, step 207c generates a scalable vector grid map based on the configuration parameters and the first grid set, which can also be implemented by the following steps:

[0102] Step S1: Determine each target configuration parameter corresponding to each grid subset in a first grid set having grid subsets with different grid attribute information.

[0103] The grid configuration parameters include target configuration parameters, and grids with different grid attribute information have different corresponding target configuration parameters.

[0104] In the embodiment of the present application, the grid attribute information can be understood as the attribute information with data characteristics in the grid. The grid attribute information includes data information such as total flow, traffic volume, total number of users, wireless utilization rate or control channel element (CCE) occupancy rate in the physical downlink control channel (PDCCH). The target configuration parameters can be understood as the parameters of the grid graphics configuration of the electronic device in each grid subset.

[0105] In the embodiment of the present application, the electronic device determines each target configuration parameter corresponding to each grid subset in the first grid set having different grid attribute information; the grids having different grid attribute information correspond to different target configuration parameters.

[0106] In actual applications, the electronic device obtains data information included in the grid attribute information in the first grid set in real time, compares each acquired data information with a preset threshold of the data information corresponding to the electronic device, and obtains a grid subset corresponding to each data information in the first grid set; and the electronic device obtains each target configuration parameter corresponding to each grid subset. It should be noted that the target configuration parameters corresponding to grids with different grid attribute information are also different.

[0107] Step S2: Generate a scalable vector grid map based on each grid subset and each target configuration parameter.

[0108] In the embodiment of the present application, the electronic device dynamically generates a scalable vector grid graphic corresponding to each grid subset and each target configuration parameter based on each grid subset and each target configuration parameter.

[0109] In practical applications, reference Figure 4 As shown, the first grid set includes grids whose at least one vertex coordinate is located in the second area surrounded by the black boundary line 41; the electronic device obtains the grids with data information in the first grid set in real time, such as traffic data, and compares the traffic data information obtained in real time with the preset threshold of the corresponding traffic data in the electronic device to obtain the first grid subset corresponding to the traffic data above the preset traffic threshold and the second grid subset corresponding to the traffic data below the preset traffic threshold. Here, the grids in the first grid subset are grids indicated by the black filled rectangle 42, and the grids in the second grid subset are grids indicated by the oblique line filled rectangle 43. The first target configuration parameter corresponding to the first grid subset is obtained, such as the target configuration parameter that the shape filled inside the grid is multiple oblique lines; the second target configuration parameter corresponding to the second grid subset is obtained, such as the target configuration parameter that the shape filled inside the grid is a single oblique line. Based on the first grid subset, the second grid subset, the first target configuration parameter and the second target configuration parameter, a scalable vector grid map is generated.

[0110] In other embodiments of the present application, after obtaining each grid subset, the electronic device can also obtain grid attribute information of a single grid contained in each grid subset, that is, data information and region attribute information. By zooming in and out on a single grid, the grid division method and data information display method of the grid in different levels of regions can be obtained. Figure 5 As shown, Figure 5 What is displayed is the display mode of data information in the smaller level area based on the grid division mode corresponding to the regional attribute information. For example, each building is presented in a cube display mode. Figure 5 The names of the buildings corresponding to some cubes are marked, such as Office Building 1.

[0111] Step 207d: Draw a scalable vector grid map on the bottom canvas.

[0112] In an embodiment of the present application, the electronic device draws a scalable vector grid map on an underlying canvas.

[0113] Specifically, the electronic device uses methods in the Canvas element, such as the drawImage() method, to access the SVG raster graphics into the underlying canvas.

[0114] It can be seen from the above scheme that the electronic device adopts the method of integrating HTML Canvas into SVG graphics to improve the richness of the pattern; and adopts the method of storing separately according to the zoom level to improve the readability.

[0115] By integrating HTML Canvas with SVG images, the ability of HTML Canvas to quickly render massive amounts of data is utilized to generate the underlying canvas of the raster in the digital map. SVG raster graphics are dynamically generated through raster configuration parameters to achieve ready-to-use rendering of SVG raster graphics, taking into account both the rendering speed of raster graphics and the style of SVG raster graphics, thus improving the readability of raster data.

[0116] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0117] The present application embodiment provides a grid division method applied to electronic equipment, referring to Figure 6 As shown, the method comprises the following steps:

[0118] Step 301: Determine boundary information of the geographic location.

[0119] In the embodiment of the present application, the geographical location boundary is the boundary information of the second area. The geographical location boundary can be understood as an irregular closed loop area.

[0120] In practical applications, electronic devices use GIS maps (such as Amap, Baidu Map, and Map, etc.) to obtain irregular boundary information of an administrative area. Since some administrative areas (such as Beijing) include irregular closed-loop areas, electronic devices can use a two-dimensional array to store the geographic location coordinates of each boundary contained in the irregular geographic location.

[0121] Step 302: Obtain the longitude and latitude point list data of the closed-loop area boundary of the geographic location.

[0122] In the embodiment of the present application, the closed-loop area of ​​the geographical location is an irregular polygon, and the list data can be understood as the data of the longitude and latitude points corresponding to each boundary point in the closed-loop area boundary.

[0123] Step 303: Based on the longitude and latitude point list data of the closed-loop area boundary, obtain the minimum circumscribed rectangle containing the closed-loop area.

[0124] In an embodiment of the present application, the electronic device obtains the maximum longitude, minimum longitude, maximum latitude and minimum latitude in the longitude and latitude point list data of the closed-loop area boundary, obtains the minimum circumscribed rectangle corresponding to the closed-loop area, and obtains the vertex coordinates of the minimum circumscribed rectangle.

[0125] Step 304: Determine the longitude and latitude lengths of a single grid.

[0126] In an embodiment of the present application, the longitude length and latitude length of a single grid can be set to a fixed grid, and the longitude length and latitude length of a single grid can also be determined in the following manner: determine the total number of grids divided by the minimum circumscribed rectangle in the longitude and latitude directions, and determine the longitude length and latitude length of the single grid based on the total number of divided grids.

[0127] Step 305: Based on the longitude and latitude lengths of a single grid, the minimum circumscribed rectangle is divided into grids to obtain a grid position list.

[0128] In an embodiment of the present application, the electronic device uses the longitude and latitude lengths of a single grid as the segmentation step, loops through the longitude and latitude directions of the minimum circumscribed rectangle, and finally cuts to obtain a list of grid positions within the minimum circumscribed rectangle area.

[0129] In an embodiment of the present application, the grid position can be represented by the position coordinates of any vertex on the grid, such as the position coordinates of the upper left vertex, the position coordinates of the lower left vertex, the position coordinates of the upper right vertex, and the position coordinates of the lower right vertex; the grid position can also be represented by the position coordinates of the center point of the area where the grid is located, which is not specifically limited in the embodiment of the present application.

[0130] In an embodiment of the present application, the electronic device divides the minimum enclosing rectangle into grids based on the longitude and latitude lengths of a single grid, obtains each grid position, summarizes each grid position, and finally obtains a list of grid positions within the minimum enclosing rectangle.

[0131] Step 306: Based on the grid position list, filter out a grid list whose grid vertices fall within the closed loop area.

[0132] In the embodiment of the present application, the electronic device loops through the grid position list and selects the longitude and latitude point list data in which at least one vertex in the grid falls on the boundary of the irregular closed loop area. Figure 3 As shown in the figure, a grid figure in which at least one vertex falls within a closed loop area is shown.

[0133] Step 307: Generate a grid canvas of the geographically irregular area using HTML Canvas.

[0134] In the embodiment of the present application, HTML Canvas has the characteristic of rapid rendering of massive data, and the electronic device uses HTML Canvas as a grid canvas covering the irregular area of ​​the geographical location obtained by GIS.

[0135] Step 308: Obtain grid configuration parameters, generate SVG grid graphics based on the grid configuration parameters, process the generated SVG grid graphics into base64 encoding, and connect the SVG raster graphics to the grid canvas.

[0136] In the embodiment of the present application, the grid configuration parameters include the shape of the grid, the color of the grid filling, the pattern filled inside the grid, and the transparency of the grid filling.

[0137] In an embodiment of the present application, the electronic device can dynamically change the color and style of the SVG raster graphics by using grid configuration parameters; and use base64 encoding to process the SVG raster graphics into a binary code stream for transmission. In this way, there is no need to store the SVG raster graphics in the form of pictures in the electronic device, which saves storage space of the electronic device and improves the processing efficiency of the electronic device.

[0138] The present application embodiment can be implemented by the following code:

[0139] const createSvgGrid=(fillColor,Shape)=>{};

[0140] const serializer=new XMLSerializer();

[0141] const svgStr=serializer.serializeToString(svg);

[0142] const svgSrc=`data:image / svg+xml;base64,${window.btoa(svgStr)}`;

[0143] const img = new Image();

[0144] img.src = svgSrc;

[0145] ctx.drawImage(img);

[0146] In other embodiments of the present application, the electronic device obtains user indicator data within a geographic area, the user indicator data including at least one of total traffic, traffic volume, total number of users, wireless utilization rate, and PDCCH channel CCE occupancy rate; based on the current time and the user indicator data, a preset threshold value of the user indicator data is set; based on the user indicator data, the preset threshold value and the grid configuration parameter, an SVG grid graphic is generated, the generated SVG grid graphic is processed into a base64 code, the SVG grid graphic is connected to the grid canvas, and a reference is made to the Figure 4 and Figure 5 As shown, Figure 4 and Figure 5 What is presented is the display mode of data information in regions of different levels based on the grid division mode corresponding to the regional attribute information.

[0147] From the above, it can be seen that the above-mentioned grid division method accurately divides the grid units for irregular administrative boundaries, realizes the division of normalized grid data of real administrative regions, effectively fits the administrative boundaries, avoids judging and calculating the grid data outside the boundary area when summarizing the grid indicator data, and effectively improves the efficiency of grid indicator summary. At the same time, HTML Canvas is integrated with SVG images, and the raster graphics are rendered immediately by adjusting the color, shape and other parameters of the SVG raster graphics, taking into account the rendering speed and style of the SVG raster graphics.

[0148] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0149] Based on the above embodiments, the present invention provides a grid division device, which can be applied to Figure 1 , 2 In a grid division method provided in a corresponding embodiment, referring to Figure 7 As shown, the grid division device 7 comprises:

[0150] A first obtaining unit 71, configured to obtain a first area in a digital map;

[0151] A first processing unit 72 is used to divide the first area into grids based on a grid size corresponding to the first area to obtain a first grid set;

[0152] The second processing unit 73 is used to draw a grid map based on the first grid set and display the grid map.

[0153] In other embodiments of the present application, the first obtaining unit 71 is further configured to obtain a second area in the digital map; and determine the minimum circumscribed rectangle of the second area as the first area.

[0154] In other embodiments of the present application, the first processing unit 72 is also used to divide the first area into grids based on the grid size to obtain a second grid set; obtain the boundary coordinates of the second area; based on the boundary coordinates, filter out multiple target grids from the second grid set; and construct the first grid set based on the multiple target grids.

[0155] In other embodiments of the present application, at least one vertex coordinate of the target grid is located within the second area surrounded by the boundary coordinates.

[0156] In other embodiments of the present application, the second processing unit 73 is further configured to generate an underlying canvas; and draw a grid map on the underlying canvas based on the first grid set.

[0157] In other embodiments of the present application, the second processing unit 73 is also used to obtain grid configuration parameters; generate a scalable vector grid map based on the configuration parameters and the first grid set; the grid map is a scalable vector grid map; and draw the scalable vector grid map on the underlying canvas.

[0158] In other embodiments of the present application, the second processing unit 73 is also used to determine each target configuration parameter corresponding to each raster subset in the first raster set with different raster attribute information; the raster configuration parameters include target configuration parameters, and the target configuration parameters corresponding to the rasters with different raster attribute information are different; based on each raster subset and each target configuration parameter, a scalable vector raster map is generated.

[0159] Based on the above embodiments, the present application provides an electronic device which can be applied to Figure 1 , 2 In a grid division method provided in a corresponding embodiment, referring to Figure 8 As shown, the electronic device 8 ( Figure 8 Electronic devices 8 in the Figure 7 The grid division device 7) includes: a memory 81 and a processor 82, wherein the processor 82 is used to execute the grid division program stored in the memory 81, and the electronic device implements the following steps through the processor 82:

[0160] obtaining a first region in a digital map;

[0161] Based on the grid size corresponding to the first area, the first area is grid-divided to obtain a first grid set;

[0162] Draw a raster map based on the first raster set and display the raster map.

[0163] In other embodiments of the present application, the processor 82 is used to obtain a second area in the digital map; and determine that the minimum circumscribed rectangle of the second area is the first area.

[0164] In other embodiments of the present application, the processor 82 is used to divide the first area into grids based on the grid size to obtain a second grid set; obtain the boundary coordinates of the second area; based on the boundary coordinates, filter out multiple target grids from the second grid set; and construct a first grid set based on the multiple target grids.

[0165] In other embodiments of the present application, at least one vertex coordinate of the target grid is located within the second area surrounded by the boundary coordinates.

[0166] In other embodiments of the present application, the processor 82 is used to generate an underlying canvas; and draw a grid map on the underlying canvas based on the first grid set.

[0167] In other embodiments of the present application, the processor 82 is used to obtain grid configuration parameters; generate a scalable vector grid map based on the configuration parameters and the first grid set; the grid map is a scalable vector grid map; and draw the scalable vector grid map on the underlying canvas.

[0168] In other embodiments of the present application, the processor 82 is used to determine each target configuration parameter corresponding to each raster subset in the first raster set with different raster attribute information; the raster configuration parameters include target configuration parameters, and the target configuration parameters corresponding to the rasters with different raster attribute information are different; based on each raster subset and each target configuration parameter, a scalable vector raster map is generated.

[0169] Based on the foregoing embodiments, an embodiment of the present invention provides a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps:

[0170] obtaining a first region in a digital map;

[0171] Based on the grid size corresponding to the first area, the first area is divided into grids to obtain a first grid set;

[0172] Draw a raster map based on the first raster set and display the raster map.

[0173] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:

[0174] obtaining a second area in the digital map;

[0175] A minimum bounding rectangle of the second area is determined as the first area.

[0176] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:

[0177] Based on the grid size, the first area is divided into grids to obtain a second grid set;

[0178] Obtaining the boundary coordinates of the second region;

[0179] Based on the boundary coordinates, a plurality of target grids are selected from the second grid set;

[0180] Construct a first raster set based on multiple target rasters.

[0181] In other embodiments of the present invention, at least one vertex coordinate of the target grid is located within the second area surrounded by the boundary coordinates.

[0182] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:

[0183] Generate the underlying canvas;

[0184] Draws a raster map on the underlying canvas based on the first raster collection.

[0185] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:

[0186] Get grid configuration parameters;

[0187] Generate a scalable vector raster map based on the configuration parameters and the first raster set; the raster map is a scalable vector raster map;

[0188] Draws a scalable vector raster map on the underlying canvas.

[0189] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:

[0190] Determine each target configuration parameter corresponding to each grid subset in the first grid set having different grid attribute information; the grid configuration parameters include target configuration parameters, and the target configuration parameters corresponding to the grids having different grid attribute information are different;

[0191] Based on each grid subset and each target configuration parameter, a scalable vector grid map is generated.

[0192] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0193] It should be noted that the above-mentioned storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0194] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0195] The units described above 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 distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0196] In addition, all functional units in the embodiments of the present application can be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), disks or optical disks, and other media that can store program codes.

[0197] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0198] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0199] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0200] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A grid partitioning method, characterized in that: The method comprises: obtaining a first region in a digital map; Based on a grid size corresponding to the first area, the first area is divided into grids to obtain a first grid set; the grid size corresponds to the attribute information of the first area; A grid map is drawn based on the first grid set, and the grid map is displayed.

2. The grid division method according to claim 1, characterized in that: The step of obtaining the first area in the digital map comprises: Obtaining a second area in the digital map; A minimum bounding rectangle of the second area is determined as the first area.

3. The grid division method according to claim 2, characterized in that: The step of dividing the first area into grids based on the grid size corresponding to the first area to obtain a first grid set includes: Based on the grid size, the first area is divided into grids to obtain a second grid set; Obtaining boundary coordinates of the second area; Based on the boundary coordinates, screening out a plurality of target grids from the second grid set; The first grid set is constructed based on the multiple target grids.

4. The grid division method according to claim 3, characterized in that: At least one vertex coordinate of the target grid is located within the second area surrounded by the boundary coordinates.

5. The grid division method according to any one of claims 1 to 4, characterized in that: Drawing a grid map based on the first grid set includes: Generate the underlying canvas; Based on the first grid set, the grid map is drawn on the underlying canvas.

6. The grid division method according to claim 5, characterized in that: Drawing the grid map on the bottom canvas based on the first grid set includes: Obtaining grid configuration parameters associated with the first grid set; Based on the configuration parameters and the first grid set, a scalable vector grid map is generated; the grid map is the scalable vector grid map; The scalable vector grid map is drawn on the underlying canvas.

7. The grid division method according to claim 6, characterized in that: The generating a scalable vector grid map based on the configuration parameters and the first grid set comprises: Determine each target configuration parameter corresponding to each grid subset in the first grid set having different grid attribute information; the grid configuration parameters include the target configuration parameters, and the target configuration parameters corresponding to the grids having different grid attribute information are different; The scalable vector grid map is generated based on each grid subset and each target configuration parameter.

8. A grid division device, characterized in that: The grid division device comprises: A first obtaining unit, used for obtaining a first area in the digital map; A first processing unit, configured to divide the first area into grids based on a grid size corresponding to the first area to obtain a first grid set; the grid size corresponds to the attribute information of the first area; The second processing unit is used to draw a grid map based on the first grid set and display the grid map.

9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; A processor is used to execute the executable instructions stored in the memory to implement the grid division method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the grid division method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Geographical information image generation method and apparatus

    CN108182717A

  • Method and system for generating PowerPoint, computing device and storage medium

    CN110765284A

  • Method and device for obtaining full-map POI information

    CN111309844A