说明
介绍在PotGIS中将点数据转换为栅格数据。
关键字: raster
、point
、PostGIS
环境准备
基本步骤
一、数据准备
测试数据中有一张点数据表,坐标系3857
。
CREATE TABLE IF NOT EXISTS public.test_point
(
geom geometry(Point,3857),
id bigint,
h numeric,--指定要转换为栅格值的列,如高程、温度、风速等
CONSTRAINT test_point_pkey PRIMARY KEY (id)
)
TABLESPACE pg_default;
ALTER TABLE public.test_point
OWNER to postgres;
二、二维点数据转换为三维点
DROP TABLE IF EXISTS test_point_3d;
CREATE TABLE test_point_3d
as select h,ST_Force3D(ST_Transform(geom,38