代码之家  ›  专栏  ›  技术社区  ›  Cyrus the Great

将UTM中的多重字符串直接转换为postgresql中的simplify

  •  0
  • Cyrus the Great  · 技术社区  · 7 年前

    想象一下,我有这样的工作:

    MULTILINESTRING(
    (59.6338836103678 36.3408616511151,59.6336405351758 36.3410074124113),
    (59.648377513513 36.3329201331362,59.6481338515878 36.3326094998047,59.6478482801467 36.3322287937626)
    )
    

    现在我想简化它,以便我需要把它转换成 UTM .

    SRID=4326 ?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Grzegorz Grabek    7 年前

    它应该在不改变的情况下工作。但如果你想先改变

    select st_simplify(ST_Transform(ST_SetSRID(st_astext,4326),3857),1)
    

    说明: -从一个SRID到另一个SRID的转换 -stu geomfromtext-为postGIS创建几何对象 -stu simplfy argument是几何(geom)和公差(值越大,几何越“简单”)

    如果要将对象返回为WKT,则使用st\u astext()或as st\u asEWKT()——第二个是对象的SRID信息。

    select st_simplify(ST_Transform(ST_SetSRID(st_astext,4326),3857),0.000001)