CN115546331A - Data rendering method and device, electronic equipment and computer readable medium - Google Patents

Data rendering method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN115546331A
CN115546331A CN202211071071.1A CN202211071071A CN115546331A CN 115546331 A CN115546331 A CN 115546331A CN 202211071071 A CN202211071071 A CN 202211071071A CN 115546331 A CN115546331 A CN 115546331A
Authority
CN
China
Prior art keywords
vector
rendering
pixel
tile
data
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
CN202211071071.1A
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.)
Jingdong City Beijing Digital Technology Co Ltd
Original Assignee
Jingdong City Beijing Digital 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 Jingdong City Beijing Digital Technology Co Ltd filed Critical Jingdong City Beijing Digital Technology Co Ltd
Priority to CN202211071071.1A priority Critical patent/CN115546331A/en
Publication of CN115546331A publication Critical patent/CN115546331A/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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a data rendering method, a data rendering device, electronic equipment and a computer readable medium, and relates to the technical field of intelligent cities, wherein the method comprises the following steps: receiving a data rendering request, and acquiring a corresponding vector tile identifier and a corresponding style identifier; determining rendering pixel information of the vector tiles corresponding to the vector tile identifiers according to the style identifiers; generating a drawing instruction corresponding to the pixel coordinate system based on the rendering pixel information; the drawing instructions are executed to generate corresponding grid tiles. The method has the advantages that the vector tiles can dynamically set the styles, the rendering pressure of a browser end of a user is reduced, and the purposes of less data transmission of the grid map tiles, low data redundancy, rapid map loading and high browsing efficiency of the user are achieved.

Description

