Skip to content

Commit 2ad7ec6

Browse files
committed
improve
1 parent 1d2e662 commit 2ad7ec6

File tree

7 files changed

+91
-6
lines changed

7 files changed

+91
-6
lines changed

201802/20180224_01.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,10 @@ UNBOUNDED FOLLOWING
379379

380380
5、帧的不包含定义,and frame_exclusion can be one of
381381

382-
```
383-
EXCLUDE CURRENT ROW,不包含当前行
384-
EXCLUDE GROUP,不包含当前行的所有peer行(当前行也不包含),即order by表达式得到的值等值的行s。
385-
EXCLUDE TIES,不包含当前行之前的所有peer行s,但是包含当前行以及之后的peer行s。即不包含order by表达式得到的等值(order by表达式)的current row之前的所有rows
386-
EXCLUDE NO OTHERS,不排除任何行。默认值。
387-
```
382+
- EXCLUDE CURRENT ROW,不包含当前行
383+
- EXCLUDE GROUP,不包含当前行的所有peer行(当前行也不包含),即order by表达式得到的值等值的行s。
384+
- EXCLUDE TIES,不包含当前行之前的所有peer行s,但是包含当前行以及之后的peer行s。即不包含order by表达式得到的等值(order by表达式)的current row之前的所有rows
385+
- EXCLUDE NO OTHERS,不排除任何行。默认值。
388386

389387
例子
390388

201908/20190819_02.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
## PostGIS 3 瓦片提取函数 ST_TileEnvelope
2+
3+
### 作者
4+
digoal
5+
6+
### 日期
7+
2019-08-19
8+
9+
### 标签
10+
PostgreSQL , PostGIS , 瓦片
11+
12+
----
13+
14+
## 背景
15+
原文
16+
17+
https://info.crunchydata.com/blog/waiting-for-postgis-3-st_tileenvelopezxy
18+
19+
With the availability of MVT tile format in PostGIS via ST_AsMVT(), 越来越多用户使用PostGIS存储并直接产生地图瓦片。
20+
21+
Tile coordinates consist of three values:
22+
23+
- zoom, the level of the tile pyramid the tile is from
24+
- x, the coordinate of the tile at that zoom, counting from the left, starting at zero
25+
- y, the coordinate of the tile at that zoom, counting from the top, starting at zero
26+
27+
![pic](20190819_02_pic_001.png)
28+
29+
30+
![pic](20190819_02_pic_002.png)
31+
32+
PostGIS 3提供了提取瓦片的函数ST_TileEnvelope,输入参数为金字塔图层的层级、x轴编号、y轴编号,瓦片空间。输出为指定x,y位置的瓦片(一个瓦片的像素为256\*256)
33+
34+
https://en.wikipedia.org/wiki/Tiled_web_map
35+
36+
```
37+
geometry ST_TileEnvelope(integer tileZoom, integer tileX, integer tileY, geometry bounds=SRID=3857;LINESTRING(-20037508.342789 -20037508.342789,20037508.342789 20037508.342789));
38+
```
39+
40+
这个函数默认使用Spherical Mercator坐标,https://en.wikipedia.org/wiki/Web_Mercator_projection
41+
42+
![pic](20190819_02_pic_003.png)
43+
44+
## 例子
45+
1、使用默认坐标
46+
47+
```
48+
SELECT ST_AsText( ST_TileEnvelope(2, 1, 1) );
49+
50+
st_astext
51+
------------------------------
52+
POLYGON((-10018754.1713945 0,-10018754.1713945 10018754.1713945,0 10018754.1713945,0 0,-10018754.1713945 0))
53+
```
54+
55+
2、使用非默认坐标
56+
SELECT ST_AsText( ST_TileEnvelope(3, 1, 1, ST_MakeEnvelope(-180, -90, 180, 90, 4326) ) );
57+
58+
st_astext
59+
------------------------------------------------------
60+
POLYGON((-135 45,-135 67.5,-90 67.5,-90 45,-135 45))
61+
```
62+
63+
3、创建非默认坐标
64+
65+
```
66+
geometry ST_MakeEnvelope(float xmin, float ymin, float xmax, float ymax, integer srid=unknown);
67+
```
68+
69+
70+
## 参考
71+
https://postgis.net/docs/manual-dev/ST_TileEnvelope.html
72+
73+
https://info.crunchydata.com/blog/waiting-for-postgis-3-st_tileenvelopezxy
74+
75+
https://postgis.net/docs/manual-dev/ST_MakeEnvelope.html
76+
77+
78+
<a rel="nofollow" href="http://info.flagcounter.com/h9V1" ><img src="http://s03.flagcounter.com/count/h9V1/bg_FFFFFF/txt_000000/border_CCCCCC/columns_2/maxflags_12/viewers_0/labels_0/pageviews_0/flags_0/" alt="Flag Counter" border="0" ></a>
79+
80+
81+
## [digoal's 大量PostgreSQL文章入口](https://github.com/digoal/blog/blob/master/README.md "22709685feb7cab07d30f30387f0a9ae")
82+
83+
84+
## [免费领取阿里云RDS PostgreSQL实例、ECS虚拟机](https://free.aliyun.com/ "57258f76c37864c6e6d23383d05714ea")
85+

201908/20190819_02_pic_001.png

17 KB
Loading

201908/20190819_02_pic_002.png

30.7 KB
Loading

201908/20190819_02_pic_003.png

Loading

201908/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### 文章列表
44
----
5+
##### 20190819_02.md [《PostGIS 3 瓦片提取函数 ST_TileEnvelope》](20190819_02.md)
56
##### 20190819_01.md [《PostgreSQL 窗口函数内部distinct的支持与用法 - count(distinct x) over (partition by ...)》](20190819_01.md)
67
##### 20190817_03.md [《Anonymization & Data Masking for PostgreSQL - 自动脱敏控制 - oracle data vault》](20190817_03.md)
78
##### 20190817_02.md [《PostgreSQL 跟踪记录是谁写入的,谁更新的》](20190817_02.md)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ digoal's|PostgreSQL|文章|归类
5454

5555
### 所有文档如下
5656
----
57+
##### 201908/20190819_02.md [《PostGIS 3 瓦片提取函数 ST_TileEnvelope》](201908/20190819_02.md)
5758
##### 201908/20190819_01.md [《PostgreSQL 窗口函数内部distinct的支持与用法 - count(distinct x) over (partition by ...)》](201908/20190819_01.md)
5859
##### 201908/20190817_03.md [《Anonymization & Data Masking for PostgreSQL - 自动脱敏控制 - oracle data vault》](201908/20190817_03.md)
5960
##### 201908/20190817_02.md [《PostgreSQL 跟踪记录是谁写入的,谁更新的》](201908/20190817_02.md)

0 commit comments

Comments
 (0)