Optimization of Embedded GIS engine accelerated Map Display

Source: Internet
Author: User
Tags prefetch

Because embedded systems and general PC systems differ greatly in computing speed, memory capacity, and storage space, how can GIS engines run well on embedded devices, you need to optimize the following aspects:

1) Data Organization

 

1. Map Data Compression (curve extraction)

There are usually a large number of vertex Vertex on the line and plane data. Because vertex is too dense, it takes too much time to draw. Therefore, map data must be preprocessed to reduce the path complexity to accelerate the rendering speed. High compression AccuracyAlgorithmSuch as the douglas2poiker method and the optical bar method. This algorithm is used to strip the vector data, which not only maintains the shape characteristics of the vector line, but also determines the extraction margin according to the actual drawing requirements, in this way, the data can be compressed to the maximum extent while the fitting accuracy is ensured, which greatly reduces the computing and drawing time when the image is reduced. When these algorithms are used for compression, the value of the artificially specified Compression Domain cannot be too large. This is because we only want to delete the nodes that are collocated or approximately collocated, so as to maintain the line and surface ry as much as possible. Otherwise, data accuracy will be lost due to distortion. It seems that the geos library has a simplified path implementation, or uses cLib and slib for processing.

2. Coordinate precision Compression

Geographic coordinates are generally expressed in float or double type, occupying a large storage space. Replacing the double or float type with the short type can reduce the storage space for compression. Generally, the double type occupies 8 bytes in a computer, and the float type occupies 4 bytes, while the short type occupies only 2 bytes. In this way, the data can be compressed 4 times or 2 times. For example, the map data used in the vehicle navigation system is. 50 thousand. Use the longitude and latitude coordinates in the lower-left corner of the image, while use the relative coordinates of the longitude and latitude units of 1/24 seconds for the coordinates in the image, in this way, the geographic coordinate transformation from float type to short type is used to compress data.

3. Data Classification

The organization of spatial data is achieved through vertical classification of data and horizontal segmentation.

Because the display resolution of embedded devices is not high, the display content is not much, and the CPU speed is relatively slow. By using spatial data classification, you can speed up the display and analysis of maps, whether each level or layer is displayed depends on the Set visual range. If the display range is not reached, the layer object is hidden. A simple method is to pre-define the level of each element based on its content and importance, and then divide the map elements into multiple levels based on factors such as the geometric size of the object, in actual display, determine which levels of elements are displayed and which are not displayed, so as to keep the screen image clear and readable. What's more, do not show elements that are not hierarchical, this greatly accelerates the scaling process. The advantage of multi-level display is that it can minimize the amount of data displayed during the Map Display process.

4. Data Partitioning

Data can also be further segmented to minimize the amount of data transferred into the memory each time to accelerate display and analysis. In practical applications, the source image is divided into logical blocks and called in Real Time Using Dual-Cache Technology. Divide the entire graph into N x n blocks. The block is determined based on the coordinates of each geometric object and recorded in the index file. The index file must be generated separately. Some elements may span one or several subgraphs. To ensure the integrity of each subgraph, all subgraphs that these elements span must contain the vector information of the element. That is to say, A vector element may appear in several data blocks of a vector data file.

2) Screen Display

1. Traditional Methods

Extract map elements within the display range from the digital map database, convert the coordinates of these geographical elements into screen coordinates, and use the display window to cut the data, plot the cropped geographical elements directly in the screen window. The advantage is that the algorithm is simple and easy to implement. The disadvantage is that the amount of preprocessing data is large. Preprocessing involves reading geographical elements, converting coordinates, and cropping. Therefore, preprocessing takes a long system time and the user waits for a long time.

2. Dual-Cache Technology

The dual-Cache Method for map roaming is to divide the display cache into two cache spaces with the same display range as the virtual screen, called cache A and cache B. Define the preprocessing boundary as an inner boundary within the scope of the virtual screen. When the image on the display screen is moved to the preprocessing boundary, if the command for consecutive movement in the same direction is still received, the new image in the direction of the virtual screen is organized, and copy the image to cache B. At the same time, on Cache A, the screen pointer moving process is still in progress. When the display screen moves to the actual boundary of cache, cache B has prepared a new map in the display direction. At this time, you can jump the screen pointer to the address in the corresponding position of cache B to ensure the continuity of map movement.

3. Data prefetch
It refers to the expansion of W to obtain the rectangular R, and r is the prefetch area. All the spatial data objects falling in the zone R are loaded into a buffer zone opened in the memory. data Objects in the buffer zone may be displayed on the screen after the next map operation. the purpose of map data prefetch is that the map data displayed on the screen is already in the buffer zone, and no need to catch up with new map data.

4. Symbol Library Design

The storage and management mechanisms of the symbol library affect the efficiency of symbol calling, and the data structure of the symbol library affects the complexity of symbol painting. Generally, the map symbol library stores frequently-used symbols in the form of databases to computers after they are classified. The data structures are generally divided into three types: point, line, and surface. Considering that the electronic map is mainly based on the screen output mode, some symbols that are easy to use by computers can be designed during symbol design. That is to say, computers can draw images directly without external operations.

3) spatial indexes

Efficient Spatial indexing is one of the key technologies to improve data access efficiency. Currently, the most widely used technologies include simple multi-level network indexing technology and multi-level quad-tree or R-tree Indexing Technology.

For massive data query statistics, the most important and simplest is to partition data first. To partition map data, a rectangular grid of a certain size is used to intersection or contain map elements for judgment. All map elements in the grid, record its file address or keyword segment in the database, and finally form a partition index file for data. Partition indexes are usually very small. When the system is running, you can partially or once read the index file into the memory to improve the response efficiency. When drawing a graph, the area size mapped to the map data can be calculated based on the screen resolution and the zoom rate. This area generally contains or intersection one or several partition grids, only the data in this part of the grid is searched during data retrieval, which greatly improves the query statistics speed.

For the time being, I think so much, and I will continue to improve it in the future.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.