Data rendering method and device, electronic equipment and computer readable medium
Technical Field
The application relates to the technical field of intelligent cities, in particular to the technical field of geographic information, and specifically relates to a data rendering method, a data rendering device, electronic equipment and a computer readable medium.
Background
Electronic map Tiles displayed on the internet mainly use two ways, one is the traditional grid Tiles (Raster Tiles) and the other is the newer Vector Tiles (Vector Tiles). Through the grid map tile technology, when a user browses a map through a browser, the user does not need to request the whole map data, and can obtain the grid map tiles of the map with the specified level and the specified row and column number range according to the geographic boundary and the current scale of a browsing area. The map display mode is simple and convenient, and although data redundancy can be generated when the whole map is sliced into a series of pictures, the map display mode quickly becomes the basic technology of displaying the modern map on a browser. The tiles of the vector tile are vector data of a dot-line-plane type. Compared with the raster map tile, the vector map tile does not contain visual information of the map, data rendering occurs at a browser end of a user, and the vector tile reduces the pressure of a map server and increases the rendering pressure of a browser at a user end.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art:
the use of the grid map tiles can cause high data redundancy and incapability of editing the map format, and the use of the vector map tiles can cause high rendering pressure of a browser end of a user, and cause map browsing stagnation or slow map loading.
Disclosure of Invention
In view of this, embodiments of the present application provide a data rendering method, an apparatus, an electronic device, and a computer readable medium, which can solve the problems that data redundancy is high due to the use of raster map tiles, a map format cannot be edited, and rendering pressure at a browser end of a user is high due to the use of vector map tiles, which causes map browsing stagnation or slow map loading.
To achieve the above object, according to an aspect of an embodiment of the present application, there is provided a data rendering method including:
receiving a data rendering request, and acquiring a corresponding vector tile identifier and a corresponding style identifier;
according to the pattern identifier, determining rendering pixel information of a vector tile corresponding to the vector tile identifier;
generating a drawing instruction corresponding to the pixel coordinate system based on the rendering pixel information;
the drawing instructions are executed to generate corresponding grid tiles.
Optionally, determining rendering pixel information of the vector tile corresponding to the vector tile identifier includes:
acquiring the geographic coordinates of the vector elements in the corresponding vector tiles according to the vector tile identifications;
converting the geographic coordinates into pixel coordinates corresponding to the style identification;
rendering pixel information for the vector tile is determined based on the pixel coordinates.
Optionally, determining rendering pixel information for the vector tile comprises:
simplifying the pixel coordinates to obtain simplified pixel coordinates;
acquiring a pixel depth and a color channel corresponding to the style identification;
rendering pixel information for the vector tile is determined based on the simplified pixel coordinates, the pixel depth, and the color channel.
Optionally, before obtaining the corresponding vector tile identifier and style identifier, the method further includes:
and acquiring data to be rendered, and performing map slicing on the data to be rendered based on a quadtree algorithm to generate each vector tile.
Optionally, generating each vector tile comprises:
and calling a cross-platform graphic library to perform vector drawing on the sliced map to generate each vector tile.
Optionally, the simplifying the pixel coordinates to obtain simplified pixel coordinates includes:
determining pixel coordinates corresponding to head and tail vector elements in the vector elements, and connecting the pixel coordinates corresponding to the head and tail vector elements to obtain a straight line;
determining the distance between all pixel coordinates corresponding to the vector elements and the straight line;
and screening the coordinates of each pixel according to the distance to obtain simplified pixel coordinates.
In addition, the present application also provides a data rendering apparatus, including:
a receiving unit configured to receive a data rendering request, and obtain a corresponding vector tile identifier and a style identifier;
a rendering pixel information determining unit configured to determine rendering pixel information of a vector tile corresponding to the vector tile identifier according to the style identifier;
a drawing instruction generating unit configured to generate a drawing instruction of a corresponding pixel coordinate system based on the rendering pixel information;
a rendering unit configured to execute the drawing instructions to generate corresponding grid tiles.
Optionally, the rendering pixel information determination unit is further configured to:
acquiring the geographic coordinates of the vector elements in the corresponding vector tiles according to the vector tile identifiers;
converting the geographic coordinates into pixel coordinates corresponding to the style identification;
rendering pixel information for the vector tile is determined based on the pixel coordinates.
Optionally, the rendering pixel information determination unit is further configured to:
simplifying the pixel coordinates to obtain simplified pixel coordinates;
acquiring a pixel depth and a color channel corresponding to the style identification;
rendering pixel information for the vector tile is determined based on the simplified pixel coordinates, the pixel depth, and the color channel.
Optionally, the data rendering apparatus further comprises a vector tile generating unit configured to:
and acquiring data to be rendered, and performing map slicing on the data to be rendered based on a quadtree algorithm to generate each vector tile.
Optionally, the vector tile generation unit is further configured to:
and calling a cross-platform graphic library to perform vector drawing on the sliced map to generate each vector tile.
Optionally, the rendering pixel information determination unit is further configured to:
determining pixel coordinates corresponding to head and tail vector elements in the vector elements, and connecting the pixel coordinates corresponding to the head and tail vector elements to obtain a straight line;
determining the distance between all pixel coordinates corresponding to the vector elements and the straight line;
and screening the coordinates of each pixel according to the distance to obtain simplified pixel coordinates.
In addition, the present application also provides a data rendering electronic device, including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the data rendering method as described above.
In addition, the present application also provides a computer readable medium, on which a computer program is stored, which when executed by a processor implements the data rendering method as described above.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of obtaining corresponding vector tile identification and style identification by receiving a data rendering request; according to the pattern identifier, determining rendering pixel information of a vector tile corresponding to the vector tile identifier; generating a drawing instruction corresponding to the pixel coordinate system based on the rendering pixel information; the drawing instructions are executed to generate corresponding grid tiles. The method has the advantages that the vector tiles can dynamically set the styles, the rendering pressure of a browser end of a user is reduced, and the purposes of less data transmission of the grid map tiles, low data redundancy, rapid map loading and high browsing efficiency of the user are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a further understanding of the application and are not to be construed as limiting the application. Wherein:
fig. 1 is a schematic diagram of a main flow of a data rendering method according to a first embodiment of the present application;
FIG. 2 is a schematic diagram of a main flow of a data rendering method according to a second embodiment of the present application;
fig. 3 is a schematic view of an application scenario of a data rendering method according to a third embodiment of the present application;
FIG. 4 is a schematic diagram of the main elements of a data rendering apparatus according to an embodiment of the present application;
FIG. 5 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
fig. 6 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
Fig. 1 is a schematic diagram of a main flow of a data rendering method according to a first embodiment of the present application, and as shown in fig. 1, the data rendering method includes:
step S101, receiving a data rendering request, and acquiring a corresponding vector tile identifier and a corresponding style identifier.
In this embodiment, an execution subject (for example, a server) of the data rendering method may receive the data rendering request by way of wired connection or wireless connection. When a user browses a map by a browser, the user can acquire a picture rendered by map tiles with specified levels and specified row and column number ranges according to the geographical boundary of a browsing area and the current scale without requesting the whole map data.
The execution subject may obtain the vector tile identification and the style identification from the data rendering request. Wherein the vector tile identification is used to characterize which vector tile in the map is to be rendered. The style identifies what style to render to the vector tile. The rendering style corresponding to the style identification may include a pure black line style, a road graded coloring style, a dotted line style, and the like, and the style corresponding to the style identification is not specifically limited in the embodiment of the present application.
Specifically, before obtaining the corresponding vector tile identifier and style identifier, the data rendering method further includes: and acquiring data to be rendered, and performing map slicing on the data to be rendered based on a quadtree algorithm to generate each vector tile.
The data to be rendered may be data of a mountain, a road, a building, etc. corresponding to a certain area on the map. The execution subject may determine which area on the map corresponds to the click operation in response to the click operation by the user, and then acquire data of mountains, roads, buildings, and the like of the area. And carrying out map slicing on data of mountains, roads, buildings and the like in the area based on a quadtree algorithm to obtain each vector tile. The basic idea of quadtree coding is: firstly, equally dividing an image or a raster map into four primary character blocks, wherein the four primary character blocks are sequentially from top left, top right, bottom left and bottom right; then checking all grid attribute values (or gray values) block by block, if the grid attribute values (or gray values) are the same, the block is not subdivided; if the sub-blocks are different, the sub-blocks are further divided into four secondary sub-blocks; the partitioning is done recursively until the attributes or grayscales of each sub-block are equal. Vector tiles: and slicing the geographic space data according to different scale levels in a quadtree manner. The difference is that the map tile after the vector tile is sliced uses google's protocol buffers binary compression format to store the vector data in the current tile, i.e. the tile generated by the vector tile is still the vector data of point, line and plane types.
According to the method and the device for displaying the map, the map is cut into rectangular areas with different levels and equal sizes in a hierarchical mode of a quadtree pyramid model, then a user requests map tiles through a browser, and finally the map is displayed on a webpage. The advantage that the vector tiles can dynamically set the styles is reserved, and the rendering pressure of the browser end of the user is reduced.
Specifically, generating each vector tile includes: and calling a cross-platform graphic library to perform vector drawing on the sliced map to generate each vector tile. The cross-platform graphics library may be, for example, a Skia high performance graphics library.
And S102, determining rendering pixel information of the vector tile corresponding to the vector tile identifier according to the style identifier.
Rendering pixel information may include information that the vector identifies the size, pixel depth, color channel, etc. of the corresponding vector tile. The execution main body can firstly correlate and store the style identification and the rendering pixel information of the corresponding vector tile, wherein the rendering pixel information of the vector tile corresponding to the style identification can be obtained by self-definition and also can be obtained according to historical rendering records. For example, the pattern identifier may correspond to a pure black line pattern, and the execution main body may obtain rendering pixel information of the size, the pixel depth, the color channel, and the like of the corresponding vector tile according to the pure black line pattern, so as to render the vector tile corresponding to the vector tile identifier.
Step S103, based on the rendering pixel information, generating a drawing instruction corresponding to the pixel coordinate system.
The rendering pixel information includes geographic coordinates (usually longitude and latitude) of point, line and plane vector elements in the vector tile corresponding to the vector tile identifier, and the execution main body can convert the geographic coordinates (usually longitude and latitude) in the geographic coordinate system into pixel coordinates in a pixel coordinate system (0 to 255), then simplify the geographic coordinates according to the douglas-pock algorithm, and finally store the vector elements in the vector tile as drawing instructions in the pixel coordinate system, so that the data volume of the tile is further reduced.
Step S104, executing the drawing instruction to generate a corresponding grid tile.
The execution subject renders the vector tiles to obtain corresponding grid tiles by executing the drawing instructions in the pixel coordinate system. For example, using a vector tile rendering post-processing technique, the vector tiles are finally rendered into a grid tile, assuming that the size of the grid tile is 256 pixels by 256 pixels, the pixel depth is 8 bits, the color channel is 4 (RGBA), and ignoring the space occupied by other coding in the picture format specification, the maximum grid tile size delivered to the user is 256 by 8 bytes, i.e., 2KB.
In the embodiment, a corresponding vector tile identifier and a corresponding style identifier are obtained by receiving a data rendering request; according to the pattern identifier, determining rendering pixel information of a vector tile corresponding to the vector tile identifier; generating a drawing instruction corresponding to the pixel coordinate system based on the rendering pixel information; the drawing instructions are executed to generate corresponding grid tiles. The method has the advantages that the vector tiles can dynamically set the styles, the rendering pressure of a browser end of a user is reduced, and the purposes of less data transmission of the grid map tiles, low data redundancy, rapid map loading and high browsing efficiency of the user are achieved.
Fig. 2 is a schematic main flow diagram of a data rendering method according to a second embodiment of the present application, and as shown in fig. 2, the data rendering method includes:
step S201, receiving a data rendering request, and acquiring a corresponding vector tile identifier and a corresponding style identifier.
And S202, acquiring the geographic coordinates of the vector elements in the corresponding vector tiles according to the vector tile identifiers.
The execution agent may first determine vector elements within the vector tile, where the vector elements include points, lines, planes in the vector tile. The executing agent may obtain geographic coordinates of points, lines, faces within the vector tile corresponding to the vector tile identification.
Step S203, the geographic coordinates are converted into pixel coordinates corresponding to the style identification.
Through coordinate transformation, the executing entity may transform the geographic coordinates of the vector elements in the vector tile identification to pixel coordinates of the vector elements in a pixel coordinate system. For example, the execution subject converts the geographic coordinates of the vector elements in a geographic coordinate system (typically a latitude and longitude coordinate system) into pixel coordinates in a pixel coordinate system represented by 0 to 255.
Step S204, based on the pixel coordinate, determining the rendering pixel information of the vector tile.
The execution subject may store the correspondence of the pixel coordinates and the color channels in advance. In turn, the execution subject may determine rendering pixel information for the vector tile, such as pixel size, pixel depth, color channel, and the like, based on the pixel coordinates.
Specifically, determining rendering pixel information for a vector tile includes: simplifying the pixel coordinates to obtain simplified pixel coordinates; acquiring a pixel depth and a color channel corresponding to the style identification; rendering pixel information for the vector tile is determined based on the simplified pixel coordinates, the pixel depth, and the color channel. Specifically, the method for simplifying pixel coordinates to obtain simplified pixel coordinates includes: and simplifying the pixel coordinates based on a Douglas-Puck algorithm to obtain simplified pixel coordinates. The basic idea of the Douglas-Puck algorithm is to connect a straight line to the beginning and end points of each curve in an imaginary way, calculate the distance between all points and the straight line, and find out the maximum distance value dmax, compare dmax with the tolerance D: if dmax < D, the middle points on the line are all rounded off; if dmax is larger than or equal to D, a coordinate point corresponding to dmax is reserved, the point is taken as a boundary, the curve is divided into two parts, and the method is repeatedly used for the two parts. Specifically, the method for simplifying pixel coordinates to obtain simplified pixel coordinates includes: determining pixel coordinates corresponding to head and tail vector elements (namely, a first vector element and a last vector element) in the vector elements, and connecting the pixel coordinates corresponding to the head and tail vector elements to obtain a straight line (which may be a dotted line or a solid line, which is not specifically limited in this embodiment of the present application); determining the distance between all pixel coordinates corresponding to the vector elements (including head and tail vector elements and vector elements between the head and tail vector elements) and the straight line; and screening the coordinates of each pixel according to the distance to obtain simplified pixel coordinates. Specifically, the maximum distance is found, the maximum distance is compared with a preset distance threshold, if the maximum distance is smaller than the preset distance threshold, the coordinate of the intermediate vector element on the straight line is discarded, if the maximum distance is larger than the preset distance threshold, a coordinate point corresponding to the maximum distance is reserved, the point is taken as a boundary, the straight line is divided into two parts, and the method is repeatedly used for the two parts until the pixel coordinate corresponding to the last vector element is calculated. Therefore, the data size of the vector tiles can be reduced, the data redundancy is low, the map loading is rapid, and the user browsing efficiency is high.
In step S205, a drawing instruction corresponding to the pixel coordinate system is generated based on the rendering pixel information.
In step S206, a drawing instruction is executed to generate a corresponding grid tile.
The method and the device have the advantages that the vector tiles can be used for dynamically setting the styles, rendering pressure of a browser end of a user is reduced, and the purposes of less data transmission of the grid map tiles, low data redundancy, rapid map loading and high browsing efficiency of the user are achieved.
Fig. 3 is a schematic view of an application scenario of a data rendering method according to a third embodiment of the present application. The data rendering method is applied to a map browsing scene of a user. Specifically, in the embodiment of the present application, the grid tile: and segmenting the whole map by using a quadtree mode according to different scale levels, and segmenting the whole map into pictures named by row and column numbers under different scale levels. Vector tile: and slicing the geographic space data according to different scale levels in a quadtree manner. For example, a vector tile is geometric data such as a point, a line and a plane in a screen xy coordinate system, and a grid tile is a picture in format of png/jpg and the like. The difference is that the map tile after the vector tile is sliced uses a protocol buffers binary compression format to store the vector data in the current tile, i.e. the tile generated by the vector tile is still the vector data of the dot-line-plane type, so the name vector tile is obtained. Map rendering: the process of rendering the map to the portrait of the map is to draw information such as mountains, roads, buildings and the like on the map on paper or a screen by using a certain symbol according to a certain proportion relation and a certain projection method.
As shown in fig. 3, combining the technical advantages of the vector tiles and the grid tiles, after receiving a tile request, first performing map slicing (for example, the map slicing is point-line-plane data of longitude and latitude coordinates, and is converted into a vector tile of screen coordinates through coordinate conversion), then generating the vector tiles, and then performing rendering at the rear end of the server according to configured style information (for example, a pure black line style, a road graded coloring style, or a dotted line style) to generate corresponding grid tiles in combination with the vector tile data, thereby ensuring the near-real-time performance of the whole process and satisfying the map browsing experience of a user. For example, the data rendering method according to the embodiment of the present application may perform drawing using the latest drawing library according to the vector tiles under the screen coordinates, and change the drawing into the raster picture. Whether vector tiles or grid tiles, the way of displaying the map on the browser is similar, that is, the map is divided into different levels according to different map scales, then each level is sliced into tiles with the same size (usually 256 × 256 pixels or 512 × 512 pixels), and finally the browser requests the map tiles of the corresponding range according to the geographic range where the current window is located and renders and displays the map tiles. Specifically, on a vector map tile, after the map slicing process is completed, the vector tile converts the coordinate system of point, line and plane vector elements in the tile from a geographic coordinate system (usually longitude and latitude) to a pixel coordinate system (0-255) of the tile, then simplifies the coordinate system according to a Douglas-Puck algorithm, and finally stores the vector elements in the tile as a drawing instruction under the pixel coordinate system, so that the data volume of the tile is further reduced. For raster tiles, the map data is rendered according to the map style configuration while the tile is being sliced, typically as a PNG or JPEG picture.
According to the data rendering method, the rendering pressure of a browser of a user can be reduced firstly, the traditional vector tile technology is that the browser calls a display card of a local computer to render, any map operation (translation and zooming) in the map browsing process needs to be re-rendered, therefore, the map browsing frame number of the user depends on the performance of the display card of the local computer, the performance of the display card of most users is poor, the phenomenon of pause exists when massive map data is visualized, the map browsing experience is reduced, and the universality of the use of the vector tile technology is limited. Secondly, rendering the vector tiles at the server side can further compress the data, reducing the transmission pressure of the network bandwidth. The vector tile finally stores drawing instructions of the point-line plane in a pixel coordinate system, and the final size of the vector tile depends on the number of nodes of elements in the tile. When the geographic hierarchy of the tile is small, i.e., the geographic extent of the tile is large (e.g., a vector tile containing the northern hemisphere), the number of elemental nodes of the tile at this time, even though simplified by the douglas-pock algorithm, exceeds the overall size of the map display. The embodiment of the present application uses a vector tile rendering post-positioned technology, and can finally render the vector tiles into a grid picture, assuming that the size of the grid tile is 256 pixels × 256 pixels, the pixel depth is 8 bits, the color channel is 4 (RGBA), and ignoring the space occupied by other codes in the picture format specification, the maximum tile size transmitted to the user is 256 × 8 × 4 bytes, that is, 2KB. Finally, the embodiment of the application keeps the greatest advantage of the vector tiles, namely, the user can flexibly set the style of the geographic data, and the data is rendered at the back end of the server in near real time according to the style information provided by the user.
In order to render the vector tiles into grid tiles in near real-time, embodiments of the present application use a Skia high-performance graphics library to implement the rendering of the vector tiles. Skia is a widely used cross-platform graphics library on the browser side.
Fig. 4 is a schematic diagram of main units of a data rendering apparatus according to an embodiment of the present application. As shown in fig. 4, the data rendering apparatus 400 includes a receiving unit 401, a rendering pixel information determining unit 402, a drawing instruction generating unit 403, and a rendering unit 404.
The receiving unit 401 is configured to receive a data rendering request, and obtain a corresponding vector tile identifier and a style identifier.
A rendering pixel information determining unit 402 configured to determine rendering pixel information of the vector tile corresponding to the vector tile identifier according to the style identifier.
A drawing instruction generating unit 403 configured to generate a drawing instruction of a corresponding pixel coordinate system based on the rendering pixel information.
Rendering unit 404 configured to execute the drawing instructions to generate corresponding grid tiles.
In some embodiments, the rendering pixel information determination unit 402 is further configured to: acquiring the geographic coordinates of the vector elements in the corresponding vector tiles according to the vector tile identifiers; converting the geographic coordinates into pixel coordinates corresponding to the style identification; rendering pixel information for the vector tile is determined based on the pixel coordinates.
In some embodiments, the rendering pixel information determination unit 402 is further configured to: simplifying the pixel coordinates to obtain simplified pixel coordinates; acquiring pixel depth and color channels corresponding to the style identification; rendering pixel information for the vector tile is determined based on the simplified pixel coordinates, the pixel depth, and the color channel.
In some embodiments, the data rendering apparatus further comprises a vector tile generation unit, not shown in fig. 4, configured to: and acquiring data to be rendered, and performing map slicing on the data to be rendered based on a quadtree algorithm to generate each vector tile.
In some embodiments, the vector tile generation unit is further configured to: and calling a cross-platform graphic library to perform vector drawing on the sliced map to generate each vector tile.
In some embodiments, the rendering pixel information determination unit 402 is further configured to: and simplifying the pixel coordinates based on a Douglas-Puck algorithm to obtain simplified pixel coordinates.
In some embodiments, the rendering pixel information determination unit 402 is further configured to: determining pixel coordinates corresponding to head and tail vector elements in the vector elements, and connecting the pixel coordinates corresponding to the head and tail vector elements to obtain a straight line; determining the distance between all pixel coordinates corresponding to the vector elements and the straight line; and screening the coordinates of each pixel according to the distance to obtain simplified pixel coordinates.
It should be noted that, in the present application, the data rendering method and the data rendering apparatus have corresponding relationships in implementation contents, so repeated contents are not described again.
Fig. 5 shows an exemplary system architecture 500 to which the data rendering method or the data rendering apparatus of the embodiments of the present application may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is the medium used to provide communication links between terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having data rendering processing screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for data rendering requests submitted by users using the terminal devices 501, 502, 503. The background management server can receive a data rendering request and acquire a corresponding vector tile identifier and a corresponding style identifier; determining rendering pixel information of the vector tiles corresponding to the vector tile identifiers according to the style identifiers; generating a drawing instruction corresponding to the pixel coordinate system based on the rendering pixel information; the drawing instructions are executed to generate corresponding grid tiles. The method has the advantages that the vector tiles can dynamically set the styles, the rendering pressure of a browser end of a user is reduced, and the purposes of less data transmission of the grid map tiles, low data redundancy, rapid map loading and high browsing efficiency of the user are achieved.
It should be noted that the data rendering method provided in the embodiment of the present application is generally executed by the server 505, and accordingly, the data rendering apparatus is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 are merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a terminal device of an embodiment of the present application. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the computer system 600 are also stored. The CPU601, ROM602, and RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output section 607 including a signal processing section such as a Cathode Ray Tube (CRT), a liquid crystal credit authorization inquiry processor (LCD), and the like, and a speaker and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. A driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that the computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to embodiments disclosed herein, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present application when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a rendering pixel information determining unit, a drawing instruction generating unit, and a rendering unit. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not assembled into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to receive a data rendering request, obtain corresponding vector tile identifiers and style identifiers; according to the pattern identifier, determining rendering pixel information of a vector tile corresponding to the vector tile identifier; generating a drawing instruction corresponding to the pixel coordinate system based on the rendering pixel information; the drawing instructions are executed to generate corresponding grid tiles.
According to the technical scheme of the embodiment of the application, the advantage that the vector tiles can dynamically set the styles is reserved, the rendering pressure of a browser end of a user is reduced, and the purposes of less data transmission of the grid map tiles, low data redundancy, rapid map loading and high browsing efficiency of the user are achieved.
The above-described embodiments are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (11)

