CN115761166A - Map construction method based on vector tiles and application thereof - Google Patents

Map construction method based on vector tiles and application thereof Download PDF

Info

Publication number
CN115761166A
CN115761166A CN202211482375.7A CN202211482375A CN115761166A CN 115761166 A CN115761166 A CN 115761166A CN 202211482375 A CN202211482375 A CN 202211482375A CN 115761166 A CN115761166 A CN 115761166A
Authority
CN
China
Prior art keywords
tile
vector
data
layer
rendering
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
CN202211482375.7A
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.)
CCI China Co Ltd
Original Assignee
CCI China 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 CCI China Co Ltd filed Critical CCI China Co Ltd
Priority to CN202211482375.7A priority Critical patent/CN115761166A/en
Publication of CN115761166A publication Critical patent/CN115761166A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides a map construction method based on vector tiles and application thereof, comprising the following steps: s00, tiling original vector data to obtain a vector tile data source; carrying out automatic mapping conversion or user-defined mapping conversion on the original style description to obtain system style description contents corresponding to the vector tile data source; s10, configuring layer description according to a vector tile data source and system style description content; s20, performing deflection processing on a tile request process and a rendering process according to whether deflection is set or not; and S30, receiving the layer descriptions, establishing canvas with the same number according to the number of the layer descriptions, numbering the canvas, and rendering the layers in sequence until the drawing of all tiles is completed. The method and the device have the advantages of high rendering efficiency and avoidance of repeated rendering.

Description

