当前位置:网站首页>Map tiles: detailed explanation of vector tiles and grid tiles
Map tiles: detailed explanation of vector tiles and grid tiles
2022-07-28 13:25:00 【CCC Chen Chen】
Map tiles : Detailed explanation of vector tiles and grid tiles
Why do you need tiles :
Map caching technology : The performance requirements of map services are getting higher and higher ; Caching technology greatly improves the performance of map services ; Caching technology reduces the pressure on the server , Dynamic plotting is no longer required ; Map cache or tile map can support many clients to browse concurrently
Because map caching technology is an effective way to access maps , So there are two cache categories under it : Vector tiles and grid tiles
The difference between vector tiles and grid tiles ( The former is vector , Grid )
Map tiles : Organize and define vector data through different description files , Analyze the data in real time on the client to complete the drawing Draw the fixed PNG Or a collection of pictures in other formats
Tile volume : Small ; Big
Tile generation efficiency high ; low
Renewal mechanism flat ; flat
Style modification Support ; I won't support it
Front end technical requirements high (HTML5); low
Show the difference There are differences ; No difference
maturity commonly ; high
Application scenarios special ( Mobile 、 Style modification ); widely
Management mechanism flat ; flat
Grid tiles
Grid tiles : Every piece is a picture , It can be .png, It can also be .jpg. Common sizes are 256256,512512
Cache construction is carried out through the idea of generating sliced files in layers and blocks , And from the coordinate system 、 Map 、 The layer style and data range consider the cache update problem 
Type of grid tiles :
UGCV5: Stored in local disk directory file
MongoDB: Store in MongoDB distributed file system
Grid tiles are mapbox Application in :RasterSource( Grid tile Source),RasterLayer( Grid tile Layer( That is, rendering effect )),RasterSource The structure of can be directly linked by tiles , Also can be TileSet Object construction
Linked by tiles "mapbox://mapbox.u8yyzaor" structure
RasterSource source = new RasterSource("chicago-source", "mapbox://mapbox.u8yyzaor", 512);
mapboxMap.getStyle().addSource(source);
from TileSet structure , There should be {
z}/{
x}/{
y}
TileSet tileSet = new TileSet("tileset", new String[]{
"https://img.nj.gov/imagerywms/Natural2015?bbox={"
+ "bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:"
+ "3857&transparent=true&width=256&height=256&layers=Natural2015"});
tileSet.setMinZoom(0);
tileSet.setMaxZoom(14);
RasterSource source1 = new RasterSource("web-map-source", tileSet, 256);
mapboxMap.getStyle().addSource(source1);
Will be constructed RasterSource Then you can add the corresponding RasterLayer:
// Corresponding to RasterSource
RasterLayer layer = new RasterLayer("chicago", "chicago-source");
mapboxMap.getStyle().addLayer(layer);
// Corresponding to TileSet Tectonic RasterSource
RasterLayer layer1 = new RasterLayer("web-map-layer", "web-map-source");
mapboxMap.getStyle().addLayer(layer1);
Vector tiles
Vector tiles : Each piece is made of dots 、 Line 、 Vector data of surface construction
Structure of vector tiles :Fonts Font files used by vector tiles ,Sprites Icon related style content ,Styles Style description file ,Tiles Vector tile data .mvt,Sci Meta information file of vector tile
Coordinate system of vector tile : apply WGS84 Mars coordinate system ,2000 Geodetic coordinate system, etc
Advantages of vector tiles :
(1) Efficient creation ; Fast transmission and rendering ;
(2) Data and style are independent , You can change the drawing scheme ;
(3) High display quality , It can well support high-resolution display ;
(4) Precut graph ( Multi process )
(5) Dynamic generation (iServer)
(6) Real time cut (HBase)
Constructed from tile links
VectorSource source = new VectorSource("states", "mapbox://mapbox.us_census_states_2015");
mapboxMap.getStyle().addSource(source);
from TileSet structure , There should be {
z}/{
x}/{
y}
TileSet mapillaryTileset = new TileSet("2.1.0", "https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt");
mapillaryTileset.setMinZoom(0);
mapillaryTileset.setMaxZoom(14);
VectorSource source1 = new VectorSource("mapillary.source", mapillaryTileset);
mapboxMap.getStyle().addSource(source1);
Well structured VectorSource Then you can add the corresponding render layer , Here, we should pay particular attention to which rendering layer is used by setSourceLayer Data determination in :
// Corresponding to VectorSource
FillLayer statesJoinLayer = new FillLayer("states-join", "states");
statesJoinLayer.setSourceLayer("states"); // The parameter value is determined by the data , Not necessarily with source Of id identical
statesJoinLayer.withProperties(
fillColor(match(toNumber(get("STATE_ID")),
rgba(0, 0, 0, 1), stops))
);
mapboxMap.getStyle().addLayer(statesJoinLayer);
// Corresponding to TileSet Tectonic VectorSource
LineLayer lineLayer = new LineLayer("mapillary.layer.line", "mapillary.source");
lineLayer.setSourceLayer("mapillary-sequences"); // The parameter value is determined by the data , Not necessarily with source Of id identical
lineLayer.setProperties(
lineCap(Property.LINE_CAP_ROUND),
lineJoin(Property.LINE_JOIN_ROUND),
lineOpacity(0.6f),
lineWidth(2.0f),
lineColor(Color.GREEN)
);
mapboxMap.getStyle().addLayer(lineLayer);
边栏推荐
- [FPGA]: MATLAB generates COE files
- 《TiDB 6.x in Action》发布,凝聚社区集体智慧的 6.x 实践汇总!
- 夜神模拟器抓包微信小程序
- 企业数字化本质
- UV germicidal lamp chip dlt8p65sa Jericho
- Leetcode notes 118. Yang Hui triangle
- 【嵌入式C基础】第2篇:进制转换与BCD编码
- How to design a second kill system?
- The form select in antd is received before it is selected
- Compare the new and old data to find the added and deleted ones
猜你喜欢

Automatic light sensing arm lamp touch chip-dlt8sa15b-jericho

ES6 null merge operator (?)

FFT wave simulation

Have you seen the management area decoupling architecture? Can help customers solve big problems

Shell基础概念和变量

Machine learning Basics - integrated learning-13

Comments are not allowed in JSON
![[embedded C foundation] Part 2: binary conversion and BCD coding](/img/12/d9a42cf7b4dc177d00e5dc3cdaa5cd.png)
[embedded C foundation] Part 2: binary conversion and BCD coding

Protective bearish strategy

gicv3 spi register
随机推荐
沾上趣店,都得道歉?
Leetcode-190. inverting binary bits
二舅能治好年轻人的精神内耗吗?
Tidb 6.x in action was released, a summary of 6.x practices that condense the collective wisdom of the community!
Leetcode · daily question · 1331. array sequence number conversion · discretization
Mysql中DQL基本练习
【嵌入式C基础】第8篇:C语言数组讲解
PHP生成随机数(昵称随机生成器)
Have you seen the management area decoupling architecture? Can help customers solve big problems
Use and source code of livedata in jetpack family bucket
Original juice multifunctional Juicer touch chip-dlt8t02s-jericho
UV germicidal lamp chip dlt8p65sa Jericho
Rust 从入门到精通01-简介
[embedded C foundation] Part 9: basic usage of C language pointer
Unity - "synthetic watermelon" small game notes
Leetcode 笔记 118. 杨辉三角
Risk analysis of option trading
微念“失去”李子柒的这一年
Pointnet++ Chinese Translation
[FPGA] FIR filter - half band filter