1. A method of data rendering, comprising:
receiving a data rendering request, and acquiring a corresponding vector tile identifier and a corresponding style identifier;
determining rendering pixel information of a vector tile corresponding to the vector tile identifier according to the style identifier;
generating a drawing instruction of a corresponding pixel coordinate system based on the rendering pixel information;
executing the drawing instructions to generate corresponding grid tiles.
2. The method of claim 1, wherein said determining that the vector tile identifies rendering pixel information for the corresponding vector tile comprises:
acquiring the geographic coordinates of the vector elements in the corresponding vector tiles according to the vector tile identifications;
converting the geographic coordinates into pixel coordinates corresponding to the style identification;
based on the pixel coordinates, rendering pixel information for the vector tile is determined.
3. The method of claim 2, wherein said determining rendering pixel information for said vector tile comprises:
simplifying the pixel coordinates to obtain simplified pixel coordinates;
acquiring a pixel depth and a color channel corresponding to the style identification;
determining rendered pixel information for the vector tile based on the reduced pixel coordinates, the pixel depth, and the color channel.
4. The method of claim 1, wherein prior to said obtaining the corresponding vector tile identifier and pattern identifier, the method further comprises:
and acquiring data to be rendered, and performing map slicing on the data to be rendered based on a quadtree algorithm to generate each vector tile.
5. The method of claim 4, wherein generating each vector tile comprises:
and calling a cross-platform graphic library to perform vector drawing on the sliced map to generate each vector tile.
6. The method of claim 3, wherein the reducing the pixel coordinates to obtain reduced pixel coordinates comprises:
determining pixel coordinates corresponding to head and tail vector elements in the vector elements, and connecting the pixel coordinates corresponding to the head and tail vector elements to obtain a straight line;
determining the distance between all pixel coordinates corresponding to the vector elements and the straight line;
and screening the pixel coordinates according to the distance to obtain simplified pixel coordinates.
7. A data rendering apparatus, comprising:
a receiving unit configured to receive a data rendering request, and obtain a corresponding vector tile identifier and a style identifier;
a rendering pixel information determining unit configured to determine rendering pixel information of a vector tile corresponding to the vector tile identifier according to the pattern identifier;
a drawing instruction generating unit configured to generate a drawing instruction of a corresponding pixel coordinate system based on the rendering pixel information;
a rendering unit configured to execute the drawing instructions to generate corresponding grid tiles.
8. The apparatus of claim 7, wherein the rendering pixel information determination unit is further configured to:
acquiring the geographic coordinates of the vector elements in the corresponding vector tiles according to the vector tile identifications;
converting the geographic coordinates into pixel coordinates corresponding to the style identification;
based on the pixel coordinates, rendering pixel information for the vector tile is determined.
9. The apparatus of claim 8, wherein the rendering pixel information determining unit is further configured to:
simplifying the pixel coordinates to obtain simplified pixel coordinates;
acquiring a pixel depth and a color channel corresponding to the style identification;
determining rendered pixel information for the vector tile based on the reduced pixel coordinates, the pixel depth, and the color channel.
10. A data rendering electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202211071071.1A 2022-09-02 2022-09-02 Data rendering method and device, electronic equipment and computer readable medium Pending CN115546331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211071071.1A CN115546331A (en) 2022-09-02 2022-09-02 Data rendering method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211071071.1A CN115546331A (en) 2022-09-02 2022-09-02 Data rendering method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN115546331A true CN115546331A (en) 2022-12-30

