首页 > 解决方案 > ST_AsMVTGeom 返回空列

问题描述

我在下面发布了 postgresql 表。当我运行以下查询时:

WITH j AS (
 SELECT
   ST_AsMVTGeom(
     geometryOfCellRepresentativeToBuffer,
     ST_MakeBox2D(ST_Point(0, 0), ST_Point(4096, 4096)))
 FROM grid_cell_data
)
SELECT ST_AsMVT(j.*) FROM j;

结果我收到空列,如下图所示。请让我知道为什么我收到空列以及如何解决它。

:[![][1]][1]

结果

样本数据

0|false      |true    |                                                                                                                                                                                                                                                 |{"type": "Polygon", "coordinates": [[[6.632449458709718, 51.12522927856434], [6.6324540543343415, 51.12513943233803], [6.632596828829343, 51.12514232421359], [6.632592233481228, 51.12523217044912], [6.632449458709718, 51.12522927856434]]]}  |                                           -1.0|                             26.726183823369|                                                     -1.0|                                                  39.0|                                            -1.0|                            33.20615352728428|POLYGON EMPTY                                                                                                                                                                                     |POLYGON ((6.632449458709718 51.12522927856434, 6.6324540543343415 51.12513943233803, 6.632596828829343 51.12514232421359, 6.632592233481228 51.12523217044912, 6.632449458709718 51.12522927856434))  
1|false      |true    |                                                                                                                                                                                                                                                 |{"type": "Polygon", "coordinates": [[[6.632592233481228, 51.12523217044912], [6.632596828829343, 51.12514232421359], [6.632739603347985, 51.125145215914955], [6.632735008276377, 51.125235062159696], [6.632592233481228, 51.12523217044912]]]} |                                           -1.0|                            17.5886541554245|                                                     -1.0|                                                  19.0|                                            -1.0|                           25.905263198049443|POLYGON EMPTY                                                                                                                                                                                         |POLYGON ((6.632592233481228 51.12523217044912, 6.632596828829343 51.12514232421359, 6.632739603347985 51.125145215914955, 6.632735008276377 51.125235062159696, 6.632592233481228 51.12523217044912)) 
2|false      |true    |                                                                                                                                                                                                                                                 |{"type": "Polygon", "coordinates": [[[6.632735008276377, 51.125235062159696], [6.632739603347985, 51.125145215914955], [6.632882377890264, 51.12514810744214], [6.632877783095163, 51.12523795369611], [6.632735008276377, 51.125235062159696]]]}|                                           -1.0|                            9.37114876446694|                                                     -1.0|                                                   6.0|                                            -1.0|                           30.914999961853027|POLYGON EMPTY                                                                                                                                                                                         |POLYGON ((6.632735008276377 51.125235062159696, 6.632739603347985 51.125145215914955, 6.632882377890264 51.12514810744214, 6.632877783095163 51.12523795369611, 6.632735008276377 51.125235062159696))
3|false      |true    |                                                                                                                                                                                                                                                 |{"type": "Polygon", "coordinates": [[[6.632877783095163, 51.12523795369611], [6.632882377890264, 51.12514810744214], [6.633025152456179, 51.12515099879514], [6.633020557937586, 51.125240845058315], [6.632877783095163, 51.12523795369611]]]}  |                                           -1.0|                            1.24048557748079|                                                     -1.0|                                                  20.0|                                            -1.0|                           29.092500305175783|POLYGON EMPTY                                                                                                                                                                                         |POLYGON ((6.632877783095163 51.12523795369611, 6.632882377890264 51.12514810744214, 6.633025152456179 51.12515099879514, 6.633020557937586 51.125240845058315, 6.632877783095163 51.12523795369611))  
6|false      |true    |                                                                                                                                                                                                                                                 |{"type": "Polygon", "coordinates": [[[6.6324540543343415, 51.12513943233803], [6.632458649935326, 51.12504958611004], [6.632601424153822, 51.12505247797637], [6.632596828829343, 51.12514232421359], [6.6324540543343415, 51.12513943233803]]]} |                                           -1.0|                            25.2763663585348|                                                     -1.0|                                                  50.0|                                            -1.0|                           27.277200050354004|POLYGON EMPTY                                                                                                                                                                                         |POLYGON ((6.6324540543343415 51.12513943233803, 6.632458649935326 51.12504958611004, 6.632601424153822 51.12505247797637, 6.632596828829343 51.12514232421359, 6.6324540543343415 51.12513943233803)) 
7|false      |true    |                                                                                                                                                                                                                                                 |{"type": "Polygon", "coordinates": [[[6.632596828829343, 51.12514232421359], [6.632601424153822, 51.12505247797637], [6.632744198395957, 51.125055369668516], [6.632739603347985, 51.125145215914955], [6.632596828829343, 51.12514232421359]]]} |                                           -1.0|                             15.295965138869|                                                     -1.0|                                                  59.0|                                            -1.0|                           27.883728932526154|POLYGON EMPTY                                                                                                                                                                                         |POLYGON ((6.632596828829343 51.12514232421359, 6.632601424153822 51.12505247797637, 6.632744198395957 51.125055369668516, 6.632739603347985 51.125145215914955, 6.632596828829343 51.12514232421359)) 
8|false      |true    |                                                                                                                                                                                                                                                 |{"type": "Polygon", "coordinates": [[[6.632739603347985, 51.125145215914955], [6.632744198395957, 51.125055369668516], [6.63288697266173, 51.125058261186474], [6.632882377890264, 51.12514810744214], [6.632739603347985, 51.125145215914955]]]}|                                           -1.0|                            5.38872923499765|                                                     -1.0|                                                  94.0|                                            -1.0|                            31.02755313223981|POLYGON EMPTY                                                                                                                                                                                         |POLYGON ((6.632739603347985 51.125145215914955, 6.632744198395957 51.125055369668516, 6.63288697266173 51.125058261186474, 6.632882377890264 51.12514810744214, 6.632739603347985 51.125145215914955))

标签: postgresqlpostgis

解决方案


推荐阅读