Questions tagged «extrude»

1
Postgis-挤出多边形
我想在Postgis中拉伸多边形以创建伪3D效果。为此,我编写了一个粗略的函数来实现它。这是非常多的测试代码,它为多边形上的每个点创建一个新的Y顶点,然后通过返回原始点将其关闭:- CREATE OR REPLACE FUNCTION public.extrude_polygon(wkb_geometry_param geometry, height integer, simplify boolean DEFAULT false) RETURNS geometry AS $BODY$ DECLARE f int; ret_geom geometry; wkb_geometry geometry; BEGIN --convert polygon to linestring IF ST_GeometryType(wkb_geometry_param) != 'ST_Polygon' THEN RETURN NULL; END IF; IF simplify THEN wkb_geometry = ST_Simplify(ST_Transform(ST_Exteriorring(wkb_geometry_param), 27700), 0.5); ELSE wkb_geometry = ST_Transform(ST_Exteriorring(wkb_geometry_param), …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.