The Terrain Tile class terraintile is used to abstract encapsulate the terrain tile data type requested by user roaming.
Terrain Tile Service class Terraintileservice provides the ability to get elevation from the Bil terrain file. In fact, this class is primarily used to return the terrain tile object requested by the user roaming. These two class diagrams are as follows.
Terrain Tile Service class Terraintileservice The meanings of each field are described below:
String m_serverurl;//Uniform Resource Locator strings for terrain tile services
String M_dataset; Data set string for terrain tile service
Double m_levelzerotilesizedegrees; Level 0 Tile size (double type)
int m_samplespertile; Sample number of tiles per tile (int type)
int m_numberlevels; Number of terrain tiles divided by hierarchy
String m_fileextension; Terrain Tile File extension
String m_terraintiledirectory; Catalog of Tile Tiles
TimeSpan M_terraintileretryinterval; Terrain Tile Service Request retry interval
String M_datatype; Terrain Tile Data type: floating-point or 16-bit shaping
The constructor of the class public Terraintileservice () completes the initialization of the instance by assigning values to the above member.
public static int Getrowfromlatitude (double latitude, double tilesize)
public static int Getcolfromlongitude (double longitude, double tilesize)
The two static functions evaluate and return the column or line number values for the specified latitude or longitude values in the given tile size hierarchy.
function public terraintile getterraintile (double latitude, double longitude, double samplesperdegree) Constructs a terrain tile containing the specified coordinates with the number of samples for each degree specified. One important logic is to calculate the appropriate target level for tiles by specifying the number of samples per pass. Because if the target level is too high, the number of samples that are not satisfied at each time of the level is not less than the specified number of samples per degree. It then calculates and returns the column or line number values for the specified latitude or longitude values at the tile target level according to the appropriate tile target level, and then constructs the Terrain tile file path string using the preceding column number or line number value. The format is: terrain tile catalog \ tile level \ tile line number \ Tile line number _ tile column number. file extension. where "tile line number _ Tile column number" indicates that the same row of tiles in the unified hierarchy tile files are stored under the same line number folder. Finally, we specify or calculate the number of samples per degree of the requested tile object, the size of the tile, the degree of the north edge of the tile, the degree of the southern edge of the tile, the degree of the western boundary of the tile, and the eastern boundary. The most well-built tile objects are returned. You can refer to the following procedure to understand the above.
NASA World Wind Map Tile System
Terrain Tile Class Terraintile The meanings of each field are described below:
public string Terraintilefilepath; Terrain Tile File path
public double tilesizedegrees; Terrain Tile Size Degree
public int samplespertile; Sample number of tiles per tile (int type)
public double south; Tile North Border degree
public double north; Tiles Southern Border Degrees
public double West; Tile western Border Degrees
public double East; Tile Eastern Border Degree
public int row;//Tile line number
public int col;//Tile column number
public int targetlevel; Tile target Level
Public Terraintileservice M_owner; Terrain Tile service class with this tile
public bool isinitialized; Whether tiles are initialized
public bool IsValid; is the tile effective?
Public float[,] elevationdata; Two-dimensional array of elevation data corresponding to tiles
protected terraindownloadrequest request; Terrain Tile Download Request issued
The constructor for this class, public terraintile (terraintileservice owner), simply completes the tile service class that specifies the tiles that owns the tile.
The Initialize function public void Initialize () initializes the terrain tile to add the switch, initializing the floating-point or 16-bit shaped tiles.
The public float Getelevationat (double latitude, double longitude) function obtains the elevation value at the specified latitude and longitude from the two-dimensional array of elevation data corresponding to the tile.
WorldWind Source Analysis Series: Terrain tile and Terrain Tile service class Terraintile&terraintileservice