From d65df5d51cfc4a40a0e392d71ccac55fa142edfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ra=C3=BAl=20Mar=C3=ADn=20Rodr=C3=ADguez?= Date: Mon, 15 Jul 2019 10:08:13 +0000 Subject: [PATCH] ST_Startpoint: Improve tests and documentation Closes https://github.com/postgis/postgis/pull/443/ git-svn-id: http://svn.osgeo.org/postgis/trunk@17602 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/core/regress_ogc.sql | 8 +++++++- regress/core/regress_ogc_expected | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/regress/core/regress_ogc.sql b/regress/core/regress_ogc.sql index e53e373ad..4c703482e 100644 --- a/regress/core/regress_ogc.sql +++ b/regress/core/regress_ogc.sql @@ -189,7 +189,6 @@ select 'intersects', ST_intersects( select 'ST_GeometryN', ST_asewkt(ST_GeometryN('LINESTRING(0 0, 1 1)'::geometry, 1)); select 'ST_NumGeometries', ST_NumGeometries('LINESTRING(0 0, 1 1)'::geometry); select 'ST_Union1', ST_AsText(ST_Union(ARRAY['POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::geometry, 'POLYGON((0.5 0.5, 1.5 0.5, 1.5 1.5, 0.5 1.5, 0.5 0.5))'::geometry])); -select 'ST_StartPoint1',ST_AsText(ST_StartPoint('LINESTRING(0 0, 1 1, 2 2)'::geometry)); select 'ST_EndPoint1', ST_AsText(ST_Endpoint('LINESTRING(0 0, 1 1, 2 2)'::geometry)); select 'ST_PointN1', ST_AsText(ST_PointN('LINESTRING(0 0, 1 1, 2 2)'::geometry,2)); select 'ST_PointN2', ST_AsText(ST_PointN('LINESTRING(0 0, 1 1, 2 2)'::geometry,3)); @@ -203,3 +202,10 @@ select 'ST_PointN9', ST_AsText(ST_PointN('LINESTRING(0 0 0, 1 1 1,2 2 2,3 3 3,4 -- issues with EMPTY -- select 'ST_Buffer(empty)', ST_AsText(ST_Buffer('POLYGON EMPTY'::geometry, 0.5)); + +-- ST_StartPoint +select 'ST_StartPoint1',ST_AsText(ST_StartPoint('LINESTRING(0 0, 1 1, 2 2)'::geometry)); +select 'ST_StartPoint2',ST_AsText(ST_StartPoint('CIRCULARSTRING(2 2, 1 1, 1 0)'::geometry)); +select 'ST_StartPoint3',ST_AsText(ST_StartPoint('COMPOUNDCURVE(CIRCULARSTRING(3 3, 1 1, 1 0),(1 0, 0 1))'::geometry)); +select 'ST_StartPoint4',ST_AsText(ST_StartPoint('CURVEPOLYGON(CIRCULARSTRING(5 5, 4 0, 4 4, 0 4, 5 5),(1 1, 3 3, 3 1, 1 1))'::geometry)); +select 'ST_StartPoint5',ST_AsText(ST_StartPoint('POLYGON((0 0, 1 1, 0 1, 0 0))'::geometry)); \ No newline at end of file diff --git a/regress/core/regress_ogc_expected b/regress/core/regress_ogc_expected index 5ab5f91e6..ed18254df 100644 --- a/regress/core/regress_ogc_expected +++ b/regress/core/regress_ogc_expected @@ -108,7 +108,6 @@ intersects|f ST_GeometryN|LINESTRING(0 0,1 1) ST_NumGeometries|1 ST_Union1|POLYGON((0 0,0 1,0.5 1,0.5 1.5,1.5 1.5,1.5 0.5,1 0.5,1 0,0 0)) -ST_StartPoint1|POINT(0 0) ST_EndPoint1|POINT(2 2) ST_PointN1|POINT(1 1) ST_PointN2|POINT(2 2) @@ -120,3 +119,8 @@ ST_PointN7|POINT(3 3) ST_PointN8| ST_PointN9|POINT Z (1 1 1) ST_Buffer(empty)|POLYGON EMPTY +ST_StartPoint1|POINT(0 0) +ST_StartPoint2|POINT(2 2) +ST_StartPoint3|POINT(3 3) +ST_StartPoint4| +ST_StartPoint5| -- 2.40.0