CN112862940A - Map rendering method, map rendering device, map rendering equipment and storage medium - Google Patents
Map rendering method, map rendering device, map rendering equipment and storage medium Download PDFInfo
- Publication number
- CN112862940A CN112862940A CN202110261212.5A CN202110261212A CN112862940A CN 112862940 A CN112862940 A CN 112862940A CN 202110261212 A CN202110261212 A CN 202110261212A CN 112862940 A CN112862940 A CN 112862940A
- Authority
- CN
- China
- Prior art keywords
- rendered
- layer
- rendering
- map
- data source
- 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
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 236
- 238000000034 method Methods 0.000 title claims abstract description 33
- 238000010276 construction Methods 0.000 claims abstract description 39
- 230000007246 mechanism Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 8
- 230000004044 response Effects 0.000 claims description 2
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/05—Geographic models
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Remote Sensing (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a map rendering method, a map rendering device, map rendering equipment and a storage medium, wherein the method comprises the following steps: responding to the received map construction request, and determining a data source to be rendered; respectively creating layers to be rendered for each data source to be rendered, and creating a map view window; loading all layers to be rendered to a map view window; when a map rendering instruction is received, rendering the layer to be rendered in the map view window to generate the map view, so that the used rendering resources are reduced more effectively, and the rendering efficiency is improved.
Description
Technical Field
The present invention relates to the field of image rendering technologies, and in particular, to a map rendering method, apparatus, device, and storage medium.
Background
In the related fields of GIS, mapping and the like, besides loading various online maps, various raster data and vector data, such as shp data, tif data and the like, also need to be loaded. In addition to this, there are many data that can be abstracted into layers for management, such as boat form for water survey, aerial survey aircraft, compass, scale, etc. How to quickly manage and efficiently render these online maps and data becomes a problem that must be addressed for developing such application software.
In the prior art, image rendering is generally performed directly layer by layer each time map data is changed to obtain target map data. However, the above method needs to re-render each layer of image layer every time data is updated, which consumes more rendering resources and has lower rendering efficiency.
Disclosure of Invention
The invention provides a map rendering method, a map rendering device, map rendering equipment and a storage medium, and solves the technical problems that in the prior art, due to the fact that data updating needs to be carried out on each layer of map layer again, rendering resources are more, and rendering efficiency is low.
The invention provides a map rendering method in a first aspect, which comprises the following steps:
responding to the received map construction request, and determining a data source to be rendered;
respectively creating a layer to be rendered for each data source to be rendered, and creating a map view window;
loading all layers to be rendered to the map view window;
and when a map rendering instruction is received, rendering the layer to be rendered in the map view window to generate a map view.
Optionally, the step of determining a data source to be rendered in response to the received map construction request includes:
when a map construction request is received, judging whether a data source to be rendered corresponding to the map construction request exists in a preset database or not;
if the data source exists, loading the data source to be rendered from the preset database;
and if the data source to be rendered does not exist, responding to the received data source construction instruction, and newly building the data source to be rendered.
Optionally, each layer to be rendered has a corresponding layer state, and the map view window includes a layer manager, a layer rendering manager, and a layer state manager; the step of loading all layers to be rendered to the map view window includes:
adding all the layers to be rendered to a layer manager;
receiving a user selection instruction, determining a rendering engine corresponding to each layer to be rendered, and registering the rendering engine to a layer rendering manager;
and registering the layer state corresponding to each layer to be rendered to a layer state manager.
Optionally, the map rendering instruction includes a global rendering instruction, and the step of rendering the layer to be rendered in the map view window to generate the map view when the map rendering instruction is received includes:
when the global rendering instruction is received, traversing the layer state corresponding to each layer to be rendered;
if the layer state is displayed to be in the map view window and a rendering cache mechanism is not started, determining first data to be drawn corresponding to each layer to be rendered through space query;
calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each first data to be rendered to obtain at least one first rendered picture and loading the first rendered picture to a view buffer area of the map view window;
and acquiring all the first rendered pictures in the view buffer area through a view listener in the map view window, and combining the first rendered pictures to generate the map view.
Optionally, the map rendering instruction includes a global rendering instruction, and the step of rendering the layer to be rendered in the map view window to generate the map view when the map rendering instruction is received includes:
when the global rendering instruction is received, traversing the layer state corresponding to each layer to be rendered;
if the layer state is displayed to be in the map view window and a rendering cache mechanism is started, determining second data to be drawn corresponding to each layer to be rendered through space query; the second data to be drawn is within a preset scale range;
creating a layer buffer area corresponding to the layer to be rendered;
calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each second data to be drawn to obtain at least one second rendered picture and storing the second rendered picture in the layer buffer area;
when all the layer states are displayed as rendering completion, loading all the second rendered pictures in the layer buffer area to a view buffer area of the map view window;
and acquiring all the second rendered pictures in the view buffer area through a view monitor in the map view window and combining the second rendered pictures to generate the map view.
Optionally, the map rendering instruction further includes a partial rendering instruction, and the step of rendering the layer to be rendered in the map view window to generate the map view when the map rendering instruction is received includes:
when a local rendering instruction is received, determining a local layer corresponding to the local rendering instruction from all layers to be rendered;
if the layer state corresponding to the local layer is displayed to be in the map view window and a rendering cache mechanism is started, determining local data corresponding to the local layer through space query, and creating a local buffer area corresponding to the local layer;
calling a rendering engine corresponding to the local image layer to render the local data to obtain at least one third rendered picture and storing the third rendered picture in the local buffer area;
when the layer state corresponding to the local layer is displayed as rendering completion, loading all the third rendered pictures in the local buffer area to a view buffer area of the map view window;
obtaining all of the third rendered pictures and history buffered pictures in the view buffer by a view listener in the map view window;
and combining the third rendered picture and the history buffer picture according to the layer sequence to generate a map view.
A second aspect of the present invention provides a map rendering apparatus, including:
the data source to be rendered determining module is used for responding to the received map construction request and determining a data source to be rendered;
the creating module is used for respectively creating layers to be rendered for each data source to be rendered and creating a map view window;
the layer loading module is used for loading all the layers to be rendered to the map view window;
and the rendering module is used for rendering the layer to be rendered in the map view window to generate a map view when a map rendering instruction is received.
Optionally, the data source to be rendered determining module includes:
the data source to be rendered judgment sub-module is used for judging whether a data source to be rendered corresponding to the map construction request exists in a preset database or not when the map construction request is received;
the data source to be rendered judging submodule is used for loading the data source to be rendered from the preset database if the data source to be rendered judging submodule exists;
and the data source to be rendered is newly built with a sub-module, and the sub-module is used for responding to the received data source construction instruction and newly building the data source to be rendered if the data source to be rendered does not exist.
A third aspect of the present invention provides an electronic device comprising a memory and a processor, the memory having stored therein a computer program, which, when executed by the processor, causes the processor to perform the steps of the map rendering method according to any one of the first aspect of the present invention.
A fourth aspect of the invention provides a computer readable storage medium having stored thereon a computer program which, when executed by the processor, implements a map rendering method as defined in any one of the first aspects of the invention.
According to the technical scheme, the invention has the following advantages:
when a map construction request is received, data sources to be rendered are determined according to the map construction request, corresponding layers to be rendered are respectively created for the data sources to be rendered, a map view window is created at the same time, the data sources to be rendered are loaded into the map view window, and when a map rendering instruction is received, the layers to be rendered are rendered in the map view window so as to generate a map view. Therefore, the technical problems that in the prior art, due to the fact that data updating needs to be carried out on each layer of image layer again, rendering resources are more and rendering efficiency is lower are solved, the used rendering resources are more effectively reduced, and the rendering efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating steps of a map rendering method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a map rendering method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a map rendering apparatus according to a third embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a map rendering method, a map rendering device, map rendering equipment and a storage medium, which are used for solving the technical problems of more rendering resources and lower rendering efficiency caused by the fact that each layer of map layer needs to be re-rendered every time data is updated in the prior art.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a map rendering method according to an embodiment of the present invention.
The invention provides a map rendering method, which comprises the following steps:
the data source to be rendered is a data set which abstracts data, and comprises various data such as vector data, tile data and custom data.
In the embodiment of the invention, after a map construction request input by a user is received, a data source to be rendered, in which target data are stored, can be determined to be acquired according to the type of the data source required by the map construction request.
the layer to be rendered refers to a layer providing a function of packaging a data source to be rendered, such as a vector data layer, a tile data layer, and a custom data layer.
After the data sources to be rendered are determined, layers to be rendered can be respectively created for each data source to be rendered, and a map view window is created to prepare for rendering the layers to be rendered in the map view window.
103, loading all layers to be rendered to a map view window;
after the map view window is created, all layers to be rendered can be loaded to the map view window, so that the state of each layer to be rendered and the type of a rendering engine can be registered.
And 104, when a map rendering instruction is received, rendering the layer to be rendered in the map view window to generate the map view.
In a specific implementation, after all layers to be rendered are loaded in a map view window, if a map rendering instruction is received, the layers to be rendered can be rendered through a corresponding type renderer in the map view window to obtain pictures corresponding to the layers to be rendered, and the pictures are loaded according to a layer sequence to generate a map view.
In the embodiment of the invention, when a map construction request is received, data sources to be rendered are determined according to the map construction request, corresponding layers to be rendered are respectively created for each data source to be rendered, a map view window is created at the same time, each data source to be rendered is loaded into the map view window, and when a map rendering instruction is received, the layers to be rendered are rendered in the map view window so as to generate the map view. Therefore, the technical problems that in the prior art, due to the fact that data updating needs to be carried out on each layer of image layer again, rendering resources are more and rendering efficiency is lower are solved, the used rendering resources are more effectively reduced, and the rendering efficiency is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating a step of a map rendering method according to a second embodiment of the present invention.
The invention provides a map rendering method, which comprises the following steps:
optionally, step 201 may comprise the following sub-steps:
when a map construction request is received, judging whether a data source to be rendered corresponding to the map construction request exists in a preset database or not;
if yes, loading a data source to be rendered from a preset database;
and if the data source to be rendered does not exist, responding to the received data source construction instruction, and newly building a data source to be rendered.
It should be noted that the preset database includes, but is not limited to, data sources such as vector data, tile data, or custom data.
In the embodiment of the invention, when a map construction request is received, whether a data source to be rendered corresponding to the map construction request exists or not can be judged from a preset database, and if the data source to be rendered exists, the data source to be rendered can be obtained from the preset database and loaded; if the data source does not exist, responding to a data source construction instruction input by a user, and newly constructing the required data source.
in the embodiment of the present invention, after all data sources to be rendered are acquired, layers to be rendered may be respectively created for each data source to be rendered, a map view window may be created at the same time, and a corresponding layer state may be set for each layer to be rendered.
The map view window is responsible for displaying contents generated by the rendering engine, including layers and other data, and supports functions of translation, zooming, full map display, display of various online maps, refreshing of display contents and the like.
Further, each layer to be rendered has a corresponding layer state, the map view window includes a layer manager, a layer rendering manager, and a layer state manager, and step 103 in the first embodiment may be replaced with the following step 203 and 205:
the layer manager is responsible for managing layers and supporting functions of adding, deleting, acquiring all layer ranges, setting draft layers, acquiring draft layers and the like.
In one example of the present invention, to facilitate management of layers to be rendered, all layers to be rendered may be added to the layer manager.
the layer rendering manager is used for managing a rendering engine, and can register and unload a certain layer renderer and also can customize the rendering sequence of each layer renderer. The rendering engine can enable each rendering engine to execute rendering action on each layer through the layer rendering manager, and the rendering engine determines whether to start a rendering cache mechanism switch or not and whether to use a parallel rendering switch according to the visibility, the minimum visibility scale and the maximum visibility scale of the layer state.
After all layers to be rendered are added to the layer manager, a selection instruction of a user can be received, corresponding rendering engines are respectively selected for each layer to be rendered, and each rendering engine is registered to the layer rendering manager.
It is worth mentioning that the layer states include a built-in visible state, a minimum visible scale, a maximum visible scale, whether to start a rendering cache mechanism switch, whether to use a parallel rendering switch, and other self-defined states; the layer state manager may provide the functionality to manage the state of each layer as well as to save and reload the state locally.
In the embodiment of the present invention, the layer state level corresponding to each layer to be rendered may be sent to the layer state manager, so as to display the layer state corresponding to each layer to be rendered.
And step 206, when a map rendering instruction is received, rendering the layer to be rendered in the map view window to generate the map view.
In one example of the present invention, the map rendering instructions include global rendering instructions, and step 206 may include the following sub-steps S11-S14:
s11, traversing the layer state corresponding to each layer to be rendered when receiving the global rendering instruction;
s12, if the layer state is displayed to be in a map view window and a rendering cache mechanism is not started, determining first data to be rendered corresponding to each layer to be rendered through space query;
s13, calling rendering engines corresponding to layers to be rendered to perform parallel rendering on each first data to be rendered to obtain at least one first rendered picture and loading the first rendered picture into a view buffer area of a map view window;
and S14, acquiring all the first rendered pictures in the view buffer area through the view listener in the map view window, and combining the first rendered pictures to generate the map view.
Spatial querying is a special query supported by geographic and spatial databases. The query statements of spatial queries differ from non-spatial SQL queries in many important respects, the two most important differences being: allowing the use of geometry type data such as points, lines, polygons, and queries to refer to spatial relationships between geometry types. The query result is represented graphically based on two-dimensional or three-dimensional spatial data as a query basis.
In the embodiment of the invention, after the global rendering instruction is received, the layer state corresponding to each layer to be rendered can be traversed in sequence, and if the layer state is displayed to be positioned in a map view window and a rendering cache mechanism is not started, the data to be rendered required in each layer to be rendered can be inquired through space. Calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each data to be rendered to obtain at least one first rendered picture, loading the first rendered picture to a view buffer area of a map view window, and finally acquiring all the first rendered pictures in the view buffer area through a view monitor in the map view window and loading the first rendered pictures according to the layer sequence to generate the map view.
Each rendering engine has a rendering context, which includes the rendering state: and each rendering engine automatically updates the state of the context thereof, and can judge whether the drawing is finished or not according to the states.
In another example of the present invention, the map rendering instructions include global rendering instructions, and step 206 may include the following sub-steps S21-S26:
s21, traversing the layer state corresponding to each layer to be rendered when receiving the global rendering instruction;
s22, if the layer state is displayed to be in a map view window and a rendering cache mechanism is started, determining second data to be drawn corresponding to each layer to be rendered through space query; the second data to be drawn is within the range of a preset scale;
s23, creating an image layer buffer area corresponding to the image layer to be rendered;
s24, calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each second data to be rendered, so as to obtain at least one second rendered picture and store the second rendered picture in the layer buffer area;
s25, when all layer states are displayed as rendering completion, loading all second rendered pictures in the layer buffer area to a view buffer area of the map view window;
and S26, acquiring all second rendered pictures in the view buffer area through the view listener in the map view window, and combining the second rendered pictures to generate the map view.
In the embodiment of the invention, after a global rendering instruction is received, the layer state corresponding to each layer to be rendered is traversed, and if the layer state is displayed to be in a map view window and a rendering cache mechanism is started, the data to be rendered corresponding to each layer to be rendered can be determined through space query; the second data to be drawn is within the range of a preset scale and the state of the layer is displayed to be visible; and creating a layer buffer area corresponding to the layer to be rendered, calling a rendering engine corresponding to the layer to be rendered and performing parallel rendering on each second data to be drawn to obtain at least one second rendered picture and storing the second rendered picture in the layer buffer area.
If all the layer states are displayed as rendering completion, all the second rendered pictures in the layer buffer area can be loaded into a view buffer area in the map view window; and acquiring all second rendered pictures in the view buffer area through a view monitor in the map view window and combining the second rendered pictures according to the layer sequence, thereby generating the map view.
In an alternative embodiment of the present invention, the map rendering instructions further include partial rendering instructions, and step 206 may include the following sub-steps S31-S36:
s31, when a local rendering instruction is received, determining a local layer corresponding to the local rendering instruction from all layers to be rendered;
s32, if the layer state corresponding to the local layer is displayed to be in a map view window and a rendering cache mechanism is started, determining local data corresponding to the local layer through space query, and creating a local buffer area corresponding to the local layer;
s33, calling a rendering engine corresponding to the local layer to render the local data to obtain at least one third rendered picture and storing the third rendered picture in a local buffer area;
s34, when the layer state corresponding to the local layer is displayed as rendering completion, loading all third rendered pictures in the local buffer area to a view buffer area of the map view window;
s35, acquiring all third rendered pictures and history buffer pictures in the view buffer area through a view listener in the map view window;
and S36, combining the third rendered picture and the history buffer picture according to the layer sequence to generate a map view.
In the embodiment of the invention, if a local rendering instruction is received, a local layer specified by the local rendering instruction can be determined from all layers to be rendered, and the layer state of the local layer is displayed in a map view window and a rendering cache mechanism is started, at this time, local data corresponding to the local layer can be determined through space query, a rendering engine is called to render the local data, and at least one third rendered picture is obtained and stored in a local buffer area; and when the layer state corresponding to the local layer is displayed as rendering completion, loading all the third rendered pictures into a view buffer area of a map view window, acquiring all the third rendered pictures and history buffer pictures in the view buffer area through a view monitor in the map view window, and combining the third rendered pictures and the history buffer pictures according to the layer sequence to generate the map view.
Wherein the history buffer picture refers to a first rendered picture or a second rendered picture that has been stored in the view buffer.
In the embodiment of the invention, when a map construction request is received, data sources to be rendered are determined according to the map construction request, corresponding layers to be rendered are respectively created for each data source to be rendered, a map view window is created at the same time, each data source to be rendered is loaded into the map view window, and when a map rendering instruction is received, the layers to be rendered are rendered in the map view window so as to generate the map view. Therefore, the technical problems that in the prior art, due to the fact that data updating needs to be carried out on each layer of image layer again, rendering resources are more and rendering efficiency is lower are solved, the used rendering resources are more effectively reduced, and the rendering efficiency is improved.
Referring to fig. 3, fig. 3 is a block diagram of a map rendering apparatus according to a third embodiment of the present invention.
The invention provides a map rendering device, comprising:
a data source to be rendered determining module 301, configured to respond to the received map construction request and determine a data source to be rendered;
a creating module 302, configured to create a layer to be rendered for each data source to be rendered, and create a map view window;
the layer loading module 303 is configured to load all layers to be rendered to a map view window;
the rendering module 304 is configured to, when a map rendering instruction is received, render the layer to be rendered in the map view window to generate a map view.
Optionally, the data source to be rendered determining module 301 includes:
the data source to be rendered judgment sub-module is used for judging whether a data source to be rendered corresponding to the map construction request exists in a preset database or not when the map construction request is received;
the data source to be rendered judging submodule is used for loading the data source to be rendered from a preset database if the data source to be rendered judging submodule exists;
and the data source to be rendered is newly built with the sub-module, and the sub-module is used for responding to the received data source construction instruction and newly building the data source to be rendered if the data source to be rendered does not exist.
Optionally, each layer to be rendered has a corresponding layer state, and the map view window includes a layer manager, a layer rendering manager, and a layer state manager; the layer loading module 303 includes:
the layer loading submodule is used for adding all layers to be rendered to the layer manager;
the rendering engine selection submodule is used for receiving a user selection instruction, determining a rendering engine corresponding to each layer to be rendered, and registering the rendering engine to the layer rendering manager;
and the layer state registration submodule is used for registering the layer state corresponding to each layer to be rendered to the layer state manager.
Optionally, the map rendering instructions include global rendering instructions, and the rendering module 304 includes:
the first layer state traversing submodule is used for traversing the layer state corresponding to each layer to be rendered when a global rendering instruction is received;
the first data to be rendered determining submodule is used for determining first data to be rendered corresponding to each layer to be rendered through space query if the layer state is displayed to be in a map view window and a rendering cache mechanism is not started;
the first rendering submodule is used for calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each first data to be rendered to obtain at least one first rendered picture and loading the first rendered picture into a view buffer area of a map view window;
and the first combination sub-module is used for acquiring all the first rendered pictures in the view buffer area through the view monitor in the map view window and combining the first rendered pictures to generate the map view.
Optionally, the map rendering instructions include global rendering instructions, and the rendering module 304 includes:
the first layer state traversing submodule is used for traversing the layer state corresponding to each layer to be rendered when a global rendering instruction is received;
the first data to be rendered determining submodule is used for determining second data to be rendered corresponding to each layer to be rendered through space query if the layer state is displayed to be in a map view window and a rendering cache mechanism is started; the second data to be drawn is within the range of a preset scale;
the layer buffer area creating submodule is used for creating a layer buffer area corresponding to a layer to be rendered;
the second rendering submodule is used for calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each second data to be rendered so as to obtain at least one second rendered picture and storing the second rendered picture in the layer buffer area;
the second loading submodule is used for loading all second rendered pictures in the map layer buffer area to the view buffer area of the map view window when all the layer states are displayed as rendering completion;
and the second combination sub-module is used for acquiring all second rendered pictures in the view buffer area through the view monitor in the map view window and combining the second rendered pictures to generate the map view.
Optionally, the map rendering instructions further include partial rendering instructions, and the rendering module 304 includes:
the local layer determining submodule is used for determining a local layer corresponding to the local rendering instruction from all layers to be rendered when the local rendering instruction is received;
the local data determining submodule is used for determining local data corresponding to the local image layer through space query and creating a local buffer area corresponding to the local image layer if the image layer state corresponding to the local image layer is displayed to be in a map view window and a rendering cache mechanism is started;
the third rendering submodule is used for calling a rendering engine corresponding to the local layer to render the local data to obtain at least one third rendered picture and storing the third rendered picture in a local buffer area;
the third loading submodule is used for loading all third rendered pictures in the local buffer area into the view buffer area of the map view window when the layer state corresponding to the local layer is displayed as rendering completion;
the picture acquisition submodule is used for acquiring all third rendered pictures and history buffer pictures in the view buffer area through a view monitor in the map view window;
and the view combination sub-module is used for combining the third rendered picture and the history buffer picture according to the layer sequence to generate a map view.
An embodiment of the present invention further provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the map rendering method according to any embodiment of the present invention.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a map rendering method according to any embodiment of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A map rendering method, comprising:
responding to the received map construction request, and determining a data source to be rendered;
respectively creating a layer to be rendered for each data source to be rendered, and creating a map view window;
loading all layers to be rendered to the map view window;
and when a map rendering instruction is received, rendering the layer to be rendered in the map view window to generate a map view.
2. The map rendering method of claim 1, wherein the step of determining a data source to be rendered in response to the received map construction request comprises:
when a map construction request is received, judging whether a data source to be rendered corresponding to the map construction request exists in a preset database or not;
if the data source exists, loading the data source to be rendered from the preset database;
and if the data source to be rendered does not exist, responding to the received data source construction instruction, and newly building the data source to be rendered.
3. The map rendering method of claim 1, wherein each layer to be rendered has a corresponding layer state, and the map view window comprises a layer manager, a layer rendering manager, and a layer state manager; the step of loading all layers to be rendered to the map view window includes:
adding all the layers to be rendered to a layer manager;
receiving a user selection instruction, determining a rendering engine corresponding to each layer to be rendered, and registering the rendering engine to a layer rendering manager;
and registering the layer state corresponding to each layer to be rendered to a layer state manager.
4. The map rendering method according to claim 3, wherein the map rendering instruction comprises a global rendering instruction, and the step of rendering the layer to be rendered in the map view window to generate the map view when the map rendering instruction is received comprises:
when the global rendering instruction is received, traversing the layer state corresponding to each layer to be rendered;
if the layer state is displayed to be in the map view window and a rendering cache mechanism is not started, determining first data to be drawn corresponding to each layer to be rendered through space query;
calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each first data to be rendered to obtain at least one first rendered picture and loading the first rendered picture to a view buffer area of the map view window;
and acquiring all the first rendered pictures in the view buffer area through a view listener in the map view window, and combining the first rendered pictures to generate the map view.
5. The map rendering method according to claim 3, wherein the map rendering instruction comprises a global rendering instruction, and the step of rendering the layer to be rendered in the map view window to generate the map view when the map rendering instruction is received comprises:
when the global rendering instruction is received, traversing the layer state corresponding to each layer to be rendered;
if the layer state is displayed to be in the map view window and a rendering cache mechanism is started, determining second data to be drawn corresponding to each layer to be rendered through space query; the second data to be drawn is within a preset scale range;
creating a layer buffer area corresponding to the layer to be rendered;
calling a rendering engine corresponding to the layer to be rendered to perform parallel rendering on each second data to be drawn to obtain at least one second rendered picture and storing the second rendered picture in the layer buffer area;
when all the layer states are displayed as rendering completion, loading all the second rendered pictures in the layer buffer area to a view buffer area of the map view window;
and acquiring all the second rendered pictures in the view buffer area through a view monitor in the map view window and combining the second rendered pictures to generate the map view.
6. The map rendering method according to claim 3, wherein the map rendering instruction further includes a partial rendering instruction, and the step of rendering the layer to be rendered in the map view window to generate the map view when the map rendering instruction is received comprises:
when a local rendering instruction is received, determining a local layer corresponding to the local rendering instruction from all layers to be rendered;
if the layer state corresponding to the local layer is displayed to be in the map view window and a rendering cache mechanism is started, determining local data corresponding to the local layer through space query, and creating a local buffer area corresponding to the local layer;
calling a rendering engine corresponding to the local image layer to render the local data to obtain at least one third rendered picture and storing the third rendered picture in the local buffer area;
when the layer state corresponding to the local layer is displayed as rendering completion, loading all the third rendered pictures in the local buffer area to a view buffer area of the map view window;
obtaining all of the third rendered pictures and history buffered pictures in the view buffer by a view listener in the map view window;
and combining the third rendered picture and the history buffer picture according to the layer sequence to generate a map view.
7. A map rendering apparatus, comprising:
the data source to be rendered determining module is used for responding to the received map construction request and determining a data source to be rendered;
the creating module is used for respectively creating layers to be rendered for each data source to be rendered and creating a map view window;
the layer loading module is used for loading all the layers to be rendered to the map view window;
and the rendering module is used for rendering the layer to be rendered in the map view window to generate a map view when a map rendering instruction is received.
8. The map rendering method of claim 7, wherein the data source to be rendered determination module comprises:
the data source to be rendered judgment sub-module is used for judging whether a data source to be rendered corresponding to the map construction request exists in a preset database or not when the map construction request is received;
the data source to be rendered judging submodule is used for loading the data source to be rendered from the preset database if the data source to be rendered judging submodule exists;
and the data source to be rendered is newly built with a sub-module, and the sub-module is used for responding to the received data source construction instruction and newly building the data source to be rendered if the data source to be rendered does not exist.
9. An electronic device, comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the map rendering method of any of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by the processor, carries out a map rendering method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110261212.5A CN112862940A (en) | 2021-03-10 | 2021-03-10 | Map rendering method, map rendering device, map rendering equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110261212.5A CN112862940A (en) | 2021-03-10 | 2021-03-10 | Map rendering method, map rendering device, map rendering equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112862940A true CN112862940A (en) | 2021-05-28 |
Family
ID=75993951
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110261212.5A Pending CN112862940A (en) | 2021-03-10 | 2021-03-10 | Map rendering method, map rendering device, map rendering equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112862940A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113436344A (en) * | 2021-06-25 | 2021-09-24 | 广联达科技股份有限公司 | Display method and system of reference view and image display equipment |
CN113570733A (en) * | 2021-08-05 | 2021-10-29 | 稿定(厦门)科技有限公司 | WebGL-based graphic rendering method, device and system |
CN114064172A (en) * | 2021-11-08 | 2022-02-18 | 北京沃东天骏信息技术有限公司 | Data rendering method and device |
CN114170360A (en) * | 2021-11-30 | 2022-03-11 | 埃洛克航空科技(北京)有限公司 | Merging and rendering method and system suitable for multiple terrain data and electronic equipment |
CN114385774A (en) * | 2022-01-17 | 2022-04-22 | 深圳依时货拉拉科技有限公司 | Map updating method, map updating device, storage medium and electronic equipment |
CN114387382A (en) * | 2021-12-31 | 2022-04-22 | 桂林长海发展有限责任公司 | Method, system, storage medium, and electronic device for rendering radar scan animation |
CN117687771A (en) * | 2023-07-24 | 2024-03-12 | 荣耀终端有限公司 | Buffer allocation device, electronic equipment and storage medium |
CN118279461A (en) * | 2024-05-31 | 2024-07-02 | 杭州靖安科技有限公司 | GIS real-time map generation method, system, device and medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103035164A (en) * | 2012-12-24 | 2013-04-10 | 广东威创视讯科技股份有限公司 | Rendering method and system of geographic information system |
CN103295466A (en) * | 2012-03-02 | 2013-09-11 | 阿里巴巴集团控股有限公司 | Method and device for partial rendering on map |
US9317175B1 (en) * | 2013-09-24 | 2016-04-19 | Amazon Technologies, Inc. | Integration of an independent three-dimensional rendering engine |
CN109074376A (en) * | 2016-03-28 | 2018-12-21 | 微软技术许可有限责任公司 | Context ink marks mark in drawing interface |
CN110032614A (en) * | 2019-04-18 | 2019-07-19 | 成都四方伟业软件股份有限公司 | Map vector rendering method and device based on wasm |
CN110347464A (en) * | 2019-06-26 | 2019-10-18 | 腾讯科技(深圳)有限公司 | User interface rendering method, device, medium and the electronic equipment of application program |
CN110570506A (en) * | 2019-09-11 | 2019-12-13 | 珠海金山网络游戏科技有限公司 | Map resource management method and device, computing equipment and storage medium |
CN111462292A (en) * | 2020-03-20 | 2020-07-28 | 稿定(厦门)科技有限公司 | Layering rendering method, medium, equipment and device |
CN111782307A (en) * | 2019-04-03 | 2020-10-16 | 阿里巴巴集团控股有限公司 | Map rendering method, style switching method, related device and navigation client |
CN112395073A (en) * | 2019-08-15 | 2021-02-23 | 中国科学院遥感与数字地球研究所 | High-performance fast rendering method for large vector data |
-
2021
- 2021-03-10 CN CN202110261212.5A patent/CN112862940A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103295466A (en) * | 2012-03-02 | 2013-09-11 | 阿里巴巴集团控股有限公司 | Method and device for partial rendering on map |
CN103035164A (en) * | 2012-12-24 | 2013-04-10 | 广东威创视讯科技股份有限公司 | Rendering method and system of geographic information system |
US9317175B1 (en) * | 2013-09-24 | 2016-04-19 | Amazon Technologies, Inc. | Integration of an independent three-dimensional rendering engine |
CN109074376A (en) * | 2016-03-28 | 2018-12-21 | 微软技术许可有限责任公司 | Context ink marks mark in drawing interface |
CN111782307A (en) * | 2019-04-03 | 2020-10-16 | 阿里巴巴集团控股有限公司 | Map rendering method, style switching method, related device and navigation client |
CN110032614A (en) * | 2019-04-18 | 2019-07-19 | 成都四方伟业软件股份有限公司 | Map vector rendering method and device based on wasm |
CN110347464A (en) * | 2019-06-26 | 2019-10-18 | 腾讯科技(深圳)有限公司 | User interface rendering method, device, medium and the electronic equipment of application program |
CN112395073A (en) * | 2019-08-15 | 2021-02-23 | 中国科学院遥感与数字地球研究所 | High-performance fast rendering method for large vector data |
CN110570506A (en) * | 2019-09-11 | 2019-12-13 | 珠海金山网络游戏科技有限公司 | Map resource management method and device, computing equipment and storage medium |
CN111462292A (en) * | 2020-03-20 | 2020-07-28 | 稿定(厦门)科技有限公司 | Layering rendering method, medium, equipment and device |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113436344A (en) * | 2021-06-25 | 2021-09-24 | 广联达科技股份有限公司 | Display method and system of reference view and image display equipment |
CN113570733A (en) * | 2021-08-05 | 2021-10-29 | 稿定(厦门)科技有限公司 | WebGL-based graphic rendering method, device and system |
CN113570733B (en) * | 2021-08-05 | 2024-08-30 | 稿定(厦门)科技有限公司 | Graphics rendering method, device and system based on WebGL |
CN114064172A (en) * | 2021-11-08 | 2022-02-18 | 北京沃东天骏信息技术有限公司 | Data rendering method and device |
CN114170360A (en) * | 2021-11-30 | 2022-03-11 | 埃洛克航空科技(北京)有限公司 | Merging and rendering method and system suitable for multiple terrain data and electronic equipment |
CN114387382A (en) * | 2021-12-31 | 2022-04-22 | 桂林长海发展有限责任公司 | Method, system, storage medium, and electronic device for rendering radar scan animation |
CN114385774A (en) * | 2022-01-17 | 2022-04-22 | 深圳依时货拉拉科技有限公司 | Map updating method, map updating device, storage medium and electronic equipment |
CN117687771A (en) * | 2023-07-24 | 2024-03-12 | 荣耀终端有限公司 | Buffer allocation device, electronic equipment and storage medium |
CN118279461A (en) * | 2024-05-31 | 2024-07-02 | 杭州靖安科技有限公司 | GIS real-time map generation method, system, device and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112862940A (en) | Map rendering method, map rendering device, map rendering equipment and storage medium | |
US8264488B2 (en) | Information processing apparatus, information processing method, and program | |
EP2958033A1 (en) | Tile-based distribution of searchable geospatial data to client devices | |
KR20140100987A (en) | Pre-fetching map tile data along a route | |
JP5694570B2 (en) | Data storage address allocation for graphics processing | |
KR20140102726A (en) | Method of pre-fetching map data for rendering and offline routing | |
CN109002452B (en) | Map tile updating method and device and computer readable storage medium | |
JP2011008540A (en) | Information processor, information processing method, and program | |
CN110580273B (en) | Map GIS data processing and storing method and device and readable storage medium | |
CN115082632A (en) | Two-dimensional and three-dimensional integrated GIS system based on WebGL and application | |
US10930072B1 (en) | Multi-resolution mesh real-time contouring | |
EP2881918B1 (en) | Method for visualizing three-dimensional data | |
CN115761130A (en) | Three-dimensional scene rapid construction method and device, electronic equipment and storage medium | |
CN116363324A (en) | Two-dimensional and three-dimensional integrated rendering method for situation map | |
CN113495933A (en) | Vector tile display method and system | |
CN114064829A (en) | Method and device for carrying out aggregation display on positioning points and electronic equipment | |
CN110799969A (en) | Semantic vector sheet | |
US9245360B2 (en) | Computing devices and methods for deterministically placing geometric shapes within geographic maps | |
KR102527827B1 (en) | Dynamic restyling of digital maps | |
CN115761119A (en) | Neighborhood voxel storage method and device, computer equipment and storage medium | |
CN109710219B (en) | Processing method for rapidly loading data with different orders of magnitude based on Openlayers | |
CN115482152A (en) | Grid map import design software method and device and computer equipment | |
CN105677843A (en) | Method for automatically obtaining attribute of four boundaries of parcel | |
JP2002157254A (en) | Method and device for providing map data | |
KR20220012688A (en) | System and method for providing GIS web service based on the international standard S-101 platform |
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 |