CN113963077A - Grid division method, grid division device, electronic apparatus, and storage medium - Google Patents

Grid division method, grid division device, electronic apparatus, and storage medium Download PDF

Info

Publication number
CN113963077A
CN113963077A CN202010699188.9A CN202010699188A CN113963077A CN 113963077 A CN113963077 A CN 113963077A CN 202010699188 A CN202010699188 A CN 202010699188A CN 113963077 A CN113963077 A CN 113963077A
Authority
CN
China
Prior art keywords
grid
area
map
region
division
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010699188.9A
Other languages
Chinese (zh)
Inventor
路霞
李杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010699188.9A priority Critical patent/CN113963077A/en
Publication of CN113963077A publication Critical patent/CN113963077A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/56Information retrieval; Database structures therefor; File system structures therefor of still image data having vectorial format
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application discloses a grid division method, a grid division device, electronic equipment and a storage medium, wherein the grid division method comprises the following steps: obtaining a first area in a digital map; performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set; drawing a grid map based on the first grid set, and displaying the grid map; therefore, the accurate division of the irregular-shaped area is realized, and the grid readability is further improved.

Description

Grid division method, grid division device, electronic apparatus, and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a grid division method, a grid division apparatus, an electronic device, and a storage medium.
Background
In the current Geographic Information Systems (GIS), irregular Geographic areas are roughly abstracted into rectangular boundaries in the related art, and the abstracted rectangular boundaries are still irregular area ranges. Currently, in the process of grid-dividing the irregular area range, the area is divided based on a fixed grid size. The method at least has the problem that the division result obtained by dividing the irregular-shaped geographic area is inaccurate.
Disclosure of Invention
Embodiments of the present application are intended to provide a grid partitioning method, a grid partitioning apparatus, an electronic device, and a storage medium, which solve the problem in the related art that at least a partitioning result obtained by partitioning an irregularly-shaped geographic area is inaccurate.
The technical scheme of the application is realized as follows:
the embodiment of the application provides a grid division method, which comprises the following steps:
obtaining a first area in a digital map;
performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set;
drawing a grid map based on the first grid set, and displaying the grid map.
Optionally, the obtaining a first area in the digital map includes:
obtaining a second region in the digital map;
and determining the minimum bounding rectangle of the second area as the first area.
Optionally, the performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set includes:
based on the grid size, performing grid division on the first area to obtain a second grid set;
obtaining boundary coordinates of the second area;
screening a plurality of target grids from the second grid set based on the boundary coordinates;
constructing the first grid set based on the plurality of target grids.
Optionally, at least one vertex coordinate of the target grid is located in the second area surrounded by the boundary coordinates.
Optionally, the drawing a grid map based on the first grid set includes:
generating a bottom layer canvas;
drawing the grid map on the underlying canvas based on the first grid set.
Optionally, the drawing the grid map on the underlying canvas based on the first grid set includes:
obtaining grid configuration parameters associated with the first grid set;
generating a scalable vector grid map based on the configuration parameters and the first grid set; the grid map is the scalable vector grid map;
drawing the scalable vector grid map on the underlying canvas.
Optionally, the generating a scalable vector grid map based on the configuration parameters and the first grid set includes:
determining each target configuration parameter corresponding to each grid subset in the grid subsets with different grid attribute information in the first grid set; the grid configuration parameters comprise the target configuration parameters, and the target configuration parameters corresponding to grids with different grid attribute information are different;
generating the scalable vector grid map based on the each grid subset and the each target configuration parameter.
The embodiment of the present application provides a grid division device, the grid division device includes:
a first obtaining unit configured to obtain a first area in a digital map;
the first processing unit is used for carrying out grid division on the first area based on the grid size corresponding to the first area to obtain a first grid set;
and the second processing unit is used for drawing a grid map based on the first grid set and displaying the grid map.
An embodiment of the present application provides an electronic device, which includes:
a memory for storing executable instructions;
and the processor is used for executing the executable instructions stored in the memory so as to realize the grid division method.
The present embodiment provides a storage medium, which stores one or more programs, where the one or more programs are executable by one or more processors to implement the grid partitioning method described above.
The embodiment of the application provides a grid dividing method, a grid dividing device, electronic equipment and a storage medium, and a first area in a digital map is obtained; performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set; drawing a grid map based on the first grid set, and displaying the grid map; that is, the electronic device performs grid division on the first area based on the grid size corresponding to the first area in the acquired data map, and displays the divided grid map; therefore, the accurate division of the irregular-shaped area is realized, and the readability of the grid is improved.
Drawings
Fig. 1 is a schematic flowchart of a grid division method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another grid division method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a partitioning result of a grid partitioning method according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a partitioning result of another grid partitioning method according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a partitioning result of another grid partitioning method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of another grid division method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a grid dividing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
It should be appreciated that reference throughout this specification to "an embodiment of the present application" or "an embodiment described previously" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in the embodiments of the present application" or "in the embodiments" in various places throughout this specification are not necessarily all referring to the same embodiments. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
An embodiment of the present application provides a grid division method, which is applied to an electronic device, and as shown in fig. 1, the method includes the following steps:
step 101, obtaining a first area in a digital map.
Wherein the first area has area attribute information.
In the embodiment of the present application, the first area may be understood as a minimum bounding rectangle on a geographic area including a certain range of regions.
Here, the first area has area attribute information, the first area is different, and the area attribute of the first area is different. Illustratively, according to the administrative region division and management system, the chinese region is basically divided into countries, provinces (direct prefectures, municipalities, ad hoc administrative districts), prefectures (states, flags), counties (districts, counties), towns (towns, streets); if the first region is a country-level region, the region attribute information is attribute information corresponding to the country-level region; if the first area is a provincial area, the area attribute information is attribute information corresponding to the provincial area; if the first area is a grade city level area, the area attribute information is attribute information corresponding to the grade city level area; if the first region is a region of the prefecture level, the region attribute information is attribute information corresponding to the region of the prefecture level. Here, the present application is not described in detail.
In the embodiment of the application, the electronic device acquires the minimum circumscribed rectangle with the area attribute information in the digital map, namely the first area.
In the embodiment of the application, after the electronic device obtains the first area in the digital map, the electronic device may further obtain a 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.
Wherein, 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.
Here, the electronic device obtains a grid size corresponding to the region attribute information of the first region, where the grid size may be a × a, and a is a length of the grid. For example, if the region attribute information is attribute information corresponding to a country-level region, the size of the grid may be a × a, where a is a grid length of 20 km; if the area attribute information is attribute information corresponding to the provincial level area, the size of the grid can be a x a, and at this time, a is the grid length of 15 kilometers; if the region attribute information is attribute information corresponding to a region of the county level, the size of the grid may be a × a, where a is a grid length of 1 km; if the area attribute information is attribute information corresponding to the area of the cell level, the size of the grid may be a × a, at this time, a may be a grid length of 1 km, and a may also be a grid length of 500 m; it should be noted that different first regions have different region attribute information, different region attribute information may correspond to the same grid size, and different region attribute information may also correspond to different grid sizes.
In the embodiment of the application, after obtaining a first area with area attribute information in a digital map, an electronic device obtains a grid size corresponding to the area attribute information of the first area.
And 102, performing grid division on the first area based on the grid size corresponding to the first area to obtain a first grid set.
In this embodiment, the first grid set may be understood as a grid set in which all vertices and part of vertices of a grid fall on the first area after the first area is subjected to grid division.
In the embodiment of the application, the electronic device performs grid division on the first area based on the boundary information and the grid size to obtain a first grid set.
In practical application, after obtaining the grid size, the electronic device uses the size of a single grid size as a segmentation step, and performs cyclic traversal on the longitude direction and the latitude direction of the first region to obtain a segmented first region, namely a first grid set.
And 103, drawing a grid map based on the first grid set, and displaying the grid map.
In the embodiment of the present application, the raster map may be understood as a raster data map formed by performing color processing on each raster map, wherein the raster data map is consistent with the terrain map in content, precision and color.
In the embodiment of the application, after obtaining the first grid set, the electronic device renders each grid graph in the first grid set to obtain the 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.
The grid division method provided by the embodiment of the application obtains a first area in a digital map; performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set; drawing a grid map based on the first grid set, and displaying the grid map; that is, the electronic device performs grid division on the first area based on the grid size corresponding to the first area in the acquired data map, and displays the divided grid map; therefore, the accurate division of the irregular-shaped area is realized, and the readability of the grid is improved.
An embodiment of the present application provides a grid division method, which is applied to an electronic device, and as shown in fig. 2, the method includes the following steps:
step 201, a second area in the digital map is obtained.
In the present embodiment, the second area may be understood as an area including a certain range on the geographical area.
Here, the second area has area attribute information, the second area is different, and the area attribute of the second area is different. Illustratively, according to the administrative region division and management system, the chinese region is basically divided into countries, provinces (direct prefectures, municipalities, ad hoc administrative districts), prefectures (states, flags), counties (districts, counties), towns (towns, streets); if the second area is a country-level area, the area attribute information is attribute information corresponding to the country-level area; if the second area is a provincial area, the area attribute information is attribute information corresponding to the provincial area; if the second area is a grade city level area, the area attribute information is attribute information corresponding to the grade city level area; if the second region is a region of the prefecture level, the region attribute information is attribute information corresponding to the region of the prefecture level. Here, the present application is not described in detail.
In the embodiment of the application, the electronic device may acquire the second area with the area attribute information by using the GIS map. The GIS map can be a Gade map and a Baidu map, and the GIS map can also be a Google map, which is not specifically limited in the application.
In practical applications, for example, the electronic device obtains an administrative area, such as an area in beijing city, by using the high-grade map, and obtains area attribute information corresponding to a level area in beijing city.
Step 202, determining the minimum bounding rectangle of the second area as the first area.
In the embodiment of the present application, the minimum bounding rectangle may be understood as a minimum rectangle including the second region.
In an optional embodiment, after acquiring the second area, the electronic device determines a maximum value point and a minimum value point of the second area in the longitude direction, and a maximum value point and a minimum value point in the latitude direction, and determines the minimum bounding rectangle of the second area as the first area based on the maximum value point and the minimum value point in the longitude direction, and the maximum value point and the minimum value point in the latitude direction.
In another optional embodiment, the electronic device obtains a position coordinate corresponding to each boundary point in the second area boundary, where the position coordinate includes longitude and latitude, and forms a position coordinate list based on a geographic position coordinate corresponding to each boundary point; acquiring the maximum longitude, the maximum latitude, the minimum longitude and the minimum latitude in a position coordinate list; and determining the minimum bounding rectangle of the second area as the first area based on the maximum longitude, the maximum latitude, the minimum longitude and the minimum latitude.
And 203, performing grid division on the first area based on the grid size corresponding to the first area to obtain a second grid set.
In the embodiment of the present application, the second grid set may be understood as a grid set that performs grid division on the minimum bounding rectangle.
In the embodiment of the application, after the electronic device obtains the minimum external rectangle, the minimum external rectangle is subjected to grid division based on the grid size corresponding to the first region, so that a second grid set is obtained.
And step 204, obtaining the boundary coordinates of the second area.
In the embodiment of the application, the electronic device may obtain, through the GIS map, boundary coordinates corresponding to each boundary point in the second area boundary, where the boundary coordinates include longitude and latitude.
Step 205, based on the boundary coordinates, a plurality of target grids are screened from the second grid set.
In the embodiment of the present application, the target grid may be understood as a grid in which the coordinates of the vertices of the grid are located in the second region surrounded by the boundary coordinates.
In practical application, because the minimum circumscribed rectangle comprises the second area, the electronic device performs grid division on the minimum circumscribed rectangle based on the grid size, and a part of the divided grids falls in the peripheral area of the second area and a part of the divided grids falls in the internal area of the second area; therefore, a plurality of target grids falling in the internal region of the second region need to be screened from the second grid set based on the boundary coordinates of the second region, that is, a plurality of target grids in the second region with grids located in the enclosure of the boundary coordinates need to be screened from the second grid set.
In other embodiments of the present application, at least one vertex coordinate of the target grid is located within a second region bounded by the boundary coordinates.
Here, the electronic device screens out a plurality of target grids from the second grid set, wherein at least one vertex coordinate is located in a second area surrounded by the boundary coordinates, based on the boundary coordinates of the second area.
Step 206, a first grid set is constructed based on the plurality of target grids.
In the embodiment of the application, after obtaining a plurality of target grids in a first region, an electronic device constructs a first grid set based on the plurality of target grids
In practical application, referring to fig. 3, fig. 3 shows that the electronic device screens out a plurality of 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 the first grid set based on the plurality of target grids in the first area. Here, the first grid set includes grids in which at least one vertex coordinate of the grid is located in the second region surrounded by the black boundary line 31, and exemplarily, the first grid set includes 1414 grids corresponding to dotted lines.
And step 207, drawing a grid map based on the first grid set, and displaying the grid map.
In this embodiment of the application, step 207 draws a grid map based on the first grid set, and may be implemented by the following steps:
step 207a, generating an underlying canvas.
In the embodiment of the application, the underlying canvas can be understood as a drawable area with a drawing function in the digital map.
In practical applications, the electronic device may create a Canvas (Canvas) element with which to generate a digital map, such as an underlying Canvas over a GIS map. The Canvas element is an element added by HyperText Markup Language (HTML) and is used for generating a graphic container (Canvas) so as to perform drawing and rendering of graphics in the Canvas.
In the embodiment of the application, after the electronic device can acquire the first area of the digital map, the electronic device can generate the bottom canvas based on the first area; the electronic device may also generate an underlying canvas based on the entire digital map. In the implementation mode, the electronic equipment acquires vector data with a certain area, namely width and height data of the area, so that related parameters of grids do not need to be acquired, massive data in the GIS map are quickly rendered, and the processing efficiency of the electronic equipment is improved.
And step 207b, obtaining the grid configuration parameters associated with the first grid set.
In the embodiment of the present application, the grid configuration parameters may be understood as characteristic information of the grid, and the grid configuration parameters may include a shape of the grid, a color of the grid filling, a pattern of the grid filling, and a transparency of the grid filling. Illustratively, the shape of the grid may be quadrilateral, pentagonal, or other polygonal shape; the color of the grid filling can be none, red, blue or yellow, etc.; the pattern filled in the grid can be none, point, oblique line or cross line; the grid fill is 30% transparent, etc.
And step 207c, generating a scalable vector grid map based on the configuration parameters and the first grid set.
The grid map is a scalable vector grid map.
In the embodiment of the present application, the scalable vector grid map may be understood as a map having an arbitrary scaling function.
Specifically, when the scalable vector grid map is arbitrarily scaled, the definition of the grid graph is not affected, so that the drawn grid graph can be adapted to the first area requirement with different area attributes in the digital map.
In the embodiment of the application, after acquiring the grid configuration parameter and the first grid set, the electronic device dynamically generates a Scalable Vector Graphics (SVG) graph based on the grid configuration parameter and the first grid set, performs format conversion on the generated SVG grid graph by using base64 coding, acquires a coded graph, and transmits the coded graph in a binary code stream form. Therefore, the pictures do not need to be stored locally in an address form or loaded in the address form, the transmission rate of the pictures is improved, and the user experience degree is greatly improved. Moreover, the electronic equipment transmits the pictures in the form of binary code streams, the pictures cannot appear in the page and only can be displayed after the program is run, and the pictures are indirectly protected.
In this embodiment of the present application, step 207c generates a scalable vector grid map based on the configuration parameters and the first grid set, and may also be implemented by the following steps:
step S1, determining each target configuration parameter corresponding to each grid subset of the grid subsets having different grid attribute information in the first grid set.
The grid configuration parameters comprise target configuration parameters, and the target configuration parameters corresponding to the grids with different grid attribute information are different.
In the embodiment of the present application, the grid attribute information may be understood as attribute information having data characteristics in the grid. The grid attribute information includes data information such as total traffic, total user number, radio utilization rate, or Control Channel Elements (CCE) occupancy in a Physical Downlink Control Channel (PDCCH). The target configuration parameter may be understood as a parameter of the electronic device to configure the grid pattern in each grid subset.
In the embodiment of the application, the electronic device determines each target configuration parameter corresponding to each grid subset in grid subsets with different grid attribute information in a first grid set; the target configuration parameters corresponding to grids with different grid attribute information are different.
In practical application, the electronic device acquires data information included in the grid attribute information in the first grid set in real time, and compares each acquired data information with a preset threshold of the data information corresponding to the electronic device to obtain a grid subset corresponding to each data information in the first grid set; and the electronic equipment acquires 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.
Step S2, generating a scalable vector grid map based on each grid subset and each target configuration parameter.
In the embodiment of the application, the electronic device dynamically generates the scalable vector grid pattern corresponding to each grid set and each target configuration parameter based on each grid set and each target configuration parameter.
In practical applications, as shown with reference to fig. 4, the first grid set includes grids in which at least one vertex coordinate of the grid is located in the second region surrounded by the black border line 41; the method comprises the steps that the electronic equipment obtains grids with data information in a first grid set in real time, such as telephone traffic data, compares the telephone traffic data information obtained in real time with a preset threshold value of the telephone traffic data corresponding to the electronic equipment to obtain a first grid subset corresponding to the telephone traffic data higher than the telephone traffic preset threshold value and a second grid subset corresponding to the telephone traffic data lower than the telephone traffic preset threshold value, wherein the grids in the first grid subset are grids pointed by a black filled rectangle 42, the grids in the second grid subset are grids pointed by an oblique line filled rectangle 43, and first target configuration parameters corresponding to the first grid subset, such as target configuration parameters filled in the grids and shaped like multiple oblique lines, are obtained; and acquiring a second target configuration parameter corresponding to the second grid subset, for example, a target configuration parameter filled in the grid and having a single oblique line shape. A scalable vector grid map is generated based on the first grid subset, the second grid subset, the first target configuration parameter, and the second target configuration parameter.
In other embodiments of the present application, after obtaining each grid subset, the electronic device may further obtain grid attribute information, that is, included data information and area attribute information, of a single grid included in each grid set. By scaling a single grid, the division manner of the grid and the display manner of the data information in the areas of different levels of the grid can be obtained, as shown in fig. 5, fig. 5 shows the display manner of the data information in the area of a smaller level of the grid based on the division manner of the grid corresponding to the area attribute information. Illustratively, each building is represented in a cubic display, and names of buildings corresponding to the separated cubes are indicated in fig. 5, such as office building 1 seats.
Step 207d, drawing the scalable vector grid map on the underlying canvas.
In an embodiment of the application, an electronic device draws a scalable vector grid map on an underlying canvas.
Specifically, the electronic device accesses the SVG grid graphics into the underlying Canvas using methods in the Canvas element, such as the drawImage () method.
According to the scheme, the electronic equipment adopts a mode that HTML Canvas is merged into SVG graphics, so that the richness of the patterns is improved; readability is improved by adopting a mode of respectively storing according to scaling levels.
The method has the advantages that HTML Canvas and SVG images are fused, the characteristic that the HTML Canvas has mass data to perform fast rendering is utilized, bottom Canvas of grids in a digital map is generated, SVG grid graphs are dynamically generated through grid configuration parameters, SVG grid graphs are rendered immediately after being used, the rendering speed of the grid graphs and the style of the SVG grid graphs are taken into consideration, and the legibility of the grid data is improved.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
An embodiment of the present application provides a grid division method, which is applied to an electronic device, and as shown in fig. 6, the method includes the following steps:
step 301, determining boundary information of the geographic position.
In the embodiment of the present application, the geographic position boundary is boundary information of the second area. A geographical location boundary may be understood as an irregular closed-loop area.
In practical applications, the electronic device obtains irregular boundary information of an administrative area by using a GIS map (such as a gold map, a Baidu map, a map, and the like), and since a part of the administrative area (such as beijing) includes an irregular closed-loop area, the electronic device may store geographical position coordinates of each boundary included in an irregular geographical position by using a two-dimensional array.
Step 302, longitude and latitude point list data of the closed loop area boundary of the geographic position are obtained.
In the embodiment of the present application, the closed-loop area of the geographic location is an irregular polygon, and the list data may be understood as data of longitude and latitude points corresponding to each boundary point in the boundary of the closed-loop area.
And 303, obtaining the minimum circumscribed rectangle containing the closed loop area based on the longitude and latitude point list data of the boundary of the closed loop area.
In the embodiment of the application, the electronic device obtains the maximum longitude, the minimum longitude, the maximum latitude and the minimum latitude in the longitude and latitude point list data of the boundary of the closed-loop area, obtains the minimum circumscribed rectangle corresponding to the closed-loop area, and obtains the vertex coordinates of the minimum circumscribed rectangle.
Step 304, determine the longitude and latitude lengths of the individual grids.
In the embodiment of the present application, the longitude length and the latitude length of the single grid may be set as fixed grids, and the longitude length and the latitude length of the single grid may also be determined by determining the total number of grids into which the minimum bounding rectangle is divided in the longitude direction and the latitude direction, and determining the longitude length and the latitude length of the single grid based on the total number of the divided grids.
And 305, performing grid division on the minimum circumscribed rectangle based on the longitude length and the latitude length of a single grid to obtain a grid position list.
In the embodiment of the application, the electronic device uses the longitude length and the latitude length of a single grid as the segmentation step length, performs circular traversal on the longitude direction and the latitude direction of the minimum circumscribed rectangle, and finally performs cutting to obtain the grid position list in the minimum circumscribed rectangle area.
In the embodiment of the application, the grid position can be represented by using the position coordinate of any vertex on the grid, such as the position coordinate of an upper left vertex, the position coordinate of a lower left vertex, the position coordinate of an upper right vertex and the position coordinate of a lower right vertex; the grid position may also be represented by using a position coordinate of a center point of an area where the grid is located, and here, the grid position is not specifically limited in this embodiment of the application.
In the embodiment of the application, the electronic device performs grid division on the minimum external rectangle based on the longitude length and the latitude length of a single grid to obtain each grid position, summarizes each grid position, and finally obtains the grid position list in the minimum external rectangle.
And step 306, screening out the grid list of which the grid vertex falls in the closed-loop area based on the grid position list.
In the embodiment of the application, the electronic equipment circularly traverses the grid position list and screens out longitude and latitude point list data of which at least one vertex falls on the boundary of the irregular closed loop area in the grid. Referring to FIG. 3, a grid pattern is shown in which at least one vertex of the grid falls within the closed-loop region.
And 307, generating a grid Canvas of the geographic position irregular area by using the HTML Canvas.
In the embodiment of the application, the HTML Canvas has the characteristic of fast rendering of mass data, and the electronic equipment utilizes the HTML Canvas as a grid Canvas covering an irregular geographic position area acquired by the GIS.
And 308, acquiring grid configuration parameters, generating an SVG grid graph based on the grid configuration parameters, processing the generated SVG grid graph into base64 codes, and accessing the SVG grid graph into a grid canvas.
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 of the grid filling, the transparency of the grid filling, and the like.
In the embodiment of the application, the electronic equipment can dynamically change the color and the style of the SVG grid graph by using the grid configuration parameters; and the SVG grid graph is processed into a binary code stream by using base64 coding for transmission, so that the SVG grid graph does not need to be stored in the electronic equipment in the form of pictures, the storage space of the electronic equipment is saved, and the processing efficiency of the electronic equipment is improved.
The embodiment of the application can be realized by the following codes:
const createSvgGrid=(fillColor,Shape)=>{};
const serializer=new XMLSerializer();
const svgStr=serializer.serializeToString(svg);
const svgSrc=`data:image/svg+xml;base64,${window.btoa(svgStr)}`;
const img=new Image();
img.src=svgSrc;
ctx.drawImage(img);
in other embodiments of the present application, an electronic device obtains user index data in a geographic area, where the user index data includes at least one of total traffic, total number of users, radio utilization rate, and CCE occupancy of a PDCCH channel; setting a preset threshold value of user index data based on the current time and the user index data; generating an SVG grid pattern based on user index data, a preset threshold and grid configuration parameters, processing the generated SVG grid pattern into base64 code, and accessing the SVG grid pattern to a grid canvas, as shown in fig. 4 and 5, fig. 4 and 5 show the display mode of data information in areas of different levels of the grid based on the grid division mode corresponding to the area attribute information.
Therefore, the grid division method accurately divides grid units on irregular administrative boundaries, realizes division of normalized grid data of real administrative regions, effectively fits the administrative boundaries, avoids judging and calculating grid data outside the boundary regions when the grid index data are collected, and effectively improves the grid index collection efficiency. Meanwhile, the HTML Canvas and the SVG image are fused, the grid image is immediately rendered by adjusting the color, the shape and other parameters of the SVG grid image, and the rendering speed of the SVG grid image and the style of the SVG grid image are considered.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
Based on the foregoing embodiments, the present application provides a grid partitioning apparatus, which may be applied to the grid partitioning method provided in the embodiments corresponding to fig. 1 and 2, and as shown in fig. 7, the grid partitioning apparatus 7 includes:
a first obtaining unit 71 for obtaining a first area in the digital map;
the first processing unit 72 is configured to perform grid division on the first region based on a grid size corresponding to the first region to obtain a first grid set;
and a second processing unit 73, configured to draw a grid map based on the first grid set, and display the grid map.
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 determining the minimum bounding rectangle of the second area as the first area.
In other embodiments of the present application, the first processing unit 72 is further configured to perform grid division on the first area based on the grid size to obtain a second grid set; obtaining boundary coordinates of the second area; screening a plurality of target grids from the second grid set based on the boundary coordinates; a first grid set is constructed based on a plurality of target grids.
In other embodiments of the present application, at least one vertex coordinate of the target grid is located within a second region bounded by the boundary coordinates.
In other embodiments of the present application, the second processing unit 73 is further configured to generate an underlying canvas; based on the first grid set, a grid map is drawn on the underlying canvas.
In other embodiments of the present application, the second processing unit 73 is further configured to obtain a grid configuration parameter; generating a scalable vector grid map based on the configuration parameters and the first grid set; the grid map is a scalable vector grid map; a scalable vector grid map is drawn on the underlying canvas.
In other embodiments of the present application, the second processing unit 73 is further configured to determine each target configuration parameter corresponding to each grid subset of the grid subsets having different grid attribute information in the first grid set; the grid configuration parameters comprise target configuration parameters, and the target configuration parameters corresponding to the grids with different grid attribute information are different; a scalable vector grid map is generated based on each grid subset and each target configuration parameter.
Based on the foregoing embodiments, an embodiment of the present application provides an electronic device, which may be applied to a grid division method provided in the embodiments corresponding to fig. 1 and 2, and as shown in fig. 8, the electronic device 8 (the electronic device 8 in fig. 8 corresponds to the grid division apparatus 7 in fig. 7) includes: a memory 81 and a processor 82, wherein; the processor 82 is configured to execute the grid partitioning program stored in the memory 81, and the electronic device implements the following steps through the processor 82:
obtaining a first area in a digital map;
performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set;
and drawing a grid map based on the first grid set, and displaying the grid map.
In other embodiments of the present application, the processor 82 is configured to obtain a second region in the digital map; and determining the minimum bounding rectangle of the second area as the first area.
In other embodiments of the present application, the processor 82 is configured to perform grid division on the first region based on the grid size to obtain a second grid set; obtaining boundary coordinates of the second area; screening a plurality of target grids from the second grid set based on the boundary coordinates; a first grid set is constructed based on a plurality of target grids.
In other embodiments of the present application, at least one vertex coordinate of the target grid is located within a second region bounded by the boundary coordinates.
In other embodiments of the present application, the processor 82 is configured to generate an underlying canvas; based on the first grid set, a grid map is drawn on the underlying canvas.
In other embodiments of the present application, the processor 82 is configured to obtain grid configuration parameters; generating a scalable vector grid map based on the configuration parameters and the first grid set; the grid map is a scalable vector grid map; a scalable vector grid map is drawn on the underlying canvas.
In other embodiments of the present application, the processor 82 is configured to determine each target configuration parameter corresponding to each grid subset of the grid subsets having different grid attribute information in the first grid set; the grid configuration parameters comprise target configuration parameters, and the target configuration parameters corresponding to the grids with different grid attribute information are different; a scalable vector grid map is generated based on each grid subset and each target configuration parameter.
Based on the foregoing embodiments, an embodiment of the present invention provides a storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
obtaining a first area in a digital map;
performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set;
and drawing a grid map based on the first grid set, and displaying the grid map.
In other embodiments of the invention, the one or more programs are executable by the one or more processors to perform the steps of:
obtaining a second area in the digital map;
and determining the minimum bounding rectangle of the second area as the first area.
In other embodiments of the invention, the one or more programs are executable by the one or more processors to perform the steps of:
based on the grid size, performing grid division on the first area to obtain a second grid set;
obtaining boundary coordinates of the second area;
screening a plurality of target grids from the second grid set based on the boundary coordinates;
a first grid set is constructed based on a plurality of target grids.
In other embodiments of the invention, at least one vertex coordinate of the target grid is located within a second region bounded by the boundary coordinates.
In other embodiments of the invention, the one or more programs are executable by the one or more processors to perform the steps of:
generating a bottom layer canvas;
based on the first grid set, a grid map is drawn on the underlying canvas.
In other embodiments of the invention, the one or more programs are executable by the one or more processors to perform the steps of:
obtaining a grid configuration parameter;
generating a scalable vector grid map based on the configuration parameters and the first grid set; the grid map is a scalable vector grid map;
a scalable vector grid map is drawn on the underlying canvas.
In other embodiments of the invention, the one or more programs are executable by the one or more processors to perform the steps of:
determining each target configuration parameter corresponding to each grid subset in grid subsets with different grid attribute information in a first grid set; the grid configuration parameters comprise target configuration parameters, and the target configuration parameters corresponding to the grids with different grid attribute information are different;
a scalable vector grid map is generated based on each grid subset and each target configuration parameter.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
The storage medium/Memory may be a Memory such as 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); but may also be various terminals such as mobile phones, computers, tablet devices, personal digital assistants, etc., that include one or any combination of the above-mentioned memories.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing module, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit. Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media capable of storing program codes, such as a removable Memory device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, and an optical disk.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of grid partitioning, the method comprising:
obtaining a first area in a digital map;
performing grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set;
drawing a grid map based on the first grid set, and displaying the grid map.
2. The grid partitioning method of claim 1, wherein said obtaining a first region in a digital map comprises:
obtaining a second region in the digital map;
and determining the minimum bounding rectangle of the second area as the first area.
3. The method of claim 2, wherein the performing the grid division on the first region based on the grid size corresponding to the first region to obtain a first grid set comprises:
based on the grid size, performing grid division on the first area to obtain a second grid set;
obtaining boundary coordinates of the second area;
screening a plurality of target grids from the second grid set based on the boundary coordinates;
constructing the first grid set based on the plurality of target grids.
4. The method of claim 3, wherein at least one vertex coordinate of the target grid is located within the second region bounded by the boundary coordinates.
5. The grid partitioning method according to any one of claims 1 to 4, wherein said drawing a grid map based on said first grid set comprises:
generating a bottom layer canvas;
drawing the grid map on the underlying canvas based on the first grid set.
6. The grid partitioning method of claim 5, wherein said drawing the grid map on the underlying canvas based on the first grid set comprises:
obtaining grid configuration parameters associated with the first grid set;
generating a scalable vector grid map based on the configuration parameters and the first grid set; the grid map is the scalable vector grid map;
drawing the scalable vector grid map on the underlying canvas.
7. The grid partitioning method of claim 6, wherein said generating a scalable vector grid map based on said configuration parameters and said first grid set comprises:
determining each target configuration parameter corresponding to each grid subset in the grid subsets with different grid attribute information in the first grid set; the grid configuration parameters comprise the target configuration parameters, and the target configuration parameters corresponding to grids with different grid attribute information are different;
generating the scalable vector grid map based on the each grid subset and the each target configuration parameter.
8. A meshing device, comprising:
a first obtaining unit configured to obtain a first area in a digital map;
the first processing unit is used for carrying out grid division on the first area based on the grid size corresponding to the first area to obtain a first grid set;
and the second processing unit is used for drawing a grid map based on the first grid set and displaying the grid map.
9. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor for executing executable instructions stored in the memory to implement the grid partitioning method as claimed in any one of claims 1 to 7.
10. A storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the grid partitioning method of any one of claims 1 to 7.
CN202010699188.9A 2020-07-20 2020-07-20 Grid division method, grid division device, electronic apparatus, and storage medium Pending CN113963077A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010699188.9A CN113963077A (en) 2020-07-20 2020-07-20 Grid division method, grid division device, electronic apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010699188.9A CN113963077A (en) 2020-07-20 2020-07-20 Grid division method, grid division device, electronic apparatus, and storage medium

