From: Paul Ramsey Date: Fri, 20 Mar 2015 15:45:29 +0000 (+0000) Subject: Back out changes from #3056 X-Git-Tag: 2.2.0rc1~576 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d07d3642eeb35296ea0a7fff3e4a68854c65884;p=postgis Back out changes from #3056 git-svn-id: http://svn.osgeo.org/postgis/trunk@13376 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index 10f7f7c48..2c137c0d2 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -943,15 +943,7 @@ Datum LWGEOM_mindistance3d(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } - /* #3056, only do 3D distance calculation when both arguments have Z */ - if ( lwgeom_has_z(lwgeom1) && lwgeom_has_z(lwgeom2) ) - { - mindist = lwgeom_mindistance3d(lwgeom1, lwgeom2); - } - else - { - mindist = lwgeom_mindistance2d(lwgeom1, lwgeom2); - } + mindist = lwgeom_mindistance3d(lwgeom1, lwgeom2); PG_FREE_IF_COPY(geom1, 0); PG_FREE_IF_COPY(geom2, 1); diff --git a/postgis/lwgeom_sfcgal.c b/postgis/lwgeom_sfcgal.c index 1ad4e85dc..8fcee8030 100644 --- a/postgis/lwgeom_sfcgal.c +++ b/postgis/lwgeom_sfcgal.c @@ -307,16 +307,7 @@ Datum sfcgal_distance3D(PG_FUNCTION_ARGS) geom1 = POSTGIS2SFCGALGeometry(input1); PG_FREE_IF_COPY(input1, 1); - /* #3056, only do 3D distance calculation when both arguments have Z */ - if ( lwgeom_has_z(geom0) && lwgeom_has_z(geom1) ) - { - result = sfcgal_geometry_distance_3d(geom0, geom1); - } - else - { - result = sfcgal_geometry_distance(geom0, geom1); - } - + result = sfcgal_geometry_distance_3d(geom0, geom1); sfcgal_geometry_delete(geom0); sfcgal_geometry_delete(geom1); diff --git a/regress/measures.sql b/regress/measures.sql index 6da98dd39..e84e1318f 100644 --- a/regress/measures.sql +++ b/regress/measures.sql @@ -262,6 +262,3 @@ select 'emptyCollectionArea', st_area('GEOMETRYCOLLECTION EMPTY'); -- select 'spheroidLength1_deprecated', round(st_length_spheroid('MULTILINESTRING((-118.584 38.374,-118.583 38.5),(-71.05957 42.3589 , -71.061 43))'::geometry,'SPHEROID["GRS_1980",6378137,298.257222101]'::spheroid)::numeric,5); select 'spheroidLength1', round(ST_LengthSpheroid('MULTILINESTRING((-118.584 38.374,-118.583 38.5),(-71.05957 42.3589 , -71.061 43))'::geometry,'SPHEROID["GRS_1980",6378137,298.257222101]'::spheroid)::numeric,5); - --- #3056, only do 3d distance when *both* arguments are 3d -select '#3056', st_3ddistance('LINESTRING(0 0 0, 1 1 1)'::geometry, 'POINT(0.5 0.5)'::geometry); diff --git a/regress/measures_expected b/regress/measures_expected index 5ff66f483..e2e2fefc3 100644 --- a/regress/measures_expected +++ b/regress/measures_expected @@ -44,4 +44,3 @@ emptyMultiPointArea|0 emptyCollectionArea|0 spheroidLength1_deprecated|85204.52077 spheroidLength1|85204.52077 -#3056|0