Web-oriented two-dimensional and three-dimensional map exporting method and device and electronic equipment
By dividing the electronic planning map into equal sections and rendering it on the web, a high-resolution map image is generated, which solves the problems of insufficient resolution, size limitations, difficulty in adjusting elements, and format compatibility in web map printing, and improves the user experience.
Patent Information
- Application Number
- CN202411279275.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2044-09-12
AI Technical Summary
Current web map printing suffers from problems such as insufficient resolution and clarity, print size limitations, difficulty in adjusting map elements, poor print format compatibility, and a poor user experience.
By dividing the electronic planning map into equal sections, obtaining background map data and map element objects, rendering them on the web, generating a high-precision map, and outputting high-resolution segmented map rendering images using Canvas technology, then stitching them together using masking technology to generate a complete map effect image.
It improves map resolution and clarity, breaks through printing size limitations, solves difficulties in adjusting map elements and format compatibility issues, and enhances user experience.
Smart Images

Figure CN119313550B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a two-dimensional and three-dimensional map export method and device for Web and electronic equipment. BACKGROUND
[0002] Maps play an important role in modern society. They not only provide visual references for navigation and path planning, making travel and exploration more convenient, but also play a role in professional fields such as emergency response and activity security. For example, people can use map service systems to plan emergency or security plans in advance, then print electronic planning maps or hang them in command rooms as command maps or distribute them to relevant participants as action guides to improve disposal efficiency when responding to situations. As can be seen, maps are essential in work or life, and it is particularly important to efficiently produce complete maps with high precision, high quality, and specified regions, scales, and overlaid map element objects to meet the needs of business operations.
[0003] Current Web map printing has some challenges and problems, including insufficient resolution and clarity, print size limitations, difficulty in adjusting map elements, print format compatibility, and poor user experience. SUMMARY
[0004] Therefore, it is necessary to provide a two-dimensional and three-dimensional map export method and device for Web and electronic equipment to solve the technical problems of insufficient resolution and clarity, print size limitations, difficulty in adjusting map elements, print format compatibility, and poor user experience in current Web map printing.
[0005] To solve the above problems, on the one hand, the present application provides a two-dimensional and three-dimensional map export method for Web, comprising:
[0006] Obtaining an electronic planning map to be printed, and equally dividing and framing the electronic planning map to obtain multiple framed maps;
[0007] Obtaining background map data and map element objects within the multiple framed maps, and superimposing and rendering the background map data and the map element objects according to set parameters on a Web end to obtain high-precision framed maps, and obtaining multiple high-resolution framed map rendering pictures based on the high-precision framed maps, sequentially processing each framed map rendering picture to obtain different block pictures;
[0008] Splicing the different block pictures according to their respective coordinates to obtain a complete map effect picture.
[0009] In one possible implementation, the electronic planning map is equally divided and framed to obtain multiple framed maps, comprising:
[0010] subdivide the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps;
[0011] The printing parameters include at least one of a coordinate system, a scale, a three-dimensional perspective, and a spatial region.
[0012] In a possible implementation, the method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0013] The method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0014] In a possible implementation, the method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0015] The method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0016] The method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0017] The method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0018] The method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0019] In a possible implementation, the mask layer is a raster with binary pixels.
[0020] The method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0021] The method for subdividing the electronic planning map according to the set printing parameters to obtain a plurality of high-precision subdivision maps includes:
[0022] In a possible implementation, the electronic planning map is a two-dimensional map or a three-dimensional map.
[0023] The two-dimensional map comprises a raster tile map or a vector tile map, and the three-dimensional map is made based on oblique photography data collected by a UAV.
[0024] In a possible implementation, different block pictures are spliced according to respective coordinates to obtain a complete map effect picture, including:
[0025] The different block pictures are spliced according to respective coordinates based on a canvas label of a Web end to obtain a complete map effect picture.
[0026] In another aspect, the present application also provides a two-three-dimensional map derivation device for a Web, including:
[0027] The framing module is configured to acquire an electronic planning map to be printed, and divide the electronic planning map into multiple framing maps.
[0028] The rendering module is configured to acquire background map data and map element objects in the multiple framing maps, superimpose and render the background map data and the map element objects according to a set parameter on a Web end to obtain a high-precision framing map, obtain multiple high-resolution framing map rendering pictures based on the high-precision framing map, process the framing map rendering pictures in sequence, and obtain different block pictures.
[0029] The splicing module is configured to splice the different block pictures according to respective coordinates to obtain a complete map effect picture.
[0030] In another aspect, the present application also provides an electronic device including a memory and a processor.
[0031] The memory is configured to store a program.
[0032] The processor is coupled with the memory, and is configured to execute the program stored in the memory to implement steps of the two-three-dimensional map derivation method for a Web as described in any one of the above.
[0033] In another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement steps of the two-three-dimensional map derivation method for a Web as described in any one of the above.
[0034] The beneficial effects of the above implementation manner are that the two-dimensional and three-dimensional map export method, device and electronic equipment provided by the application obtain a plurality of divided maps by equally dividing an electronic planning map to be printed, superimpose background map data and map element objects in the divided maps, render the superimposed background map data and map element objects through a Web end to obtain a high-precision map, output the high-precision map as a high-resolution divided map rendering picture through a canvas technology, obtain different block pictures by sequentially processing the rendering picture through a mask technology, and finally splice the different block pictures to obtain a complete map effect picture. The method provided by the application extracts background map data and map element objects of a plurality of divided maps, re-splices the background map data and map element objects according to set parameters (such as a coordinate system, a scale or a three-dimensional perspective, etc.) on the Web end to obtain a divided high-precision map, can magnify and clearly display a local area, improves the resolution and clarity of the map, splices a plurality of rendering pictures to display a complete map effect picture, and prints the complete map picture, breaks through the limitation of the map format, and solves the technical problems of insufficient resolution and clarity, printing size limitation, difficult map element adjustment, printing format compatibility and poor user experience of the current Web map printing. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0036] Figure 1 The flow chart of one embodiment of the two-dimensional and three-dimensional map export method provided by the application;
[0037] Figure 2 The principle block diagram of one embodiment of the two-dimensional and three-dimensional map export device provided by the application;
[0038] Figure 3 The schematic diagram of the display of the divided electronic planning map provided by the application;
[0039] Figure 4 The structure schematic diagram of one embodiment of the electronic device provided by the application. DETAILED DESCRIPTION
[0040] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0041] In the description of the embodiments of the present application, the meaning of "a plurality of" is two or two or more, unless otherwise specified.
[0042] In the embodiments of the present application, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, device, product or equipment comprising a series of steps or modules does not have to be limited to the clearly listed steps or modules, but can include other steps or modules that are not clearly listed or inherent to the process, method, product or equipment.
[0043] The naming or numbering of the steps appearing in the embodiments of the present application does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The flow steps that have been named or numbered can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0044] In this document, the term "embodiment" means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily all refer to the same embodiment, nor is it mutually exclusive or alternative to other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0045] The present application provides a Web-oriented two-dimensional and three-dimensional map export method, device and electronic equipment, which are described below respectively.
[0046] As shown in Figure 1 The present application provides a Web-oriented two-dimensional and three-dimensional map export method, which comprises:
[0047] S101, acquiring an electronic planning map to be printed, and equally dividing the electronic planning map to obtain a plurality of divided maps;
[0048] S102, acquire background map data and map element objects in the multiple divided maps, and perform superposition rendering on the background map data and the map element objects according to a set parameter to obtain a divided high-precision map on a Web end, and obtain multiple high-resolution divided map rendering pictures based on the high-precision map, sequentially process each divided map rendering picture, and obtain different block pictures;
[0049] S103, splice the different block pictures according to respective coordinates to obtain a complete map effect picture.
[0050] It can be understood that Web is a global wide area network, and the electronic planning position involved in the method provided in the application is a background map, which can be two-dimensional or three-dimensional map data.
[0051] The method provided in the application supports printing of required map element objects superimposed on the background map according to actual operation business needs, and the element objects can be summarized as: text annotation element class, picture annotation element class, swallow arrow element class, assembly area class, three-dimensional model element and the like.
[0052] The background map is loaded in the Web browser, and required map element annotation objects can be superimposed according to specific actual operation business needs to generate a map effect picture meeting the needs of actual operation planning, assist in command decision-making of actual operation work, and improve the efficiency of actual operation work. For example, in a large-scale sports event or a star concert security activity with a large number of personnel participating, in order to ensure safety, security work must be done well, a three-dimensional model and a matching three-dimensional security system are generally constructed in a large venue, the three-dimensional model is taken as a background map in the system, a real venue is reproduced with high simulation, a planned security gate model, a comprehensive service desk three-dimensional model, a security personnel three-dimensional model, an entrance route, an exit route, a toilet three-dimensional model, a seat area and text annotation and the like are superimposed at real positions to form a three-dimensional electronic map bearing security planning information as an action planning guide map, and a scientific means is used to improve security efficiency and ensure the safety and order of the activity.
[0053] For the electronic planning map to be printed, relevant printing parameters are set, such as a coordinate system, a scale, a three-dimensional perspective, a space area (the area can be a self-defined coordinate point string or specified according to an administrative division), and the like.
[0054] After the parameters are specified and analyzed, the electronic planning map to be printed is equally divided (the divided size is a maximum width Wmax=5120 and a maximum height Hmax=3840 in pixels), different divided maps are specified with numbers according to T (row, column), and the space range E (p1, p2) of the divided map is recorded.
[0055] According to the framing information, the background map data in the framed map is obtained according to the specified coordinate system, the specified scale and the framing spatial range through the WebGL technology, and the map element objects in the framed map are superimposed and displayed, and then the high-precision framed map is generated by rendering according to the set parameters in the front end, and the high-resolution framed map rendering picture is output through the canvas technology, and then the specified area image is extracted through the mask technology, and the block picture meeting the set parameters is obtained.
[0056] Then, the different block pictures generated are spliced according to T (row, column) through the canvas technology to generate a complete map effect picture. The generated complete picture is exported to provide preview and download printing.
[0057] In some embodiments, the electronic planning map is equally divided and framed to obtain a plurality of framed maps, including:
[0058] According to the set printing parameters, the electronic planning map is equally divided and framed to obtain a plurality of high-precision framed maps.
[0059] The printing parameters include at least one of the coordinate system, the scale, the three-dimensional perspective and the spatial region.
[0060] In some embodiments, according to the set printing parameters, the electronic planning map is equally divided and framed to obtain a plurality of high-precision framed maps, including:
[0061] According to the set printing parameters, the electronic planning map is equally divided and framed based on the WebGL protocol to obtain a plurality of high-precision framed maps.
[0062] It can be understood that WebGL (Web Graphics Library) is a 3D drawing protocol. For the electronic planning map to be printed, related printing parameters are set, such as the specified coordinate system, the specified scale, the specified region (the region can be a custom coordinate point string or specified according to the administrative division), etc.
[0063] After the parameters are specified and analyzed, the electronic planning map to be printed is equally divided and framed according to the set parameter analysis result (the framing size is pixel maximum width Wmax=5120 and maximum height Hmax=3840), the different framed maps are numbered according to T (row, column), and the spatial range E (p1, p2) of the framing is recorded.
[0064] According to the framing information, background map data in the framed map is obtained according to a specified coordinate system, a specified scale and a framing space range, and the map element objects in the framed map are superimposed and displayed, and then the high-precision framed map is rendered according to the set parameters in the front end, and the high-resolution framed map rendering picture is output through the canvas technology, and then the specified area image is extracted through the mask technology, and the block picture meeting the set parameters is obtained.
[0065] In some embodiments, the background map data and the map element objects are superimposed and rendered according to the set parameters in the Web end to obtain a high-precision framed map, and a plurality of high-resolution framed map rendering pictures are obtained based on the high-precision framed map, and each framed map rendering picture is processed in sequence to obtain different block pictures, including:
[0066] The background map data and the map element objects are superimposed and rendered according to the set parameters in the Web end to obtain a high-precision framed map, and the high-precision framed map is output as a high-resolution framed map rendering picture through the Canvas technology.
[0067] A mask layer is constructed in the target area of the framed map rendering picture.
[0068] Each pixel of the framed map rendering picture is traversed, and in a case where it is determined based on the mask layer that there is a pixel that needs to be covered or excluded in the framed map rendering picture, the pixel that needs to be covered or excluded is filled with white to obtain a block picture meeting the set parameters.
[0069] Each framed map rendering picture is processed in sequence to obtain different block pictures, and the processing is performed on the internal pixels of the block picture to meet the set spatial region.
[0070] In some embodiments, the mask layer is a raster with binary pixels.
[0071] Based on the mask layer, it is determined that there is a pixel that needs to be covered or excluded in the framed map rendering picture, including:
[0072] In a case where the pixel value of the pixel based on each framed map rendering picture in the corresponding mask layer is 0, it is determined that the pixel at the corresponding position is a pixel that needs to be covered or excluded.
[0073] It can be understood that the administrative division or the custom spatial region is constructed as a mask layer, and the mask layer is a raster with binary (0 and 1) pixels, wherein 1 represents a region that needs to be retained or displayed, and 0 represents a region that needs to be covered or excluded.
[0074] Each pixel of the divided map picture is traversed, and whether to keep the pixel is determined according to the pixel value (0 or 1) of the corresponding position in the mask layer. Specifically, if the pixel value of a position in the mask layer is 1, the pixel of the corresponding position in the complete map effect picture is kept; if the pixel value of a position in the mask layer is 0, the pixel of the corresponding position in the divided map picture is filled with white.
[0075] After all the image pixels are processed in sequence, the divided map image in the set area parameter can be extracted.
[0076] Meanwhile, the mask parameters (such as transparency, color, etc.) can be adjusted according to the actual effect, so that the image effect extracted by the mask technology is better.
[0077] In some embodiments, the electronic planning map is a two-dimensional map or a three-dimensional map;
[0078] The two-dimensional map includes a raster tile map or a vector slice map, and the three-dimensional map is made based on oblique photography data collected by a UAV.
[0079] It can be understood that the two-dimensional map can be further divided into a raster tile map and a vector slice map. The raster tile map is a mature and conventional map providing method, and a background map is formed by splicing a plurality of map pictures through a pyramid structure organization. The vector slice map is a new type of map providing method, and is obtained by real-time rendering of vector data through a certain hierarchical structure. The three-dimensional map is obtained by related tools based on oblique photography data collected by a UAV, and the three-dimensional map can more realistically simulate the real world.
[0080] In some embodiments, the different divided pictures are spliced according to respective coordinates to obtain a complete map effect picture, including:
[0081] The different divided pictures are spliced according to respective coordinates based on a canvas label of a Web end to obtain a complete map effect picture.
[0082] It can be understood that the background map data in the divided map is obtained according to the divided information through a WebGL technology according to a specified coordinate system, a specified scale and a divided space range, and the map element objects in the divided map are superimposed and displayed to generate different divided high-precision maps in the front end. The divided map picture is output as a high-resolution divided map picture through a canvas technology, and the image in a specified area is extracted based on the divided map picture.
[0083] Then, the generated different divided pictures are spliced according to T (row, column) through a canvas technology to generate a complete map effect picture.
[0084] In some embodiments, in order to solve the problem of printing in the generation of web map effect pictures, the application provides a method for efficiently, accurately and high-quality generating complete map effect pictures of specified areas, scales and map element objects, specifically:
[0085] 1、The electronic planning map involved in the method provided by the application is a background map, which can be two-dimensional or three-dimensional map data. The two-dimensional map can be further divided into raster tile map and vector slice map. The raster tile map is a mature and conventional map providing method, which forms a background map by splicing a plurality of map pictures through a pyramid structure. The vector slice map is a new map providing method, which is obtained by real-time rendering of vector data through a certain hierarchical structure. The three-dimensional map is obtained by related tools based on the oblique photography data collected by a UAV, and the three-dimensional map can more realistically simulate the real world.
[0086] 2、The method provided by the application supports printing of the required map element objects on the background map according to the actual combat business needs. The element objects can be summarized as: text annotation element class, picture annotation element class, swallow arrow element class, assembly area class, three-dimensional model element and the like.
[0087] 3、With the help of WebGL technology, the background map can be loaded in the browser, and the required map element annotation objects can be superimposed according to the specific actual combat business needs, so as to generate map effect pictures meeting the needs of actual combat planning, assist the command and decision-making of actual combat work, and improve the efficiency of actual combat work. For example, in the security activities of large-scale sports events or star concerts attended by important persons, a large number of personnel are involved, and security work must be done to ensure safety. Generally, a three-dimensional model and a matching three-dimensional security system are constructed in a large venue. The three-dimensional model is used as a background map in the system, and the real venue is reproduced in a high-fidelity manner. The planned security gate three-dimensional model, comprehensive service desk three-dimensional model, security personnel three-dimensional model, access route, exit route, toilet three-dimensional model, seat area and text annotation are superimposed on the real position to form a three-dimensional electronic map bearing security planning information as an action planning guide map, so as to improve the security efficiency by scientific means and ensure the safety and order of the activities.
[0088] 4. The aforementioned action planning guide map can only be displayed on a computer. However, not all participants are at a computer; only a few can see the action planning guide map. Therefore, it's necessary to print the action planning guide map as a complete map image and distribute it to individuals or post it in prominent locations to maximize its value. Conventional map printing involves printing the area displayed on the computer screen or creating a map at a specified scale on the server before printing. For the first case, given the limited size and resolution of computer screens, details are not displayed when the local layer is zoomed out or the 3D view is zoomed out to show the overall picture, and the whole picture is not visible when the local layer is zoomed out or the 3D view is zoomed in to show a part. For the second case, the server recreates the map according to the scale. Although electronic maps can expand overall clarity, the map elements superimposed on top only have coordinate positions, resulting in printed map elements that are either too large or too small, leading to abnormal clarity. To address these issues, this paper proposes a method for efficiently, accurately, and with high quality generating a complete map image of a specified area, scale, and map elements.
[0089] 5. The method provided by this invention is a printing method based on Web front-end technology, and its core steps include:
[0090] ① For the electronic planning map to be printed, first set the relevant printing parameters, such as specifying the coordinate system, specifying the scale, specifying the area (the area can be a custom coordinate point string or specified according to administrative divisions, etc.);
[0091] ② After specifying the parameters and analyzing the relevant parameters, the electronic planning map to be printed is divided into equal sections based on the analysis results of the set parameters (the maximum width of the section is Wmax=5120 pixels and the maximum height is Hmax=3840 pixels). The different sections are assigned numbers according to T(row, column) and the spatial range of the section is recorded as E(p1,p2).
[0092] ③ According to the sectional information, the background map data within the sectional map is obtained through WebGL technology according to the specified coordinate system, specified scale and sectional space range, and the map element objects within the sectional map are superimposed and displayed. Different sectional maps are generated by rendering on the front end. The sectional map is output as a sectional map rendering image through canvas technology. The sectional map rendering image is then processed by step 6 to extract the image within the specified area.
[0093] ④Then, using canvas technology, the generated different segmented images are stitched together according to T(row, column) to generate a complete map effect image;
[0094] 6. Extracting images within a specified area using masking techniques:
[0095] ① Build a mask layer with administrative division or self-defined space region, the mask layer is a raster with binary (0 and 1) pixels, wherein 1 represents the region that needs to be reserved or displayed, and 0 represents the region that needs to be covered or excluded;
[0096] ② Traverse each pixel of the divided map picture, and decide whether to reserve the pixel according to the pixel value (0 or 1) of the corresponding position in the mask layer, specifically, if the pixel value of a certain position in the mask layer is 1, the pixel of the corresponding position in the complete map effect picture is reserved, and if the pixel value of a certain position in the mask layer is 0, the pixel of the corresponding position in the divided map picture is filled with white;
[0097] ③ After sequentially processing all image pixels, the divided map image in the region can be extracted.
[0098] Meanwhile, the mask parameters (such as transparency, color, etc.) can be adjusted according to the actual effect, so that the image effect extracted by the mask technology is better.
[0099] 7. The complete picture generated in step 5 is exported to provide preview and download printing;
[0100] 8. One of the application scenarios of the present application: for example, a certain person comes to a certain place to inspect the work, and the security command group will plan the information about the lodging hotel, the inspection unit, the inspection route, the car route, the pick-up and drop-off points, the police security along the line and the like based on the business system in advance. If the security plan information of this planning is simply described in words, it is not intuitive, and if it is based on a map with spatial position as the link, whether it is a two-dimensional map or a three-dimensional map, the planning scheme information can be more intuitively displayed, and of course if it is a three-dimensional map, the display effect is better because the three-dimensional map simulates the real world. Through the method provided by the present application, the electronic planning map formed by the security planning scheme can be printed in the form of a complete map effect picture and hung in the security command room, which is equivalent to a command map for fighting. The security command decision maker can fully grasp the planning and deployment situation in the command room, which is convenient for real-time scheduling of sudden situations in the inspection process. For ordinary security personnel of the security activity, they can quickly understand their own position and the position of their teammates through the planning map, which is convenient for joint handling of sudden situations. If it is based on a three-dimensional map, the corresponding number of three-dimensional police models, three-dimensional police car models, security gate models and other realistic reproductions of real police deployment situations can be superimposed on the security points more accurately. At the same time, based on the three-dimensional map, various analyses can be performed, such as analyzing the blocking point, or performing advance investigation, eliminating safety hazards, or deploying snipers for necessary security, etc.
[0101] In summary, the application provides a two-dimensional and three-dimensional map export method for Web, comprising: obtaining an electronic planning map to be printed, and equally dividing and framing the electronic planning map to obtain multiple framed maps; obtaining background map data and map element objects in the multiple framed maps, and superimposing the background map data and the map element objects to render on a Web end to obtain different framed map pictures, which are processed into different block pictures conforming to set parameters through a mask technology; and splicing the different block pictures according to respective coordinates to obtain a complete map effect picture.
[0102] The two-dimensional and three-dimensional map export method for Web provided by the application obtains multiple framed maps by equally dividing and framing an electronic planning map to be printed, superimposes background map data and map element objects in the framed maps, and superimposes and renders on a Web end according to set parameters (such as a coordinate system, a scale, or a three-dimensional perspective, etc.) to obtain a framed high-precision map, which is output as a high-resolution framed map rendering picture through a canvas technology, different block pictures are obtained by sequentially processing each framed map picture, and finally, the different block pictures are spliced to obtain a complete map effect picture. The method provided by the application can magnify and clearly display a local area by extracting background map data and map element objects of multiple framed maps and re-rendering on a Web end, can improve the resolution and clarity of a map, and can output the framed map as a map rendering picture, process the map rendering picture into different block pictures through a mask technology, connect the different block pictures, display a complete map picture, and print the complete map, thereby breaking through the limitation of a map format, and solving the technical problems of insufficient resolution and clarity, printing size limitation, difficult map element adjustment, printing format compatibility, and poor user experience in current Web map printing.
[0103] As shown in Figure 2 The application further provides a two-dimensional and three-dimensional map export device 200 for Web, comprising:
[0104] A framing module 201 is configured to obtain an electronic planning map to be printed, and equally divide and frame the electronic planning map to obtain multiple framed maps.
[0105] A rendering module 202 is configured to obtain background map data and map element objects in the multiple framed maps, superimpose and render the background map data and the map element objects on a Web end according to set parameters to obtain a framed high-precision map, obtain multiple high-resolution framed map rendering pictures based on the high-precision map, sequentially process each framed map rendering picture, and obtain different block pictures.
[0106] The splicing module 203 is configured to splice different sub-block pictures according to respective coordinates to obtain a complete map effect picture.
[0107] With reference to Figure 3 The scheme provided by the present application has higher precision because the original electronic planning map is first divided into blocks and then one of the sub-block pictures is displayed on the entire display screen.
[0108] The above-mentioned embodiments provide a Web-oriented two / three-dimensional map exporting device, which can realize the technical solutions described in the above-mentioned embodiments of the Web-oriented two / three-dimensional map exporting method. The principles of the specific implementation of the above-mentioned modules or units can be referred to the corresponding content in the above-mentioned embodiments of the Web-oriented two / three-dimensional map exporting method, which will not be described here again.
[0109] As Figure 4 The present application also provides an electronic device 400. The electronic device 400 includes a processor 401, a memory 402 and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that all the shown components are not required, and more or less components can be alternatively implemented.
[0110] The memory 402 can be an internal storage unit of the electronic device 400 in some embodiments, such as a hard disk or a memory of the electronic device 400. The memory 402 can also be an external storage device of the electronic device 400 in other embodiments, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.
[0111] Further, the memory 402 can include both an internal storage unit and an external storage device of the electronic device 400. The memory 402 is configured to store application software and various data installed in the electronic device 400.
[0112] The processor 401 can be a central processing unit (CPU), a microprocessor or other data processing chip in some embodiments, configured to run program codes or process data stored in the memory 402, such as the Web-oriented two / three-dimensional map exporting method in the present application.
[0113] The display 403 can be, in some embodiments, an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch display, and the like. The display 403 is used to display information at the electronic device 400 and to display visualized user interfaces. The components 401-403 of the electronic device 400 communicate with each other through a system bus.
[0114] In some embodiments of the present application, when the processor 401 executes the web-oriented two-and-three-dimensional map derivation program in the memory 402, the following steps can be implemented:
[0115] An electronic planning map to be printed is acquired, and the electronic planning map is equally divided and framed to obtain a plurality of framed maps;
[0116] Background map data and map element objects in the plurality of framed maps are acquired, and the background map data and the map element objects are superimposed and rendered on a web end according to set parameters to obtain a framed high-precision map, and a plurality of high-resolution framed map rendering pictures are obtained based on the high-precision map, each framed map rendering picture is processed in turn to obtain different block pictures;
[0117] The different block pictures are spliced according to respective coordinates to obtain a complete map effect picture.
[0118] It should be understood that, when the processor 401 executes the web-oriented two-and-three-dimensional map derivation program in the memory 402, in addition to the above functions, other functions can also be implemented, which can be referred to the description of the corresponding method embodiments.
[0119] Further, the type of the electronic device 400 referred to in the embodiments of the present application is not specifically limited, and the electronic device 400 can be a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, and the like. Exemplary embodiments of the portable electronic device include, but are not limited to, a portable electronic device running an IOS, an android, a microsoft, or other operating system. The above-mentioned portable electronic device can also be other portable electronic devices, such as a laptop computer having a touch-sensitive surface (e.g., a touch panel). It should also be understood that, in some other embodiments of the present application, the electronic device 400 can also not be a portable electronic device, but a desktop computer having a touch-sensitive surface (e.g., a touch panel).
[0120] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-mentioned method for deriving a web-oriented two-dimensional and three-dimensional map, the method comprising:
[0121] obtaining an electronic planning map to be printed, and dividing the electronic planning map to obtain a plurality of divided maps;
[0122] obtaining background map data and map element objects in the plurality of divided maps, and superimposing and rendering the background map data and the map element objects according to a set parameter on a web end to obtain a divided high-definition map, and obtaining a plurality of high-resolution divided map rendering pictures based on the high-definition map, and sequentially processing each divided map rendering picture to obtain different divided pictures;
[0123] splicing the different divided pictures according to respective coordinates to obtain a complete map effect picture. It can be understood by those skilled in the art that all or part of the processes of the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a computer readable storage medium. The computer readable storage medium is a disk, an optical disk, a read-only memory or a random access memory, etc.
[0124] The above provides a detailed introduction to the method for deriving a web-oriented two-dimensional and three-dimensional map, the device and the electronic equipment. The principle and implementation mode of the present application are described by applying specific examples. The above-mentioned embodiment is only used to help understand the method and the core idea of the present application. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and the application range can be changed. In summary, the content of the present application should not be understood as a limitation of the present application.
Claims
1. A method for deriving a two or three dimensional map oriented to the Web, characterized in that, The method comprises the following steps: acquire an electronic planning map to be printed, and divide the electronic planning map into multiple sub-maps; acquire background map data and map element objects in the multiple sub-maps, and perform superimposed rendering on the background map data and the map element objects according to a set parameter on a Web end to obtain a high-precision sub-map, and obtain multiple high-resolution sub-map rendering pictures based on the high-precision sub-map, sequentially process each sub-map rendering picture, and obtain different sub-block pictures; splicing the different sub-block pictures according to respective coordinates to obtain a complete map effect picture; the method for obtaining a high-precision sub-map by performing superimposed rendering on the background map data and the map element objects according to a set parameter on a Web end, and obtaining multiple high-resolution sub-map rendering pictures based on the high-precision sub-map, sequentially processing each sub-map rendering picture, and obtaining different sub-block pictures, comprises: performing superimposed rendering on the background map data and the map element objects according to a set parameter on a Web end to obtain a high-precision sub-map, and outputting the high-precision sub-map into a high-resolution sub-map rendering picture by using a Canvas technology; constructing a mask layer in a target region of the sub-map rendering picture; traversing each pixel of the sub-map rendering picture, and in a case where it is determined based on the mask layer that there is a pixel that needs to be covered or excluded in the sub-map rendering picture, filling the pixel that needs to be covered or excluded with white to obtain a sub-block picture meeting the set parameter; sequentially processing each sub-map rendering picture to obtain different sub-block pictures.
2. The web-oriented 2D / 3D map derivation method according to claim 1, characterized in that, dividing the electronic planning map into multiple sub-maps, comprising: dividing the electronic planning map into multiple high-precision sub-maps according to a set printing parameter; wherein the printing parameter comprises at least one of a coordinate system, a scale, a three-dimensional perspective, and a space region.
3. The web-oriented 2D / 3D map derivation method according to claim 2, characterized in that, dividing the electronic planning map into multiple high-precision sub-maps according to a set printing parameter, comprising: dividing the electronic planning map into multiple high-precision sub-maps according to a set printing parameter based on a WebGL protocol.
4. The web-oriented 2D / 3D map derivation method of claim 1, wherein, the mask layer is a raster with binary pixels; determining that there is a pixel that needs to be covered or excluded in the sub-map rendering picture based on the mask layer, comprising: in a case where a pixel value of a pixel of each sub-map rendering picture in a corresponding mask layer is 0, determining that the pixel at the corresponding position is a pixel that needs to be covered or excluded.
5. The web-oriented 2D / 3D map derivation method of claim 1, wherein, the electronic planning map is a two-dimensional map or a three-dimensional map; the two-dimensional map comprises a raster tile map or a vector slice map, and the three-dimensional map is made based on oblique photography data collected by a drone.
6. The web-oriented 2D / 3D map derivation method according to any one of claims 1-5, characterized in that, splicing the different sub-block pictures according to respective coordinates to obtain a complete map effect picture, comprising: splicing the different sub-block pictures according to respective coordinates to obtain a complete map effect picture based on a canvas label of a Web end.
7. A Web-oriented two-and-three-dimensional map export apparatus characterized by comprising: The map slicing module is used to acquire the electronic planning map to be printed and to divide the electronic planning map into equal sections to obtain multiple map slicing maps. The rendering module is used to acquire background map data and map element objects within the multiple segmented maps, and overlay and render the background map data and map element objects on the Web end according to the set parameters to obtain high-precision maps of the segments. Based on the high-precision maps, multiple high-resolution segmented map rendering images are obtained, and each segmented map rendering image is processed sequentially to obtain different block images. The stitching module is used to stitch different image blocks together according to their respective coordinates to obtain a complete map image. The background map data and the map element objects are overlaid and rendered on the web according to set parameters to obtain a high-precision map in sections. Multiple high-resolution rendered images of these sections are then obtained based on the high-precision map. Each rendered image is processed sequentially to obtain different segmented images, including: The background map data and the map element objects are overlaid and rendered on the Web according to the set parameters to obtain a high-precision map in sections. The high-precision map is then output as a high-resolution rendered image of the section map using Canvas technology. Create a mask layer in the target area of the rendered image of the segmented map; Traverse each cell of the segmented map rendering image. If, based on the mask layer, it is determined that there are cells in the segmented map rendering image that need to be covered or excluded, fill the cells that need to be covered or excluded with white to obtain a segmented image that meets the set parameters. The rendered images of each map section are processed sequentially to obtain different block images.
8. An electronic device, comprising: Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps of the Web-oriented 2D / 3D map export method as described in any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the Web-oriented two-dimensional and three-dimensional map export method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Map processing method and device and electronic equipment
CN111290718A