Map construction method based on vector tiles and application thereof
Technical Field
The application relates to the technical field of electronic maps, in particular to a map construction method based on vector tiles and application thereof.
Background
The electronic map is a system for making and applying maps, is a map generated by the control of an electronic computer, is a screen map based on a digital drawing technology, and is a visual real map. "visualization on a computer screen" is a fundamental feature of electronic maps.
The tile map pyramid model is a multi-resolution hierarchical model, and the resolution is lower and lower from the bottom layer to the top layer of the tile pyramid, but the represented geographic range is unchanged. Firstly, determining the number N of zoom levels to be provided by a map service platform, taking a map picture with the highest zoom level and the largest map scale as the bottom layer of a pyramid, namely a layer 0, partitioning the map picture, cutting the map picture from left to right and from top to bottom from the upper left corner of the map picture, and dividing the map picture into square map tiles with the same size (such as 256x256 pixels) to form a layer 0 tile matrix; on the basis of the map picture of the layer 0, generating the map picture of the layer 1 by a method of dividing each pixel into 2 multiplied by 2 pixels, partitioning the map picture into blocks, and dividing the blocks into square map tiles with the same size as the next layer to form a tile matrix of the layer 1; generating a layer 2 tile matrix by the same method; 8230; this continues until the Nth 1 st layer, which constitutes the entire tile pyramid.
However, the data format of the map product on the market is mainly vector data and raster data. Vector data is rendered at a client, but the coding redundancy is more, and the performance bottleneck is faced when the data volume is large. The raster data is directly displayed by the client after being rendered by the server, so that the performance requirement of the client is reduced, but the server has higher pressure and the flexibility of the map style is sacrificed. There are the following disadvantages:
1. the map product has strong specialization, and the visualization difficulty of a non-professional engineer configured map is higher.
2. The grid data is difficult to change the style of the map, the vector data redrawing performance cost is high, the rendering time is long, and the map visualization configuration is not facilitated.
3. The format of the style description files of each platform is not uniform, and the map style is difficult to be copied and applied quickly.
4. Different data sources may have different spatial reference systems, making it difficult to integrate data into a single map.
Therefore, a map construction method based on vector tiles and applications thereof are needed to solve the above problems.
Disclosure of Invention
The embodiment of the application provides a map construction method based on vector tiles and application thereof, and aims to solve the problems that the existing technology is high in performance expenditure and difficult to integrate data on one map.
The core technology of the invention mainly uses vector tiles as the organization form of data. The method changes the dilemma that the raster tiles can not be rendered at the client, and enables the vector data to be rendered in a multi-thread mode through data blocking, thereby solving the problems of large performance expense and long rendering time caused by the fact that the vector data needs to be completely redrawn after the style description is changed. The data and the style description are separated, so that the data of one data source can be drawn for multiple times, and the same style description can be used in different layers. Using relational mapping, style descriptions of different platforms are compatible, so that style descriptions can be quickly copied for application
In a first aspect, the present application provides a method for vector tile based map construction, the method comprising the steps of:
s00, tiling original vector data to obtain a vector tile data source; synchronously carrying out automatic mapping conversion or user-defined mapping conversion on the original pattern description to obtain system pattern description contents corresponding to the vector tile data source;
s10, configuring layer description according to a vector tile data source and system style description contents to control the layer rendering sequence;
s20, performing deflection processing on the tile request process and the rendering process according to whether deflection is set or not so as to realize rendering and stacking of tiles of different coordinate systems in a system coordinate system;
s30, receiving layer descriptions, establishing canvas with the same quantity according to the quantity of the layer descriptions, numbering the canvas, and sequentially rendering the layers until drawing of all tiles is completed;
and S40, responding to a layer description modification instruction of a user, searching a corresponding canvas according to the modified layer description, and repeating the step S30 until redrawing is completed.
Further, in the step S00, the tiling of the original vector data specifically includes the following steps:
s01, determining a pyramid model according to a data coordinate system of the original vector data;
s02, taking a first tile range in a first layer in the pyramid model, and performing intersection operation on the first tile range and original vector data to obtain an intersection point coordinate of the original vector data and a first tile boundary;
s03, reconstructing geometric information of the original vector data of the boundary of the first tile according to the intersection point coordinates;
s04, associating the original attribute information with the geometric information, and recoding all data to generate a vector tile;
and S05, repeating the steps from S01 to S04, and generating all vector tiles by adopting the same means.
Further, in the step S00, converting the attribute describing the display level in the original style description into a level unit according to the pyramid model; mapping the attribute describing the annotation in the original style description to the annotation attribute of the style description; and analyzing the original style description through Filter attribute filtering data to obtain the filtering attribute of the layer description.
Further, in the step S20, the specific steps of the deflection processing are:
s21, acquiring a first coordinate of a screen center point in a system coordinate system, and converting according to the first coordinate to obtain a second coordinate in a data coordinate system;
s22, obtaining the row and column number of the tile with the screen center point according to the tile origin of the data coordinate system and the size of each pixel of the corresponding level in the corresponding coordinate system;
s23, calculating a third coordinate of the upper left corner of the tile where the center point of the screen is located in a data coordinate system according to the row and column numbers, and converting to obtain a fourth coordinate in a system coordinate system;
s24, acquiring coordinates of the upper left corner and the lower right corner of the screen under a system coordinate system;
s25, obtaining a tile scaling coefficient according to the corresponding relation of the size of each pixel in the corresponding coordinate system between the system coordinate system and the data coordinate system;
s26, respectively calculating a first tile size of each data tile in a system coordinate system based on the tile scaling coefficient, and calculating a second tile size based on the first tile size;
s27, obtaining a required tile range according to the first coordinate, the coordinates of the upper left corner and the lower right corner of the screen in the system coordinate system and the second size of each tile in the system coordinate system;
s28, requesting a tile where the center point of the screen is located, reducing or amplifying the obtained tile according to the tile scaling coefficient, and rendering according to a fourth coordinate of the upper left corner of the tile where the center point of the screen is located under a system coordinate system;
and S29, sequentially requesting tiles and rendering according to the positions of the rows and the columns to obtain images of all the tiles in a system coordinate system.
Further, in the step S30, the rendering specifically includes:
s31, establishing canvas with the same number according to the number of the layer descriptions, and distinguishing different layers according to row and column numbers;
s32, acquiring positions of vertexes of the upper left corner and the lower right corner of the current map container according to the current map central point and the current map level, and acquiring line sequence numbers of the first tile and the last tile;
s33, traversing the canvas from the first tile, obtaining the vector tile data source and the system style description content in the corresponding layer description, and starting to draw on the canvas;
and S34, multithreading is carried out in the step S33 until drawing of all tiles is completed.
Further, the tile first size is in pixels and the tile second size is in degrees.
In a second aspect, the present application provides a vector tile-based mapping system, comprising:
the data source module adopts a universal vector tile data standard and is used for tiling original vector data to obtain a vector tile data source;
the pattern description module is used for configuring the layer description according to the vector tile data source and the system pattern description content so as to control the layer rendering sequence;
the pattern conversion module is used for carrying out automatic mapping conversion or user-defined mapping conversion on the original pattern description to obtain system pattern description contents corresponding to the vector tile data source;
the deflection module is used for deflecting the tile request process and the rendering process according to whether deflection is set or not so as to realize rendering and stacking of tiles of different coordinate systems in a system coordinate system;
the rendering module is used for receiving the layer descriptions, establishing canvas with the same number according to the number of the layer descriptions, numbering the canvas, and sequentially rendering the layers until all the tiles are drawn; and responding to a layer description modification instruction of a user, searching a corresponding canvas according to the modified layer description, and repeating the rendering step until redrawing is completed.
In a third aspect, the present application provides an electronic system comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the above-described vector tile-based map building method.
In a fourth aspect, the present application provides a readable storage medium having stored therein a computer program comprising program code for controlling a process to execute a process, the process comprising a vector tile based map construction method according to the above.
The main contributions and innovation points of the invention are as follows: 1. compared with the prior art, the method and the device use the vector tiles as the organization form of the data. The system changes the dilemma that the raster tiles can not be rendered at the client, and enables the vector data to be rendered in a multi-thread mode through data partitioning, thereby solving the problems of large performance expense and long rendering time caused by the fact that the vector data needs to be completely redrawn after the pattern description is changed; and most importantly, the method can be used for rendering at the client, so that the pressure of the server is greatly reduced;
2. compared with the prior art, the data and the style descriptions are separated, so that the data of one data source can be drawn for multiple times, and the same style description can be used in different layers; the pattern configuration can be carried out under the visual condition, only one layer needs to be redrawn after the layer description is changed, and the redrawn is not needed, so that the rendering efficiency is improved, and the repeated rendering is avoided;
3. compared with the prior art, the method and the device have the advantages that the style description of different platforms is compatible by using the relational mapping, so that the style description can be quickly copied and applied.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more concise and understandable description of the application, and features, objects, and advantages of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow diagram of a method of vector tile based mapping according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a pyramid model;
fig. 3 is a hardware structure diagram of an electronic system according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the specification. Rather, they are merely examples of systems and methods consistent with aspects of one or more embodiments of the specification, as detailed in the appended claims.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the methods may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
The data format of the map product on the market at present is based on vector data and raster data. Vector data is rendered at a client, but the coding redundancy is more, and the performance bottleneck is faced when the data volume is large. The raster data is directly displayed by the client after being rendered by the server, so that the performance requirement of the client is reduced, but the server has higher pressure and the flexibility of the map style is sacrificed.
Based on this, the present invention solves the problems of the prior art based on vector tiles.
Example one
The present application aims to propose a method for vector tile-based map construction, in particular with reference to fig. 1, comprising the following steps:
s00, tiling the original vector data to obtain a vector tile data source; automatically mapping and converting or self-defining mapping and converting the original style description synchronously to obtain system style description contents corresponding to the vector tile data source;
specifically, as shown in fig. 2, the tiling of the original vector data specifically comprises the following steps:
s01, determining a pyramid model according to a data coordinate system of the original vector data;
s02, taking a first tile range in a first layer in the pyramid model, and performing intersection operation on the first tile range and original vector data to obtain an intersection point coordinate of the original vector data and a first tile boundary;
s03, reconstructing geometric information of the original vector data of the boundary of the first tile according to the intersection point coordinates;
s04, correlating the original attribute information with the geometric information, and recoding all data to generate vector tiles;
s05, repeating the steps from S01 to S04, and generating all vector tiles by adopting the same means;
in the present embodiment, the simple description is: determining a pyramid model according to a data coordinate system, in a first layer, taking a first tile range, performing intersection operation with original vector data to obtain the coordinates of the intersection point of the original vector data and a tile boundary, and reconstructing the geometric information of the vector data intersected with the tile boundary, wherein the geometric information is composed of the vertex of the original geometry and the intersection point of the geometry and the boundary. And associating the original attribute information of the original vector data with the new geometric information. All data (all original vector data belonging to the tile range after tile segmentation) is re-encoded to generate a vector tile. Then, the second tile is taken and the same operation is performed. And performing the work of the second layer after all the tiles of the first layer are finished.
In this embodiment, the attributes describing the display hierarchy in Sld (layer style description (Sld) is an open symbolic description rule, and is supported by most GIS software) are MinScaleDenominator and maxscale denominator, and a scale unit is adopted, and it needs to be converted into a hierarchy unit according to a pyramid model.
The attribute describing the annotation in Sld is textsymbolozer, which maps the attribute in textsymbolozer into the annotation attribute of the style description.
The Sld filters the data by the Filter attribute, and the Filter attribute of the layer description is parsed by the Filter attribute, such as PropertyIsEqualTo (equal to), propertyIsNotEqualTo (not equal to), propertyIsLessThan (less than), propertyIsGreat erThan (greater than), propertyIsLessThanOrEqualTo (less than or equal to), propertyisgreaterthanorequalto (greater than or equal to), propertyisllike (like expression), propertyiisnull (null or not), and propertyisbeen (values between).
The PointSymbolizer attribute in the Sld describes the type of a point type, the WellKno wnName attribute under the PointSymbolizer describes the shape of the point, the Fill attribute describes the filling attribute, and the Stroke attribute describes the outline attribute.
The LineSymbolizer attribute in the Sld describes the style of the line type, and the string attribute under the LineSymbolizer describes the line shape, line width and line color.
The PolygonSymbolizer attribute in the Sld describes the style of the surface type, the Fill attribute in the Fill attribute under the PolygonSymbolizer, and the Stroke attribute describes the outline attribute.
Since the style description is in json format, the style description is converted into json files to be output.
S10, configuring layer description according to a vector tile data source and system style description content to control the layer rendering sequence;
in this embodiment, layer descriptions are sequentially configured as needed, and the layer descriptions receive two parameters, a data source of the layer, and a style description. And controlling the layer rendering sequence according to the layer description configuration sequence.
S20, performing deflection processing on the tile request process and the rendering process according to whether deflection is set or not so as to realize rendering and stacking of tiles of different coordinate systems in a system coordinate system;
specifically, the deflection processing comprises the following specific steps:
s21, acquiring a first coordinate of a screen center point in a system coordinate system, and converting according to the first coordinate to obtain a second coordinate in a data coordinate system;
s22, obtaining the row and column number of the tile with the screen center point according to the tile origin of the data coordinate system and the size of each pixel of the corresponding level in the corresponding coordinate system;
s23, calculating a third coordinate of the upper left corner of the tile where the center point of the screen is located in a data coordinate system according to the row and column numbers, and converting the third coordinate into a fourth coordinate in a system coordinate system;
s24, acquiring coordinates of the upper left corner and the lower right corner of the screen under a system coordinate system;
s25, obtaining a tile scaling coefficient according to the corresponding relation of the size of each pixel in the corresponding coordinate system between the system coordinate system and the data coordinate system;
s26, respectively calculating a first tile size of each data tile in a system coordinate system based on the tile scaling coefficient, and calculating to obtain a second tile size based on the first tile size;
s27, obtaining a required tile range according to the first coordinate, the coordinates of the upper left corner and the lower right corner of the screen in the system coordinate system and the second size of each tile in the system coordinate system;
s28, requesting a tile where the center point of the screen is located, reducing or amplifying the obtained tile according to the tile scaling coefficient, and rendering according to a fourth coordinate of the upper left corner of the tile where the center point of the screen is located under a system coordinate system;
s29, sequentially requesting tiles and rendering according to the positions of the row and column numbers to obtain images of all the tiles in a system coordinate system;
s30, receiving layer descriptions, establishing canvas with the same quantity according to the quantity of the layer descriptions, numbering the canvas, and sequentially rendering the layers until drawing of all tiles is completed;
specifically, the rendering specifically comprises the following steps:
s31, establishing canvas with the same number according to the number of layer descriptions, and distinguishing different layers according to row and column numbers (assignment IDs);
s32, acquiring positions of vertexes of the upper left corner and the lower right corner of the current map container according to the current map central point and the current map level z to obtain line sequence numbers of the first tile and the last tile;
s33, traversing the canvas from the first tile, acquiring the vector tile data source and the system style description content in the corresponding layer description, and starting to draw on the canvas;
s34, multithreading is carried out in the step S33 until all tiles are drawn;
and S40, responding to a layer description modification instruction of a user, searching a corresponding canvas according to the modified layer description, and repeating the step S30 until redrawing is completed.
In this embodiment, a user modifies the layer description as required, may change the data source and the style description of the layer, finds a corresponding canvas through the layer description, and redraws the canvas according to the operation of S30.
Example two
Based on the same concept, the application also provides a map construction system based on vector tiles, which comprises:
the data source module adopts a universal vector tile data standard and is used for tiling original vector data to obtain a vector tile data source;
in the embodiment, the data source adopts the vector tile data standard which is universal to mapbox-vector-til-spec and is established by mapbox based on Google protocol buffers. The data set organization of the vector tiles is based on a pyramid model (as shown in the figure), and corresponding vector data is cut into vector data in the tile range according to the range of each tile. The organization model of a single tile element stores the geometric information and the attribute information of the vector data separately, the geometric information mainly comprises points, lines, surfaces and unknown element classes, and the metadata information comprises layer attributes and element attributes. In the method, the organization mode of the raster tile data set is referred to, the style description of the vector data is undefined, and the corresponding vector tiles can be rendered according to the style description defined by the client after the client acquires the corresponding vector tiles according to the screen range. The method changes the dilemma that the raster tiles can not be rendered at the client, and enables the vector data to be rendered in a multi-thread mode through data partitioning, thereby solving the problems of large performance expense and long rendering time caused by the fact that the vector data needs to be completely redrawn after the pattern description is changed.
The pattern description module is used for configuring the layer description according to the vector tile data source and the system pattern description content so as to control the layer rendering sequence;
in this embodiment, the module may also be referred to as an image layer description module, and the image layer description module is further divided into two small modules, a data source description module and a style description module. The data source description module describes which data source is used by this layer. The contents of the style description module are divided into two types of attributes, one type is the general attribute of the image layer, and the other type is the private attribute of different geometric types.
Wherein, the general attribute of the layer is as follows: the display level is used for describing that the data described by the attribute is displayed or hidden under the defined display level; marking attributes used for describing the content, color, position, font, collision volume and halo of data marking; and filtering the attribute, drawing the data meeting the filtering condition, and hiding the data not meeting the filtering condition.
Wherein, the layer private attribute is as follows:
point map layer:
the shape of the points is divided into rectangle, circle, triangle, diamond, regular hexagon and five-pointed star;
filling colors or pictures in the points;
the outline line shape, line width and line color of the points;
animation effect of the points;
the custom graphics of the dots, if set, the above-described attributes will fail.
Line pattern layer:
line shape, line width, line color of the line;
animation effects of the lines.
Surface layer:
filling colors or pictures in the surface;
the outer contour line shape, line width and line color of the surface;
animation effect of the faces.
The pattern conversion module is used for carrying out automatic mapping conversion or user-defined mapping conversion on the original pattern description to obtain system pattern description contents corresponding to the vector tile data source;
in this embodiment, the system supports mapping conversion of the Sld file, establishes a mapping relationship between style files through corresponding attributes, and automatically generates style description content of the system after conversion. The mapping relation of the custom attributes can be established by supporting custom mapping.
The deflection module is used for carrying out deflection processing on the tile request process and the rendering process according to whether deflection is set or not so as to realize rendering and superposition of tiles of different coordinate systems under a system coordinate system;
in the embodiment, the deflection module is used for rendering and overlaying tiles of different coordinate systems in the system coordinate system when the data tile coordinate system is inconsistent with the system coordinate system. The following is the conversion process: (the meaning of result is the size of each pixel in the corresponding coordinate system)
1) Obtaining the coordinates of the screen center point under a system coordinate system;
2) Obtaining the coordinate of the central point under the data coordinate system through coordinate transformation;
3) Obtaining the row and column number of the tile where the central point is located according to the tile origin of the data coordinate system and the result of the corresponding level, and calculating the mode:
the method comprises the following steps: (x-x origin)/(result ÷ tile width) rounding up
Line: (y-y origin/result/tile height) rounded up;
4) And calculating the coordinates of the upper left corner of the tile where the central point is located under the data coordinates according to the obtained row and column numbers. The calculation method comprises the following steps:
x (column-1) failure tile width
y: row-result tile width;
5) Obtaining the coordinates of the upper left corner of the tile in a system coordinate system through coordinate conversion;
6) Obtaining the coordinates of the upper left corner and the lower right corner of the screen under a system coordinate system;
7) Obtaining a tile scaling coefficient k according to the corresponding relation of the failure between the system coordinate system and the data coordinate system, and calculating in a mode of:
solution system coordinate system ÷ solution data coordinate system
8) Calculating the tile size (pixels) of a tile of data in a system coordinate system by:
tile size (in system coordinate system) = tile size (in data coordinate system) × k
9) Calculating the tile size (degree) of each data tile in a system coordinate system, wherein the calculation mode is as follows:
tile size (pixel) — stress system coordinate system
10 Obtaining the range of the tiles needing to be requested according to the coordinate of the central point in the system coordinate system, the coordinate of the upper left corner and the lower right corner of the screen in the system coordinate system and the tile size (degree) of each data tile in the system coordinate system;
11 Requesting the tile where the central point is located, reducing or amplifying the obtained tile according to the tile scaling coefficient k, and rendering according to the coordinate of the upper left corner of the obtained tile where the central point is located in the system coordinate system;
12 Sequentially requesting tiles and rendering according to the positions of the line numbers and the column numbers to obtain the image of the data tiles in the system coordinate system.
The rendering module is used for receiving the layer descriptions, establishing canvas with the same number according to the number of the layer descriptions, numbering the canvas, and sequentially rendering the layers until all the tiles are drawn; and responding to a layer description modification instruction of a user, searching a corresponding canvas according to the modified layer description, and repeating the rendering step until redrawing is completed.
In this embodiment, the rendering module accepts data and a style description and renders the data according to the style description on a canvas. The process is as follows: and according to the current map central point and the current map level z, obtaining the positions of the top points of the upper left corner and the lower right corner of the current map container, and obtaining the row and column numbers of the first tile and the last tile. And traversing the layer in the layer description at the position of the first tile, acquiring the layer data source and the style description, and drawing on the canvas. And repeating the steps to finish drawing all the tiles.
Preferably, after the map of the present application is completed, a snapshot may also be generated, and the snapshot is based on the toDataURL function of the canvas. The tile request of the caller can also be returned to the caller after zooming the original tile through S21-S29 steps after the map is completed.
EXAMPLE III
The present embodiment also provides an electronic system, referring to fig. 3, comprising a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to execute the computer program to perform the steps of any of the method embodiments described above.
Specifically, the processor 402 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
Memory 404 may include, among other things, mass storage 404 for data or instructions. By way of example, and not limitation, memory 404 may include a hard disk drive (hard disk drive, HDD for short), a floppy disk drive, a solid state drive (SSD for short), flash memory, an optical disk, a magneto-optical disk, tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. Memory 404 may include removable or non-removable (or fixed) media, where appropriate. Memory 404 may be internal or external to the data processing system, where appropriate. In a particular embodiment, the memory 404 is a Non-Volatile (Non-Volatile) memory. In certain embodiments, memory 404 includes Read-only memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or FLASH Memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a static random-access memory (SRAM) or a dynamic random-access memory (DRAM), where the DRAM may be a fast page mode dynamic random-access memory 404 (FPMDRAM), an extended data output dynamic random-access memory (EDODRAM), a synchronous dynamic random-access memory (SDRAM), and the like.
Memory 404 may be used to store or cache various data files for processing and/or communication use, as well as possibly computer program instructions for execution by processor 402.
The processor 402 implements any of the vector tile based mapping methods in the above embodiments by reading and executing computer program instructions stored in the memory 404.
Optionally, the electronic system may further include a transmission device 406 and an input/output device 408, wherein the transmission device 406 is connected to the processor 402, and the input/output device 408 is connected to the processor 402.
The transmitting device 406 may be used to receive or transmit data via a network. Specific examples of such networks may include wired or wireless networks provided by communication providers of the electronic systems. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmitting device 406 may be a Radio Frequency (RF) module configured to communicate with the internet via wireless.
The input and output devices 408 are used to input or output information. In this embodiment, the input information may be a vector tile data source; and synchronously carrying out automatic mapping conversion or self-defined mapping conversion on the original style description to obtain vector tiles and the like, wherein the output information can be a map and the like.
Example four
The present embodiment also provides a readable storage medium having stored therein a computer program comprising program code for controlling a process to execute a process, the process comprising the vector tile-based map building method according to the first embodiment.
It should be noted that, for specific examples in this embodiment, reference may be made to examples described in the foregoing embodiments and optional implementations, and details of this embodiment are not described herein again.
In general, the various embodiments may be implemented in hardware or special purpose circuits, software, logic or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software which may be executed by a controller, microprocessor or other computing device, although the invention is not limited thereto. While various aspects of the invention may be illustrated and described as block diagrams, flow charts, or using some other pictorial representation, it is well understood that these blocks, systems, techniques or methods described herein may be implemented in, as non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing devices, or some combination thereof.
Embodiments of the invention may be implemented by computer software executable by a data processor of the mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and/or macros can be stored in any system-readable data storage medium and they include program instructions for performing particular tasks. The computer program product may comprise one or more computer-executable components configured to perform embodiments when the program is run. The one or more computer-executable components may be at least one software code or a portion thereof. Further in this regard it should be noted that any block of the logic flow as in the figures may represent a program step, or an interconnected logic circuit, block and function, or a combination of a program step and a logic circuit, block and function. The software may be stored on physical media such as memory chips or memory blocks implemented within the processor, magnetic media such as hard or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs. The physical medium is a non-transitory medium.
It should be understood by those skilled in the art that various features of the above embodiments can be combined arbitrarily, and for the sake of brevity, all possible combinations of the features in the above embodiments are not described, but should be considered as within the scope of the present disclosure as long as there is no contradiction between the combinations of the features.
The above examples are merely illustrative of several embodiments of the present application, and the description is more specific and detailed, but not to be construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims (9)

