fix wm_exaggerate

st_union drops M; use st_collect instead.
This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:49 +03:00 committed by Motiejus Jakštys
parent 95e515b5cc
commit 701239087a
2 changed files with 5 additions and 4 deletions

View File

@ -21,7 +21,7 @@ create function dbg_geomsummary(geoms geometry[]) returns void as $$
begin begin
raise notice 'len: %', array_length(geoms, 1); raise notice 'len: %', array_length(geoms, 1);
for i in 1..array_length(geoms, 1) loop for i in 1..array_length(geoms, 1) loop
raise notice '%: %', lpad(i::text, 2, '0'), st_astext(geoms[i]); raise notice '% %: %', st_geometrytype(geoms[i]), lpad(i::text, 2, '0'), st_astext(geoms[i]);
end loop; end loop;
end end
$$ language plpgsql; $$ language plpgsql;
@ -198,6 +198,6 @@ declare
begin begin
select way from wm_debug where name='fig3' and stage='bbends' and gen=1 and nbend=2 into fig3b2; select way from wm_debug where name='fig3' and stage='bbends' and gen=1 and nbend=2 into fig3b2;
size = wm_adjsize(fig3b2); size = wm_adjsize(fig3b2);
--bend = wm_exaggerate(fig3b2, size, 50.); bend = wm_exaggerate(fig3b2, size, 50.);
--insert into wm_debug(stage, name, gen, nbend, way) values('manual', 'fig3', 1, 1, bend); insert into wm_debug(stage, name, gen, nbend, way) values('manual', 'fig3', 1, 1, bend);
end $$ language plpgsql; end $$ language plpgsql;

3
wm.sql
View File

@ -442,7 +442,7 @@ begin
-- Uses linear interpolation; can be updated to gaussian or similar; -- Uses linear interpolation; can be updated to gaussian or similar;
-- then interpolate manually instead of relying on st_addmeasure. -- then interpolate manually instead of relying on st_addmeasure.
bendm = st_union( bendm = st_collect(
st_addmeasure(st_geometryn(splitbend, 1), 1, scale), st_addmeasure(st_geometryn(splitbend, 1), 1, scale),
st_addmeasure(st_geometryn(splitbend, 2), scale, 1) st_addmeasure(st_geometryn(splitbend, 2), scale, 1)
); );
@ -456,6 +456,7 @@ begin
from st_dumppoints(bendm) from st_dumppoints(bendm)
order by path[1], path[2] order by path[1], path[2]
)); ));
bend = st_makeline(points); bend = st_makeline(points);
size = wm_adjsize(bend); size = wm_adjsize(bend);