Digital Earth Implementation

Source: Internet
Author: User
Tags map data structure

The appearance of GoogleEarth has given people a new feeling, the dynamic loading of data, the gradual depiction of terrain, the multi-level of detail (Lod:levels of Detail) and the manifestation of virtual reality have become the typical technical features of Virtual Earth. There are a few problems with building the digital Earth:

  • The construction of global angular spatial data model;
  • The organization, management and dispatch of massive geospatial data (topography, imagery, etc.);
  • Three-dimensional visualization of spatial data. A global perspective spatial data Model

    The projection theory solves the difficult problem (imperfect) that the spherical or ellipsoidal surface cannot be presented, and thus establishes the correspondence relation between the two-dimensional plane and the actual spherical three-dimensional space, and the spherical mesh theory constructs the application analysis model of the global spatial data efficient access.

    (i), spherical mesh

    The basic principle of spherical meshes is that the spherical surface (reference ellipsoid) is recursively divided into the area, the shape is approximately equal and has the multi-resolution hierarchical structure of the grid element, and the corresponding address code of the unit is used instead of the geographical coordinates to operate on the spherical surface.
    The global grid is mainly divided into longitude meshes and polyhedron meshes.
    Latitude grid conforms to people's thinking habits, the calculation is simple and intuitive, and with the existing various types of data conversion is convenient, easy to do texture coordinate calculation and coordinate transformation (geographical coordinates to three-dimensional rectangular coordinate), when adding geographic data, do the least work. The disadvantage is that the grid element shape is uneven, near the pole, mesh distortion, data waste serious.

    Multi-faceted meshes are limited to academic research, and there are few engineering implementations. The biggest advantage is that each mesh element is distorted very little and does not have much data wasted. This feature facilitates three-dimensional spherical rendering. But the disadvantage is that the texture mapping is more complicated when the spherical surface is drawn, and it is also troublesome in the conversion to geographical coordinates.

    (b) Spherical meshes based on latitude and longitude

    Based on the latitude and longitude of the sphere itself implies a rectangular grid system, in order to improve the high latitude region of the deformation of the serious defects, Geofusion (2005) divided the world into 6 regions, of which 4 are in the south latitude 45 degrees, using a rectangular grid, two in high latitude region, using triangular mesh, The deformation caused by rectangular meshes in high latitudes is avoided, but the mathematical model is more complex.
    At present, the mainstream Virtual Earth browser adopts the spherical grid system based on latitude and longitude, in which GoogleEarth and NASA WorldWind Adopt a unified rectangular grid, and Arcglobe uses geofusion global grid technology.

    (World Wind Grid)

    (geofgeofushion grid)

    (iii), Global topographic grid

    Global topography is the visual foundation of Virtual Earth. The terrain grid can be divided into regular grids (RSG) and irregular triangular meshes (tins).
    1. Rule grid
    2. triangulated irregular grids

    Spatial data organization and management

    The data of Virtual Earth mainly includes terrain data, two-dimensional vector data and model data.

    (i) Management of topographic information

    Terrain data is divided into elevation data and image data, they use hierarchical organization, sub-block storage.
    1. Multi-resolution Pyramids
    Multi-resolution pyramid is to use a series of grids to represent the terrain of a unified region, the sampling accuracy of the grid between the adjacent upper and lower levels is generally 1:4, so in large-scale terrain display, the use of low-precision data can greatly shorten the data access time.
    If the "chunking strategy" is adopted on each layer of grid, the data access time can be shortened further, the basic idea is to subdivide each layer grid into equal size rectangular tiles (tile), which is also called "Tile Pyramid". The advantage is that a single read/write operation can access a tile, and the screening can only access the required tiles; The disadvantage is more data redundancy.

    2. Four-fork tree with tiles
    The multi-resolution tin does not have a simple spanning space structure, it is more complex to perform operations such as scene cut, collision detection, and the compression algorithm of tin is more complex, which is not conducive to fast data access.
    The tile pyramid with "layered chunking" strategy not only greatly shortens the data access time but also can express the multi-resolution data, it is the ideal structure of the massive terrain data organization, and with the combination of the tree structure, has the function of the fast data index, thus forming the large-scale spatial data organization way--the tile quadtree. The topological relation of tile with four-fork tree is simple, its index only involves adding, subtraction, doubling and halving operation, which can be realized by high efficient bit operation.

    The data of the tiles based on the spherical grid of latitude and longitude are described by latitude and longitude and elevation, which conforms to people's habits and is more intuitive, while in the display, they are converted to spatial Cartesian coordinates.
    At present, the data organization method of the popular Virtual Earth software adopts the structure of four-fork tree of tiles.

    (ii) Management of model data

    In the implementation of the model data management generally there are two ways, one is integrated storage, which is used to store automatic modeling or fine modeling of the generated model files, the other is a three-dimensional spatial data model implementation of the model data (two-dimensional vector data is a subset of three-dimensional model data), more database management, The three-dimensional spatial data model consists of four spatial objects including point, line, polygon and body, whose indexes can be realized by three-dimensional R-Tree.

    Three-dimensional visualization

    In the various applications related to raster data such as topography and imagery, the large-scale three-dimensional terrain real-time browsing has a high demand for data organization and presentation, which is mainly embodied in two aspects: mass data processing and spherical model establishment.

    (i), visualization of key technologies

    In the computer interactive graphics processing, the real-time animation often requires 25~30 frames per second to refresh the frequency of the graph, the data scheduling mechanism and graphics drawing strategy have put forward a very high demand.
    In order to minimize the data that needs to be rendered while ensuring the smooth appearance of the terrain, there are many ways to accelerate the generation of graphs, such as data reduction, multi-level of detail technology (levels of Detail, LOD), asynchronous data loading, data caching, Request prediction has been widely used in fast rendering algorithms for various large-scale terrain scenes.
    1. Data reduction
    The data cut is mainly the view body cut (view Frustum culling), the core of the visual body cut is to calculate the cone cut range of the field of view, that is, from the view angle defined by the upper and lower left and right four faces (similar to the camera's angle of view) and by the projection matrix definition of the near and far shear plane Then look at the three-dimensional entities (for spherical tiles, which can be used to accommodate the cylinder) and whether it intersects with the visual body or is included in the scene.

    2. Multiple levels of detail technology
    The LOD technique is to reduce the geometric complexity of the scene by simplifying the surface details of the scenes, so as to improve the efficiency of the rendering algorithm without affecting the visual effect of the picture, and the principle is that it can simulate the visual phenomenon of "farther and more blurred, the closer and clearer". The ratio of the view height (eyealt) to the tile size is usually used to determine whether the tile currently displayed needs to be decomposed into a higher resolution sub-tile.

    3. Asynchronous Data loading
    Asynchronous data loading is through different line loads load tile data, the threads are independent and interrelated, it works: the main thread through LOD algorithm and data cut to calculate the required tiles, if the tile is not in the data cache, then add it to the request queue, when the data is loaded, the main thread tile can be used to notify Refreshes the view. In order for the data to load without affecting the smoothness of the display, the main thread will first use its top-level data to draw. Asynchronous data loading also eliminates the need to load tiles in the request queue due to scene transformations, and avoids wasting resources.
    4. Data caching
    The data cache has a disk cache and a memory cache, which is used to download remote data to the local hard disk to increase the speed of data loading, and generally the size of the disk cache is limited.
    The memory cache is also called cache, which is the data that has already been loaded and can be used directly for scene display. Cache size with upper and lower limits, in order to control the number of tiles cache not too little and not too much, the buffer data replacement algorithm can use the least Recently used algorithm (Least recent use, LRU), LRU is the main starting point is that if a tile is accessed, it may be immediately accessible.
    5. Request forecast
    The data caching mechanism can improve the performance of the system, when the terrain scene continuous motion, if the application can predict the data that the system will need in advance, and can read the data to the buffer in advance, then when the application really needs the data, it can be read directly from the buffer, This eliminates the time to read the data from the data source. In the massive terrain roaming, data scheduling and scene rendering need to be done simultaneously, so a separate thread can be set up to predict the data scheduling.

    (b), three-dimensional visualization of terrain

    1. Construction of terrain grid
    Terrain Data Use geographical coordinates (such as latitude and longitude) and elevation information terrain data, which need to be converted to a computer to express simple, high processing efficiency of the space rectangular coordinates.

    Geodetic coordinate system is unified, can accurately and uniquely describe the position of the Earth, and can dynamically adapt to historical, modern and increasingly sophisticated reference ellipsoid, is the most appropriate coordinate system of the virtual Earth.

    The geometric structure of three-dimensional terrain model is triangular, that is, each tile according to the terrain lattice data, and then form a triangular mesh, the process is dynamic real-time, the structure of the terrain grid is deposited into the terrain cache for call.

    (Terrain grid)

    (Geofusion terrain Grid)
    2. Texture mapping
    Texture mapping can effectively enhance the realism of the image, in the terrain visualization, the satellite image is the most able to improve the terrain authenticity texture. Currently, almost all graphics processing hardware that supports texture mapping has texture memory set up in its hardware system to cache texture data to improve the efficiency of texture mapping. The capacity of the texture memory is limited, the graphics processing hardware may not be able to cache all the texture data, each texture mapping will need to transfer some texture data from main memory, so you also need to set the texture cache in case of call.

    (iii), three-dimensional visualization of the model

    Model data can also be used to set up cache in tile units to improve system performance.
    On the display of three-dimensional model, point objects (such as trees, street lamps, pipeline points, etc.) are often represented by three-dimensional model symbols; linear objects (such as pipelines) are also first established three-dimensional linear symbols (such as cylinders), to obtain the linear object's direction, length, radius, height information, after scaling, rotation, The panning operation implements the drawing of the linear object, and the Polygon object is drawn with the model and texture map.

    (iv), three-dimensional notes

    Annotation is an indispensable element in Virtual Earth, and with annotation, we can guarantee the correct understanding of geographic information and make query analysis conveniently. The display of Chinese characters is different from the display of single-byte text, and is output in OpenGL in the form of contour text.

    Test design and implementation (i), three-dimensional platform introduction

    1. Three-dimensional engine
    There are mainly OpenGL and Driect3d.
    2. Existing Virtual-Earth products
    OpenGL-based Virtual Earth products mainly include: NASA WorldWind Java edition, ossimplanet (open Scene graph based on opensource), ArcGlobe; Driect3d based Virtual Earth products include: NASA WorldWind C # Edition, Skyline. GoogleEarth supports OpenGL, Driect3d two three-dimensional engine rendering methods.
    The above platform support two development, some domestic virtual Earth products more open-source platform based on two research and development.
    3. The choice of test program development platform
    As a test program, the main reference on the three-dimensional platform is the open source NASA WorldWind Java version and the OSG-based ossimplanet.
    Nasaworldwind Java Edition is based on JOGL development, is a well-architected Virtual Earth Open source software, its data model for the ellipsoidal spherical mesh, and in the city three-dimensional model display and vector data processing is currently insufficient support, and in the rendering needs from Java to C-language of a memory copy, Performance will be compromised.

    (NASA World Wind)
    Ossimplanet inherited the OSG scene data management structure and implemented a global grid model similar to NASA WorldWind, OSG based on the C + + language, a lot of use of C + + template technology, so the development is more difficult, in the data structure mainly use tree structure organization data, with C + + Smart pointers are used to share data, and event mappings are implemented with the Pseudo function class (C + + class for overloaded () operators).

    (ii), test data organization

    In the global elevation and image data Tile pyramid construction, the Virtual Earth products are basically the same, the difference is the top layer (0 layers) tile size (level Zero tile sizes), the No. 0 layer can be a tile, longitude across 360 degrees, latitude across 180 degrees, can be multiple tiles, NASA World Wind's No. 0 layer of image tiles have 10x5, latitude across 36 degrees, its elevation data No. 0 layer tiles for 18x9, through latitude across 20 degrees.

    1. Construction of pyramid model of tiles
    In the construction of the terrain pyramid, the original terrain data is first used as the bottom of the pyramid (Figure 5-4), the 2nd layer, and its sub-block, forming a 2nd layer tile matrix. On the basis of the 2nd layer, the 1th layer is generated according to the method of each 2x2 pixel, and it is divided into blocks to form the 1th layer tile matrix. So go on, make up the whole pyramid of tiles.

    How many grades are appropriate for the global elevation and tile data? Three-dimensional engine perspective principle is simulated camera in the standard angle of view of the object, the camera's standard angle of view is about 25 degrees, the angle of view height and tile size ratio of 2, according to this principle, if the original image is 1 meters accuracy, the viewing angle height of 500 meters of satellite imagery, the equator on each tile width should be 250 meters , for the 40000 km circumference of the earth, if the No. 0 floor is 1 tiles, to build 0 to 17 total 18 layers of tile pyramid.
    2. Four-fork tree with tiles
    Quadtree is a tree structure with a maximum of four branches per non-leaf node and a hierarchical data structure, which is characterized by the ability to implement spatial recursive decomposition. is a four-fork tree structure of the tile pyramid model, where the rectangle symbol represents the leaf node and the circular symbol represents the non-leaf node.

    (Tile four-fork tree)
    The layer of the quadtree corresponds to the layer of the tile, and the node number of the Quadtree is the layer number of the tile layer plus the grid coordinates of the tile. Therefore, the topological relationship of tiles includes two aspects of the parent-child relationship between the adjacent relationship in the same layer and the upper and lower layers. adjacency relationship has edge adjacency and angular adjacency, and upper and lower layers have upward inheritance and downward decomposition.

    3. The programming realization of tile Pyramid
    In the implementation of the tile pyramid programming, there can be two ways, one is to build a quadtree data structure, save the topology between the upper and lower layers of the tile, a node to save the parent node and four child nodes of the pointer, the other is a hash map (HASH_MAP) data structure, where the tile index as a key, The smart pointer of the tile as the value.
    Quadtree data structure in the transfer of a tile must be the father of the tile pointer, when deleting a tile must first remove all its child tile pointers, not conducive to the effective implementation of the LRU algorithm, and the hash map data structure is much more flexible.

    (iii), data scheduling and visualization

    Terrain grid scheduling process and texture image scheduling process is the same, one after the assumption that the terrain data and image data is loaded together, the data scheduling and visualization process is represented as shown in the figure.

    System operation effect.

Digital Earth Implementation

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.