Family

ID=84725862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211071071.1A Pending CN115546331A (en) 2022-09-02 2022-09-02 Data rendering method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN115546331A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116561081A (en) * 2023-07-07 2023-08-08 腾讯科技(深圳)有限公司 Data processing method, device, electronic equipment, storage medium and program product
CN116774900A (en) * 2023-08-24 2023-09-19 中招国际招标有限公司 Interaction method of electronic map of engineering project management system
CN117036576A (en) * 2023-10-09 2023-11-10 腾讯科技(深圳)有限公司 Map rendering method and device, electronic equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116561081A (en) * 2023-07-07 2023-08-08 腾讯科技(深圳)有限公司 Data processing method, device, electronic equipment, storage medium and program product
CN116561081B (en) * 2023-07-07 2023-12-12 腾讯科技(深圳)有限公司 Data processing method, device, electronic equipment, storage medium and program product
CN116774900A (en) * 2023-08-24 2023-09-19 中招国际招标有限公司 Interaction method of electronic map of engineering project management system
CN116774900B (en) * 2023-08-24 2023-12-12 中招国际招标有限公司 Interaction method of electronic map of engineering project management system
CN117036576A (en) * 2023-10-09 2023-11-10 腾讯科技(深圳)有限公司 Map rendering method and device, electronic equipment and storage medium
CN117036576B (en) * 2023-10-09 2024-01-30 腾讯科技(深圳)有限公司 Map rendering method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN115546331A (en) Data rendering method and device, electronic equipment and computer readable medium
CN110675465B (en) Method and apparatus for generating image
CN113808231B (en) Information processing method and device, image rendering method and device, and electronic device
CN112714357B (en) Video playing method, video playing device, electronic equipment and storage medium
CN110609726A (en) Map processing method and device, computer readable storage medium and electronic device
CN114782613A (en) Image rendering method, device and equipment and storage medium
CN114612600A (en) Virtual image generation method and device, electronic equipment and storage medium
CN114627239B (en) Bounding box generation method, device, equipment and storage medium
CN111753038A (en) Rendering method and system of map data
CN113495933A (en) Vector tile display method and system
CN117270834A (en) Map rendering method, map rendering device, electronic equipment and storage medium
CN112445394A (en) Screenshot method and device
CN115908687A (en) Method and device for training rendering network, method and device for rendering network, and electronic equipment
CN111475231A (en) Method and device for generating occupation bitmap, electronic equipment and readable medium
CN114723600A (en) Method, device, equipment, storage medium and program product for generating cosmetic special effect
CN110750602A (en) Method and device for determining site to which order address belongs
CN114821011A (en) Dynamic picture generation method and device
CN110807114B (en) Method, device, terminal and storage medium for picture display
CN109710784B (en) Remote sensing image data space rapid visualization method based on lerc
CN113888673A (en) Map editing method, system, device, computing equipment and storage medium
CN112181221A (en) Image processing method and device, computer readable medium and electronic device
CN113808238A (en) Animation rendering method and device, readable medium and electronic equipment
CN113284174A (en) Method and device for processing pictures
CN113362438A (en) Panorama rendering method, device, electronic apparatus, medium, and program
CN112164066A (en) Remote sensing image layered segmentation method, device, terminal and storage medium

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