1. The map construction method based on the vector tiles is characterized by comprising the following steps of:
s00, tiling the original vector data to obtain a vector tile data source; automatically mapping and converting or self-defining mapping and converting the original style description synchronously to obtain system style description contents corresponding to the vector tile data source;
s10, configuring layer description according to the vector tile data source and the system style description content to control the layer rendering sequence;
s20, performing deflection processing on the tile request process and the rendering process according to whether deflection is set or not so as to realize rendering and stacking of tiles of different coordinate systems in a system coordinate system;
s30, receiving the layer descriptions, establishing canvas with the same quantity according to the quantity of the layer descriptions, numbering the canvas, and sequentially rendering the layers until all tiles are drawn;
and S40, responding to a layer description modification instruction of a user, searching a corresponding canvas according to the modified layer description, and repeating the step S30 until redrawing is completed.
2. The vector tile-based map building method of claim 1, wherein in the step S00, the tiling of the original vector data comprises the following specific steps:
s01, determining a pyramid model according to a data coordinate system of the original vector data;
s02, taking a first tile range in a first layer in the pyramid model, and performing intersection operation on the first tile range and the original vector data to obtain an intersection point coordinate of the original vector data and a first tile boundary;
s03, reconstructing geometric information of the original vector data of the boundary of the first tile according to the intersection point coordinates;
s04, associating the original attribute information with the geometric information, and recoding all data to generate vector tiles;
and S05, repeating the steps from S01 to S04, and generating all vector tiles by adopting the same means.
3. The vector tile-based mapping method of claim 1, wherein in the S00 step, an attribute describing a display level in an original style description is converted into a level unit according to the pyramid model; mapping the attribute describing the annotation in the original style description to the annotation attribute of the style description; and analyzing the original style description through Filter attribute filtering data to obtain the filtering attribute of the layer description.
4. The vector tile-based mapping method of claim 1, wherein in the step S20, the deflecting process comprises the following specific steps:
s21, acquiring a first coordinate of a screen center point in a system coordinate system, and converting according to the first coordinate to obtain a second coordinate in a data coordinate system;
s22, obtaining the row and column number of the tile with the central point of the screen according to the tile origin of the data coordinate system and the size of each pixel of the corresponding level in the corresponding coordinate system;
s23, calculating a third coordinate of the upper left corner of the tile where the screen center point is located in a data coordinate system according to the row and column numbers, and converting the third coordinate into a fourth coordinate in a system coordinate system;
s24, obtaining coordinates of the upper left corner and the lower right corner of the screen under a system coordinate system;
s25, obtaining a tile scaling coefficient according to the corresponding relation of the size of each pixel in the corresponding coordinate system between the system coordinate system and the data coordinate system;
s26, respectively calculating a first tile size of each data tile in a system coordinate system based on the tile scaling coefficient, and calculating a second tile size based on the first tile size;
s27, obtaining a required tile range according to the first coordinate, the coordinates of the upper left corner and the lower right corner of the screen in the system coordinate system and the second size of each tile in the system coordinate system;
s28, requesting the tile where the screen center point is located, reducing or amplifying the obtained tile according to the tile scaling coefficient, and rendering according to a fourth coordinate of the upper left corner of the tile where the screen center point is located in a system coordinate system;
and S29, sequentially requesting tiles and rendering according to the positions of the rows and the columns to obtain images of all the tiles in a system coordinate system.
5. The vector tile-based map building method of claim 4, wherein in the step S30, the rendering comprises the following specific steps:
s31, establishing canvas with the same quantity according to the quantity of layer descriptions, and distinguishing different layers according to row and column numbers;
s32, acquiring positions of vertexes of the upper left corner and the lower right corner of the current map container according to the current map central point and the current map level, and acquiring line sequence numbers of the first tile and the last tile;
s33, traversing the canvas from the first tile, obtaining the vector tile data source and the system style description content in the corresponding layer description, and starting to draw on the canvas;
and S34, multithreading is carried out in the step S33 until all the tiles are drawn.
6. The vector tile-based mapping method of claim 4, wherein the tile first size is in pixels and the tile second size is in degrees.
7. A vector tile based mapping system, comprising:
the data source module adopts a general vector tile data standard and is used for tiling original vector data to obtain a vector tile data source;
the pattern description module is used for configuring the layer description according to the vector tile data source and the system pattern description content so as to control the layer rendering sequence;
the pattern conversion module is used for carrying out automatic mapping conversion or user-defined mapping conversion on the original pattern description to obtain system pattern description contents corresponding to the vector tile data source;
the deflection module is used for deflecting the tile request process and the rendering process according to whether deflection is set or not so as to realize rendering and stacking of tiles of different coordinate systems in a system coordinate system;
the rendering module is used for receiving the layer descriptions, establishing canvas with the same number according to the number of the layer descriptions, numbering the canvas, and sequentially rendering the layers until all the tiles are drawn; and responding to a layer description modification instruction of a user, searching a corresponding canvas according to the modified layer description, and repeating the rendering step until redrawing is completed.
8. An electronic system comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the vector tile based mapping method of any of claims 1 to 6.
9. A readable storage medium, having stored thereon a computer program comprising program code for controlling a process to execute a process, the process comprising the vector tile based mapping method according to any of claims 1 to 6.
CN202211482375.7A 2022-11-24 2022-11-24 Map construction method based on vector tiles and application thereof Pending CN115761166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211482375.7A CN115761166A (en) 2022-11-24 2022-11-24 Map construction method based on vector tiles and application thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211482375.7A CN115761166A (en) 2022-11-24 2022-11-24 Map construction method based on vector tiles and application thereof

