Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize tianditu slicing calculation in GIS Development

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to achieve tianditu slice calculation in GIS development, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

How to calculate the row number of the slice according to the range of the map? what can be loaded by all kinds of map engines can calculate and display the corresponding picture. The download tool of the map also calculates the grade and row number of the slice, and then downloads the corresponding picture and stores it in the local or database in order.

When the slices are spliced together and the coordinate information is added, it becomes a map image. Of course, at first, the slices may also be cut out according to the map image.

Here is a simple method for calculating the row number of tianditu slices, corresponding to the longitude and latitude map slices of tainditu, and of course the spherical Mercator is calculated in the same way.

Two kinds of maps:

The slice map range of tianditu longitude and latitude is [- 180], the origin of the slice map is-180 °90, the map level starts from 1, the map slice size of the first level is horizontal 512px, vertical is 256px, it is composed of two 256x256 slices, the resolution of the first level map is 360x512, each additional level of the map, the resolution corresponding to the upper level shrinks to 1x2.

The sequence of the slice number starts at the origin, and the closer you get to the map origin, the smaller the number.

Given the latitude and longitude range of a map [xmin,ymin,xmax,ymax], the first resolution of the map defines initResolution, and the level at which you want to get the map slice is level.

Get the minimum line number and column number of the current level of the map:

Column number

= ((xmin- (- 180)) / (initResolution/ 2 ^ (level-1) / 256

Line number

=-1 * ((ymax- 90) / (initResolution/ 2 ^ (level-1)) + 0.5) / 256

Get the maximum line number and column number of the current level of the map:

Column number

= ((xmax- (- 180)) / (initResolution/ 2 ^ (level-1)) + 0.5) / 256

Line number

=-1 * ((ymin- 90) / (initResolution/ 2 ^ (level-1) / 256

256 is the pixel value of the width and height of the slice, if it is different, it needs to be calculated according to the actual size of the slice. When calculating the coordinates, it is necessary to subtract the value of the center point, and then calculate the resolution of the current level according to the level.

In this way, a range of numbers is calculated according to the maximum and minimum row numbers, and the above values are converted to int, and the current slice data can be obtained by adding the level of the request.

Thank you for reading this article carefully. I hope the article "how to implement tianditu slice Computing in GIS Development" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report