LoginSignup
0
0

More than 5 years have passed since last update.

ST_Simplify時のM値の保存

Last updated at Posted at 2018-08-06

PostGIS 2.1、SpatiaLite 4.3.0aで確認。

M値を持つLINESTRING MジオメトリをST_Simplify関数で簡略化した際、PostGISとSpatiaLiteで下記のように結果のM値に違いがあった。

  • PostGISでは簡略化後の頂点は、簡略化前のM値を持つ。
  • SpatiaLiteでは簡略化後の頂点のM値はゼロとなる。
SELECT
    ST_AsText(
        ST_Simplify(t.line, 0.5)
    ) AS simplified
FROM
    (
        SELECT
            ST_GeomFromText(
                'LINESTRING M(0 0 1, 0 0.5 2, 1 0.5 3, 1 1 4)',
                0
            ) AS line
    ) AS t
;

-- PostGISでの実行結果
-- LINESTRING M (0 0 1,1 1 4)

-- SpatiaLiteでの実行結果
-- LINESTRING M(0 0 0, 1 1 0)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0