Publications (1)

Publication Number Publication Date
CN115761166A true CN115761166A (en) 2023-03-07

Family

ID=85336969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211482375.7A Pending CN115761166A (en) 2022-11-24 2022-11-24 Map construction method based on vector tiles and application thereof

Country Status (1)

Country Link
CN (1) CN115761166A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116188667A (en) * 2023-03-13 2023-05-30 北京国研数通软件技术有限公司 Method for realizing map grid tile filter based on GLSL (global navigation satellite system) shader

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116188667A (en) * 2023-03-13 2023-05-30 北京国研数通软件技术有限公司 Method for realizing map grid tile filter based on GLSL (global navigation satellite system) shader
CN116188667B (en) * 2023-03-13 2023-07-21 北京国研数通软件技术有限公司 Method for realizing map grid tile filter based on GLSL (global navigation satellite system) shader

Similar Documents

Publication Publication Date Title
US10861232B2 (en) Generating a customized three-dimensional mesh from a scanned object
CN108352082B (en) Techniques to crowd 3D objects into a plane
CN110956673A (en) Map drawing method and device
US9721363B2 (en) Encoding polygon data for fast retrieval and rendering
US9495767B2 (en) Indexed uniform styles for stroke rendering
JP5562439B2 (en) Spatial data processing method and apparatus
KR101591427B1 (en) Method for Adaptive LOD Rendering in 3-D Terrain Visualization System
CN112102489B (en) Navigation interface display method and device, computing equipment and storage medium
CN109118588B (en) Automatic color LOD model generation method based on block decomposition
CN113628331B (en) Data organization and scheduling method for photogrammetry model in illusion engine
US11270507B1 (en) Rendering textures utilizing sharp displacement mapping
CN109636894B (en) Dynamic three-dimensional thermodynamic calculation method and system based on pixel rasterization
US10839590B2 (en) Gutter space padding for texture atlases
CN115761166A (en) Map construction method based on vector tiles and application thereof
US20160307294A1 (en) Systems and Methods for Displaying Patterns of Recurring Graphics on Digital Maps
CN109712225B (en) Rendering method, device, equipment and storage medium of surface object
CN112115226B (en) Map rendering method and map rendering device
CN112907451A (en) Image processing method, image processing device, computer equipment and storage medium
CN112002007A (en) Model obtaining method and device based on air-ground image, equipment and storage medium
CN116758206A (en) Vector data fusion rendering method and device, computer equipment and storage medium
CN106780693B (en) Method and system for selecting object in three-dimensional scene through drawing mode
CN112883297B (en) Network topology display method and device and electronic equipment
CN105474268A (en) Image display system
JP3149389B2 (en) Method and apparatus for overlaying a bitmap image on an environment map
CN114359456B (en) Picture pasting method and device, electronic equipment and readable 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