Publications (1)

Publication Number Publication Date
CN113963077A true CN113963077A (en) 2022-01-21

Family

ID=79459699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010699188.9A Pending CN113963077A (en) 2020-07-20 2020-07-20 Grid division method, grid division device, electronic apparatus, and storage medium

Country Status (1)

Country Link
CN (1) CN113963077A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114360255A (en) * 2022-03-21 2022-04-15 北京闪马智建科技有限公司 Flow determination method and device, storage medium and electronic device
CN114724323A (en) * 2022-06-09 2022-07-08 北京科技大学 Point distribution method of portable intelligent electronic fence for fire scene protection

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114360255A (en) * 2022-03-21 2022-04-15 北京闪马智建科技有限公司 Flow determination method and device, storage medium and electronic device
CN114360255B (en) * 2022-03-21 2022-08-30 北京闪马智建科技有限公司 Flow determination method and device, storage medium and electronic device
CN114724323A (en) * 2022-06-09 2022-07-08 北京科技大学 Point distribution method of portable intelligent electronic fence for fire scene protection
CN114724323B (en) * 2022-06-09 2022-09-02 北京科技大学 Point distribution method of portable intelligent electronic fence for fire scene protection

Similar Documents

Publication Publication Date Title
US10445914B2 (en) Method and apparatus for contextually varying imagery on a map
JP6997290B2 (en) Map data processing methods, computer equipment and computer programs
US9430866B2 (en) Derivative-based selection of zones for banded map display
US9110573B2 (en) Personalized viewports for interactive digital maps
CA2629597C (en) Bitmap array for optimally distributing map data content to wireless communications devices
US8896630B1 (en) Keeping map labels consistent across multiple zoom levels
CN111784833A (en) WebGL-based flood evolution situation three-dimensional dynamic visualization display method
US8730264B1 (en) Determining when image elements intersect
US10783687B2 (en) Efficient duplicate label handling
CN114297206B (en) Refined efficient dynamic tile map service publishing method, medium and electronic equipment
WO2005089434A2 (en) Method for encoding and serving geospatial or other vector data as images
CN112015501A (en) Visual page generation method and device, computer equipment and storage medium
CN113963077A (en) Grid division method, grid division device, electronic apparatus, and storage medium
EP2766876B1 (en) Use of banding to optimize map rendering in a three-dimensional tilt view
US10832463B2 (en) Efficient label insertion and collision handling
Suárez et al. An efficient terrain Level of Detail implementation for mobile devices and performance study
CN112843700B (en) Terrain image generation method and device, computer equipment and storage medium
CN114820967B (en) Layered image data real-time drawing method and system
Iosifescu Enescu Cartographic Web Services
CN113538468B (en) Method and device for constructing high-definition satellite map vector slice based on svg format
CN114238528A (en) Map loading method and device, electronic equipment and storage medium
CN116737852A (en) Vector tile data-based vector drawing method and device and electronic equipment
Ipfelkofer et al. Ontology driven visualisation of maps with SVG-an example for semantic programming
JP6042683B2 (en) Map image generation apparatus, map image generation method, and program
She et al. A building label placement method for 3D visualizations based on candidate label evaluation and selection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination