From 274dd4190e578ae3b0e4bb9da84b9c55ba1e08d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicklas=20Av=C3=A9n?= Date: Wed, 16 May 2018 21:36:23 +0000 Subject: [PATCH] Fixes bounding box handling in twkb_input #4089 git-svn-id: http://svn.osgeo.org/postgis/trunk@16572 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwin_twkb.c | 2 +- regress/tickets.sql | 3 +++ regress/tickets_expected | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/liblwgeom/lwin_twkb.c b/liblwgeom/lwin_twkb.c index a947adbfc..ed838035f 100644 --- a/liblwgeom/lwin_twkb.c +++ b/liblwgeom/lwin_twkb.c @@ -598,7 +598,7 @@ LWGEOM* lwgeom_from_twkb_state(twkb_parse_state *s) bbox.zmax = bbox.zmin + twkb_parse_state_double(s, s->factor_z); } /* M */ - if ( s->has_z ) + if ( s->has_m ) { bbox.mmin = twkb_parse_state_double(s, s->factor_m); bbox.mmax = bbox.mmin + twkb_parse_state_double(s, s->factor_m); diff --git a/regress/tickets.sql b/regress/tickets.sql index 47d96a9f6..9560f3866 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -1085,5 +1085,8 @@ SELECT '#4037.4', ST_AsText(ST_Union('POLYGON((0 0, 10 10, 0 10, 10 0, 0 0))', S SELECT '#4055a', ST_SRID(unnest(ST_ClusterWithin(ARRAY['SRID=4326;POINT (3 7)'::geometry, 'SRID=4326;LINESTRING (3 0, 3 9)'], 0))); SELECT '#4055b', ST_SRID(unnest(ST_ClusterIntersecting(ARRAY['SRID=4326;POINT (3 7)'::geometry, 'SRID=4326;LINESTRING (3 0, 3 9)']))); +--#4089 +select '#4089', st_astext(st_geomfromtwkb(st_AsTWKB(st_GeometryFromText('LINESTRING Z(1 1 1, 3 3 1)'), 1, 0, 0, false, true))); + -- Clean up DELETE FROM spatial_ref_sys; diff --git a/regress/tickets_expected b/regress/tickets_expected index 7005d1110..26873ddfd 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -348,3 +348,4 @@ NOTICE: Self-intersection #4037.4|POLYGON((0 0,2 2,2 8,0 10,10 10,8 8,8 2,10 0,0 0)) #4055a|4326 #4055b|4326 +#4089|LINESTRING Z (1 1 1,3 3 1) -- 2.40.0