Common technology stacks involved:
- Mapbox GL JS
- OpenLayers
- deck.gl
- Leaflet
1. Basic principles of GIS
1 What is GIS?What are the core components?
Standard answer:
GIS (Geographic Information System) is used for Systems for collecting, storing, analyzing and visualizing spatial data 。
Three core parts:
空间数据
空间分析
空间可视化Data structure:
Geometry + PropertiesFor example:
{
"type":"Point",
"coordinates":[116.39,39.90],
"properties":{
"city":"北京"
}
}2 What is the difference between vector data and raster data?
Vector Data
点
线
面For example:
城市
道路
行政区Common formats:
GeoJSON
Shapefile
TopoJSONRaster Data
Essence:
图片For example:
卫星图
热力图
DEM高程3 What is the GeoJSON structure?
GeoJSON is the most common GIS data format.
Type:
Point
LineString
Polygon
MultiPolygon
Feature
FeatureCollectionExample:
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [116.39,39.90]
},
"properties": {
"name": "Beijing"
}
}2. Coordinate system (GIS core)
4 What is the difference between WGS84, GCJ02 and BD09?
Three coordinate systems:
| Coordinate system | Use |
|---|---|
| WGS84 | GPS |
| GCJ02 | AutoNavi Tencent |
| BD09 | Baidu |
China map requires:
坐标偏移For example:
WGS84 → GCJ025 Why is coordinate projection needed?
Reason:
地球是球体
屏幕是平面Requires:
ProjectionCommon projections:
Web MercatorCoordinates:
EPSG:38576 Why is WebMercator suitable for Internet mapping?
Reason:
1️⃣ Simple calculation 2️⃣ The tile map is well adapted 3️⃣ Easy to convert latitude and longitude
Disadvantages:
高纬度地区严重变形3. Map rendering principle (high frequency)
7. What is the principle of tile map (Tile)?
The map is not a whole picture, but:
很多小图片Common sizes:
256x256URL structure:
/z/x/y.pngFor example:
/10/512/345.pngMeaning:
z = zoom
x = tileX
y = tileY8 Why can tiles be infinitely scaled?
Map usage:
金字塔模型Zoom levels:
0 → 1 张
1 → 4 张
2 → 16 张
3 → 64 张Formula:
tiles = 2^zoom4. Front-end map rendering
9 Canvas / WebGL map difference?
Canvas:
CPU 渲染Advantages:
简单Disadvantages:
性能差WebGL:
GPU 渲染Advantages:
百万级点位For example:
- Mapbox GL JS
- deck.gl
10 Why does Mapbox GL have good performance?
Core:
Vector Tile + WebGLProcess:
VectorTile
→ GPU
→ shader
→ 渲染Not the DOM.
5. Spatial analysis (GIS capabilities)
How to implement 11 Point In Polygon?
Question:
点是否在多边形内Algorithm:
射线法
Ray CastingSteps:
点向右画一条射线
统计交点数量Rules:
奇数 = 内部
偶数 = 外部12 How to calculate the distance between two points?
Commonly used:
HaversineBecause:
地球是球体Not simple:
√((x1-x2)^2+(y1-y2)^2)13 How to find the closest point?
Commonly used spatial indexes:
R-Tree
KD-TreeAvoid:
O(n)Optimize to:
O(log n)6. Map performance optimization (advanced must ask)
14 How to render 100,000 points?
Solution:
1 WebGL
For example:
- deck.gl
Support:
百万点2 aggregation
ClusterFor example:
1000点 → 1个圆3 VectorTile
后端切片15 How to optimize map lag?
Common strategies:
requestAnimationFrameBatch update:
RAF 合并Avoid:
频繁 setState7. GIS system architecture
16 Typical architecture of GIS system?
Standard:
数据层
服务层
前端层Data layer:
PostGISService layer:
GeoServer
MapServerFrontend:
- Mapbox GL JS
- OpenLayers
17 Why is VectorTile faster than GeoJSON?
GeoJSON:
一次加载全部VectorTile:
按瓦片加载Advantages:
按需加载8. Real-time map (AI/IoT)
18 How to realize real-time trajectory?
For example:
车辆轨迹Technology:
WebSocket
SSEOptimization:
轨迹抽稀Algorithm:
Douglas-Peucker19 Real-time 2000 How to optimize vehicles?
Strategy:
WebGL空间索引增量更新Don't:
全量重绘9. Digital twin/3D map
20 How to implement 3D map?
Common solutions:
- CesiumJS
- Three.js
- deck.gl
Core:
3D TilesFor example:
城市模型
BIM10. GIS interview bonus points answers
In large mapping systems, I typically use VectorTile + WebGL rendering to handle large-scale data and optimize performance through spatial indexing and point aggregation.If it is a real-time data scene, WebSocket + incremental update will be used, and combined with requestAnimationFrame to control the rendering rhythm.