A method and apparatus for generating a tile picture based on an elevation data file
Patent Information
- Application Number
- CN202211372661.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-03
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-11-03
AI Technical Summary
[0005]离线情况下,无法调用互联网的高程数据服务
[0042]本发明提供的高程数据文件的瓦片图片生成方法易于调用,应用本发明建立的高程数据服务对外输出的瓦片图片,与互联网高程数据服务输出的瓦片图片,在投影、格式、尺寸方面都有很多一致性。开发者使用插件或类库调用时,只需调整高程数据服务的网络路径即可正常使用。
Smart Images

Figure CN115797576B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Geographic Information System (GIS) technology, and in particular to a method and apparatus for generating tile images based on elevation data files. Background Technology
[0002] Digital maps are commonly used to represent various geographic information elements such as natural terrain, mountains and rivers, roads and buildings, and environmental facilities, as well as information such as location, trajectory, and extent marked on these elements. Compared to two-dimensional digital maps, three-dimensional digital maps fully integrate surface imagery and elevation data to form a visualized three-dimensional model, enhancing expressiveness and realism, and thus gaining wider application.
[0003] In short, there are two common development and design schemes for 3D digital maps: (1) Connecting to map image data services and map elevation data services at runtime to obtain surface image textures and elevation data, and then rendering the 3D model in real time using plugins or libraries, which results in significant performance overhead during runtime; (2) Obtaining surface image textures and elevation data before runtime, generating the 3D model in advance using plugins or libraries and storing it in a file, and only loading the model at runtime, which results in less performance overhead during runtime. In both of these development and design schemes, the formation of the 3D model is inseparable from the support of surface elevation data.
[0004] There are two main ways to obtain surface elevation data: (1) Obtain tile images under pseudo Mercator projection for display through existing elevation data services on the Internet. The obtained data can be directly used for rendering or constructing three-dimensional digital maps; (2) Obtain raw or pre-processed elevation data files from data providers. The files are usually divided by WGS84 geographic coordinates and have a specific binary format.
[0005] In offline scenarios, internet-based elevation data services are unavailable. Elevation data files obtained from data providers often differ from images provided by internet elevation data services in format, projection, and size, lacking a direct correspondence. This necessitates extensive transformations during retrieval, hindering the development of 3D digital map software. For applications with high confidentiality requirements, such as those in the defense and military industries, finding convenient offline elevation data services has become a pressing issue. Summary of the Invention
[0006] The technical problem to be solved by the present invention is how to obtain convenient elevation data services in offline situations; in view of this, the present invention provides a method and apparatus for generating tile images based on elevation data files.
[0007] The technical solution adopted in this invention is the method for generating tile images based on elevation data files, comprising:
[0008] Obtain the sequence number and layer number of the specified tile according to the request parameters, and use the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile;
[0009] The pseudo Mercator geographic coordinates are sampled and interpolated to determine the corresponding elevation interpolation;
[0010] The elevation interpolation is quantized, and the quantized integer is decomposed into three bytes representing the R, G, and B color channel values respectively.
[0011] Based on the three bytes, construct a tile image corresponding to the request parameters.
[0012] In one embodiment, the method for generating tile images based on elevation data files further includes:
[0013] Based on the request parameters, determine whether the tile image corresponding to the request parameters exists. If it exists, directly obtain the corresponding tile image.
[0014] In one implementation, the step of obtaining the sequence number and layer number of a specified tile according to the request parameters, and using the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile, includes:
[0015] Based on the requested parameters, obtain the sequence number and layer number of the specified tile, and determine the geographical coordinates of the upper left corner of the TMS tile under the corresponding pseudo Mercator projection.
[0016] The corresponding tile side length is determined based on the layer number;
[0017] Based on the tile side length, the difference between the corresponding adjacent pixels is determined;
[0018] The pseudo-Mercator geographic coordinates are determined using the geographic coordinates of the top left corner of the TMS tile under the pseudo-Mercator projection and the differences between adjacent pixels.
[0019] In one implementation, the step of sampling and interpolating the pseudo Mercator geographic coordinates to determine the corresponding elevation interpolation includes:
[0020] Project the pseudo Mercator geographic coordinates onto the WGS84 coordinate system to obtain the corresponding longitude and latitude pairs in the WGS84 coordinate system.
[0021] Based on the longitude and latitude pair, determine the corresponding WGS84 tile number;
[0022] The corresponding tile offset is determined using the WGS84 tile number;
[0023] The offset within the tile is rounded to obtain the corresponding elevation value;
[0024] Based on the tile offset and the elevation value, the corresponding elevation interpolation is determined using a pre-configured algorithm.
[0025] In one implementation, the quantization of the elevation interpolation and the decomposition of the quantized integer into three bytes representing the R, G, and B color channel values respectively include:
[0026] The elevation interpolation is multiplied by 256, rounded down, and saved as a signed integer. Three bytes of this integer are used as the red, green, and blue channel values for return.
[0027] The calculated three bytes are divided into channels, and the corresponding positions in the returned tile image according to the red, green and blue channel values are stored in a two-dimensional array used to represent R, G and B.
[0028] In one implementation, constructing the tile image corresponding to the request parameters based on the three bytes includes:
[0029] For each pseudo Mercator geographic coordinate, an image storage area is constructed based on the red, green, and blue channel values at the corresponding location.
[0030] Set the color of the tile image at the corresponding position according to the red, green and blue channel values;
[0031] Obtain the generated tile images and store them to the corresponding storage path.
[0032] Another aspect of the present invention provides a tile image generation apparatus based on elevation data files, comprising:
[0033] The coordinate determination module is configured to obtain the sequence number and layer number of a specified tile based on the request parameters, and use the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile;
[0034] An interpolation module is configured to sample and interpolate the pseudo Mercator geographic coordinates to determine the corresponding elevation interpolation.
[0035] The quantization module is configured to quantize the elevation interpolation and decompose the quantized integer into three bytes representing the values of the R, G, and B color channels, respectively.
[0036] The image generation module is configured to construct a tile image corresponding to the request parameters based on the three bytes.
[0037] In one embodiment, the tile image generation device based on elevation data files further includes:
[0038] The preprocessing module is configured to determine whether a tile image corresponding to the request parameters exists based on the request parameters, and if it exists, directly obtain the corresponding tile image.
[0039] Another aspect of the present invention provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the tile image generation method based on elevation data files as described in any of the preceding claims.
[0040] Another aspect of the present invention provides a computer storage medium storing a computer program that, when executed by a processor, implements the steps of the tile image generation method based on elevation data files as described in any of the preceding claims.
[0041] By adopting the above technical solution, the present invention has at least the following advantages:
[0042] The method for generating tile images from elevation data files provided by this invention is easy to use. The tile images output by the elevation data service established using this invention have many similarities with those output by internet elevation data services in terms of projection, format, and size. When developers use plugins or libraries, they only need to adjust the network path of the elevation data service to use it normally.
[0043] Furthermore, the present invention can be applied to offline operation, that is, the elevation data service designed using the present invention can run independently in offline situations. Attached Figure Description
[0044] Figure 1 This is a flowchart of a method for generating tile images from elevation data files according to an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of the structural composition of the tile image generation device for elevation data files according to an embodiment of the present invention;
[0046] Figure 3 This is a schematic diagram of an electronic device structure according to an embodiment of the present invention. Detailed Implementation
[0047] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.
[0048] In the accompanying drawings, the thickness, size, and shape of the objects have been slightly exaggerated for ease of illustration. The drawings are for illustrative purposes only and are not drawn to scale.
[0049] It should also be understood that the terms "comprising," "including," "having," "containing," and / or "comprising," when used in this specification, indicate the presence of the stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or combinations thereof. Furthermore, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire listed feature, not individual elements in the list. Additionally, when describing embodiments of this application, the word "may" is used to mean "one or more embodiments of this application." And the term "exemplary" is intended to refer to an example or illustration.
[0050] As used herein, the terms “basically,” “approximately,” and similar terms are used as terms of approximation rather than terms of degree, and are intended to describe inherent biases in measured or calculated values that will be recognized by those skilled in the art.
[0051] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms (e.g., those defined in common dictionaries) shall be interpreted as having the meaning consistent with their meaning in the context of the relevant art and shall not be interpreted in an idealized or overly formal sense unless expressly so specified herein.
[0052] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0053] The steps described in the specification and the flowcharts in the accompanying drawings of this invention are not necessarily to be strictly followed according to the step numbers; the execution order of the steps can be changed. Furthermore, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be broken down into multiple steps.
[0054] To better illustrate the embodiments provided by the present invention, the following terms and concepts will be explained first.
[0055] WGS84: short for World Geodetic System-1984, is the global coordinate system of 1984. Benefiting from the development of the US GPS system, it is now the most widely used coordinate system in the world.
[0056] Mercator projection, also known as the standard cylindrical projection, is a type of conformal cylindrical map projection. In this projection, the current map scale remains unchanged around any point on the map, thus preserving the angles and shapes of the projected continental outlines. However, the Mercator projection distorts areas, with the scale around the poles expanding to near infinity.
[0057] Pseduo-Mercator, also known as Web-Mercator, is a variant of the Mercator projection. The Pseduo-Mercator projection in the WGS84 coordinate system is the standard projection for web map applications. Unlike the standard Mercator projection, Pseduo-Mercator uses a spherical formula at all scales, causing local maps to deviate from the ellipsoidal Mercator map at the same scale. Therefore, Pseduo-Mercator is typically only used for web map services. Pseduo-Mercator data covers longitude -180° to 180° and latitude -85.051129° to 85.051129°, excluding some polar regions. The disadvantages of Pseduo-Mercator are severe distortion, making it unsuitable for large-scale, high-precision data display; its advantages are simple projection formula calculation, square projection results, and easy tile cutting.
[0058] Tile image: When accessing an internet map service, a fixed-size area is requested and called a tile image. This invention uses the common tile image size of 256*256 pixels found in internet map services.
[0059] Image slicing: The process of cutting a whole map image into tile images according to the size of the tiles.
[0060] SRTM stands for Shuttle RadarTopography Mission, a joint surveying mission conducted by NASA and the National Mapping Agency (NIMA). SRTM data uses 16-bit numerical values to represent elevation values, with each sampling point ranging from -12,000m to +9,000m. Each latitude and longitude grid cell in SRTM data provides one file, with two resolutions: 1 arcsecond and 3 arcseconds, referred to as SRTM1 and SRTM3, also known as 30m and 90m data. For each latitude and longitude grid cell, each file in SRTM1 contains elevation data for 3601 x 3601 sampling points, while SRTM3 contains 1201 x 1201 sampling points.
[0061] Tile number: Used to describe the tile position, including layer number (or scaling factor) Z, horizontal coordinate X, and vertical coordinate Y. Each layer has a fixed pixel interval, used to express the geographic coordinate interval between two pixels in the horizontal or vertical direction of that layer's tile, and the pixel interval of each layer except the top layer is only half that of the layer above. Based on the pixel interval of each layer, the size of the tile in geographic coordinates can also be determined, which is referred to as the tile side length in this invention.
[0062] Geographic coordinates: A specific geographical location, including the horizontal coordinate X and the vertical coordinate Y. For WGS84 coordinates, the horizontal X represents longitude, and the vertical Y represents latitude.
[0063] Raw data tiles: The raw data accepted in this invention is cut into a series of squares according to WGS84 geographic coordinates. Each square has a uniform resolution, such as 65*65 (HeightMap format) or 3601*3601 (SRTM1 HGT format), etc.
[0064] TMS stands for Tile Map Service, a common method of tiling maps. The tiles are arranged horizontally from left to right and vertically from bottom to top, with the horizontal and vertical coordinates starting from 0.
[0065] The first embodiment of the present invention provides a method for generating tile images from elevation data files, such as... Figure 1 As shown, the specific steps include the following:
[0066] Step S1: Obtain the sequence number and layer number of the specified tile according to the request parameters, and use the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile;
[0067] Step S2: Sample and interpolate the pseudo Mercator geographic coordinates to determine the corresponding elevation interpolation;
[0068] Step S3: Quantize the elevation interpolation and decompose the quantized integer into three bytes representing the R, G, and B color channel values respectively.
[0069] Step S4: Construct the tile image corresponding to the request parameters based on three bytes.
[0070] The method provided in this embodiment will be described in detail below.
[0071] Step S1: Obtain the sequence number and layer number of the specified tile according to the request parameters, and use the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile.
[0072] In this embodiment, the layer number Z and the horizontal and vertical serial numbers X in the request information can be used as references. tile and Y tileThe geographic coordinates of the top left corner of the TMS tile under pseudo Mercator projection are calculated and denoted as (X0, Y0), as shown below:
[0073]
[0074] The tile side length L is obtained based on the layer number Z. Using a commonly used pseudo-Mercator projection setting, the Earth's spherical radius R is 6378137 meters, which can be specifically:
[0075] L=2 -z *2πR
[0076] The projected pseudo Mercator region is a square, and the difference between two adjacent pixels in the horizontal or vertical direction is L0 = L / 256, in meters.
[0077] The pseudo Mercator geographic coordinates of the pixel position (i,j) within the tile to be returned are:
[0078] x = X0 + L0*i, y = Y0 + L0*j
[0079] In this embodiment, the corresponding tile image may also be obtained directly from the cache path, thus eliminating the need for subsequent image generation processing. Specifically, this includes:
[0080] Retrieve the specified tile number from the request parameters, including the tile layer number Z and the tile's horizontal and vertical serial numbers X. tile and Y tile And the required data name (Name);
[0081] Based on the request information, form a structure similar to {Name} / {Z} / {Y} tile} / {X tile The cached image path for .png files, such as Base / 2 / 6 / 3.png;
[0082] Determine if the image file at the specified path exists: if it does, return the cached image directly; otherwise, proceed to step S1.
[0083] Step S2: Sample and interpolate the pseudo Mercator geographic coordinates to determine the corresponding elevation interpolation.
[0084] Specifically, the 256*256 pseudo Mercator geographic coordinates calculated in the previous step can be processed sequentially as follows:
[0085] Projecting the pseudo Mercator geographic coordinates (x, y) onto the WGS84 coordinate system yields the longitude and latitude pairs (λ, y) in the WGS84 coordinate system. Its unit is °, and it is expressed as follows:
[0086]
[0087] From the obtained WGS84 coordinates (λ, ), calculate the corresponding WGS84 tile number.
[0088] Furthermore, for SRTM HGT format data, tiles are expressed as files such as N{latitude}E{longitude}.hgt, therefore, directly dealing with (λ, Round down to the nearest integer, and use the obtained λ from the rounding. tile , By substituting, you can obtain the corresponding tile file name. Where λ tile When positive, it corresponds to E; otherwise, it corresponds to W. When the number is positive, it corresponds to N; otherwise, it corresponds to S.
[0089] The method for finding tile files is similar for other file formats with similar naming rules, and will not be described here.
[0090] Furthermore, for files arranged using the TMS tile naming convention, such as HeightMap format data provided by some data providers, the tile sequence number (λ) needs to be calculated, except that the layer number Z may differ. tile , Assuming the TMS tile arrangement is from -180° to +180° horizontally and from -90° to +90° vertically, then:
[0091]
[0092] Where, λ, All units are in degrees (°).
[0093] Furthermore, based on the obtained tile sequence number, the offset within the tile is calculated, specifically:
[0094] For SRTM HGT format data, depending on whether the original data is 1" or 3" resolution, the recorded data within the tile is either 3601*3601 or 1201*1201. The length and width of the recorded data are both 1+Q, where Q is the number of horizontal and vertical upsamples; for SRTM1 data, the Q value is 3600. Therefore, the tile offset (λ) p , )yes:
[0095]
[0096] The processing of other files with similar naming rules and formats remains the same, except that the Q corresponding to the resolution is different, so no further explanation will be given here.
[0097] Furthermore, for files arranged using the TMS tile naming convention, assuming the TMS tile arrangement is from -180° to +180° horizontally and from -90° to +90° vertically, its tile offset (λ)p , The calculation requires first obtaining the position of the top left corner of the TMS tile:
[0098]
[0099] Where (λ) top-left , That is, the top left corner, further:
[0100]
[0101] Here, Q is the number of samples in the file. The specific value needs to be determined based on the file format. For example, if the HeightMap format specifies a data area of (64+1)*(64+1) double-byte integers, then Q is 64.
[0102] Furthermore, based on the offset within the tile, its offset (λ) p , The values of ) are rounded up and down, and combined to obtain the offsets within the four nearest tiles. The four positions, bottom left, top left, bottom right, and top right, are respectively (λ). m , ), (λ m , ), (λ M , ), (λ M , The four corresponding elevation values are denoted as h. mm h mM h Mm h MM .
[0103] Read the data from the original data tile file to obtain the elevation values corresponding to the offset positions within the four nearest tiles, and then calculate the elevation interpolation h at that position:
[0104]
[0105]
[0106]
[0107] Step S3: Quantize the elevation interpolation and decompose the quantized integer into three bytes representing the R, G, and B color channel values respectively.
[0108] Specifically, the calculated elevation interpolation h is multiplied by 256, rounded down, and saved as a signed integer H. Three bytes of this integer are used as the red, green, and blue channel values for return. In programming pseudocode, this is expressed as: H = ceil(h * 256).
[0109]
[0110] Where ceil(x) rounds x down, |H| is the absolute value, and sign(h) is the sign of the x.
[0111]
[0112] Furthermore, the calculated three bytes R byte G byte B byte Divide the channels and store the calculated tile positions (i,j) into two-dimensional arrays R, G, and B. Each of the three arrays R, G, and B is 256*256 in size and is a single-byte unsigned integer.
[0113] Step S4: Construct the tile image corresponding to the request parameters based on three bytes.
[0114] Specifically, for each pseudo Mercator geographic coordinate location, after calculating the RGB values after elevation interpolation quantization, a 24-bit image storage area of size 256*256 is constructed.
[0115] Furthermore, the quantized values are used to set the color (R) of the image at the corresponding position (i,j). ij G ij B ij );
[0116] Optionally, the image can be saved as a PNG file and stored in the cached image path mentioned in step one. Then, the saved cached image can be returned as the response to the request.
[0117] The method for generating tile images from elevation data files provided in this embodiment is easy to use. The tile images output by the elevation data service established using this invention have many similarities with those output by internet elevation data services in terms of projection, format, and size. When developers use plugins or libraries, they only need to adjust the network path of the elevation data service to use it normally. Furthermore, this invention can be applied to offline operation; that is, the elevation data service designed using this invention can run independently offline.
[0118] The second embodiment of the present invention, corresponding to the first embodiment, introduces a device for generating tile images from elevation data files, such as... Figure 2 As shown, it includes the following components:
[0119] The coordinate determination module obtains the sequence number and layer number of the specified tile based on the request parameters, and uses the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile.
[0120] The interpolation module is configured to sample and interpolate pseudo Mercator geographic coordinates to determine the corresponding elevation interpolation.
[0121] The quantization module is configured to quantize the elevation interpolation and decompose the quantized integer into three bytes representing the R, G, and B color channel values respectively.
[0122] The image generation module is configured to construct a tile image corresponding to the request parameters based on three bytes.
[0123] According to a third embodiment of the present invention, an electronic device, which can be understood as a physical device, includes a processor and a memory storing processor-executable instructions. When the instructions are executed by the processor, the following operations are performed:
[0124] Step S1: Obtain the sequence number and layer number of the specified tile according to the request parameters, and use the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile;
[0125] Step S2: Sample and interpolate the pseudo Mercator geographic coordinates to determine the corresponding elevation interpolation;
[0126] Step S3: Quantize the elevation interpolation and decompose the quantized integer into three bytes representing the R, G, and B color channel values respectively.
[0127] Step S4: Construct the tile image corresponding to the request parameters based on three bytes.
[0128] In the fourth embodiment of the present invention, the process of generating tile images from elevation data files is the same as that in the first, second, or third embodiments. The difference lies in the engineering implementation: this embodiment can be implemented using software plus necessary general-purpose hardware platforms. While hardware can also be used, the former is often a better implementation method. Based on this understanding, the method of the present invention can be embodied in the form of a computer software product stored in a storage medium, including several instructions to cause a device to execute the method described in the embodiments of the present invention.
[0129] In summary, compared with the prior art, the present invention has at least the following advantages:
[0130] 1) The method for generating tile images from elevation data files provided by this invention is easy to use. The tile images output by the elevation data service established using this invention have many similarities with those output by the Internet elevation data service in terms of projection, format, and size. When developers use plugins or libraries, they only need to adjust the network path of the elevation data service to use it normally.
[0131] 2) This invention can be applied to offline operation, that is, the elevation data service designed using this invention can run independently in offline situations.
[0132] Through the description of specific embodiments, a more in-depth and specific understanding should be gained of the technical means and effects adopted by the present invention to achieve the intended purpose. However, the accompanying drawings are only provided for reference and illustration and are not intended to limit the present invention.
Claims
1. A method for generating tile images based on elevation data files, characterized in that, include: Obtain the sequence number and layer number of the specified tile according to the request parameters, and use the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile; Project the pseudo Mercator geographic coordinates onto the WGS84 coordinate system to obtain the corresponding longitude and latitude pairs in the WGS84 coordinate system. Based on the longitude and latitude pair, determine the corresponding WGS84 tile number; The corresponding tile offset is determined using the WGS84 tile number; The offset within the tile is rounded to obtain the corresponding elevation value; Based on the tile offset and the elevation value, the corresponding elevation interpolation is determined using a pre-configured algorithm; The elevation interpolation is multiplied by 256, rounded down, and saved as a signed integer. Three bytes of this integer are used as the red, green, and blue channel values for return. The calculated three bytes are divided into channels, and the corresponding positions in the returned tile image according to the red, green and blue channel values are stored in a two-dimensional array used to represent R, G and B. For each pseudo Mercator geographic coordinate, an image storage area is constructed based on the red, green, and blue channel values at the corresponding location. Set the color of the tile image at the corresponding position according to the red, green and blue channel values; Obtain the generated tile images and store them to the corresponding storage path.
2. The method for generating tile images based on elevation data files according to claim 1, characterized in that, The method for generating tile images based on elevation data files also includes: Based on the request parameters, determine whether the tile image corresponding to the request parameters exists. If it exists, directly obtain the corresponding tile image.
3. The method for generating tile images based on elevation data files according to claim 1, characterized in that, The step of obtaining the sequence number and layer number of the specified tile according to the request parameters, and using the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile, includes: Based on the requested parameters, obtain the sequence number and layer number of the specified tile, and determine the geographical coordinates of the upper left corner of the TMS tile under the corresponding pseudo Mercator projection. The corresponding tile side length is determined based on the layer number; Based on the tile side length, the difference between the corresponding adjacent pixels is determined; The pseudo-Mercator geographic coordinates are determined using the geographic coordinates of the top left corner of the TMS tile under the pseudo-Mercator projection and the differences between adjacent pixels.
4. A device for generating tile images based on elevation data files, characterized in that, include: The coordinate determination module is configured to obtain the sequence number and layer number of a specified tile based on the request parameters, and use the sequence number and layer number to determine the pseudo Mercator geographic coordinates corresponding to the tile; The interpolation module is configured to project the pseudo Mercator geographic coordinates onto WGS84 coordinates to obtain the corresponding longitude and latitude pairs in the WGS84 coordinate system. Based on the longitude and latitude pair, determine the corresponding WGS84 tile number; The corresponding tile offset is determined using the WGS84 tile number; The tile offset is rounded to obtain the corresponding elevation value; based on the tile offset and the elevation value, the corresponding elevation interpolation is determined using a pre-configured algorithm. The quantization module is configured to multiply the elevation interpolation by 256, round it down, and save it as a signed integer. Three bytes of this integer are used as the red, green, and blue channel values for return. The calculated three bytes are divided into channels and stored in a two-dimensional array representing R, G, and B according to the corresponding positions in the returned tile image of the red, green, and blue channel values. The image generation module is configured to construct an image storage area based on the red, green, and blue channel values for each pseudo Mercator geographic coordinate; and to set the color of the tile image at the corresponding position according to the red, green, and blue channel values. Obtain the generated tile images and store them to the corresponding storage path.
5. The tile image generation device based on elevation data files according to claim 4, characterized in that, The tile image generation device based on elevation data files further includes: The preprocessing module is configured to determine whether a tile image corresponding to the request parameters exists based on the request parameters, and if it exists, directly obtain the corresponding tile image.
6. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the tile image generation method based on elevation data files as described in any one of claims 1 to 3.
7. A computer storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the tile image generation method based on elevation data files as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Grid reprojection-based map generation method and system, medium and equipment
CN114817619A
Method and apparatus for providing a tile-based digital elevation model
US20190156566A1