Remove unimplemented/undocumented geometric functions & operators.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 Dec 2021 23:08:28 +0000 (18:08 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 Dec 2021 23:08:28 +0000 (18:08 -0500)
Nobody has filled in these stubs for upwards of twenty years,
so it's time to drop the idea that they might get implemented
any day now.  The associated pg_operator and pg_proc entries
are just confusing wastes of space.

Per complaint from Anton Voloshin.

Discussion: https://postgr.es/m/3426566.1638832718@sss.pgh.pa.us

src/backend/utils/adt/geo_ops.c
src/include/catalog/catversion.h
src/include/catalog/pg_cast.dat
src/include/catalog/pg_operator.dat
src/include/catalog/pg_proc.dat
src/test/regress/expected/geometry.out
src/test/regress/sql/geometry.sql

index e9c347cb8c6d67673d249aed3a9445c46abf080a..92dc9483b96deeb77d023e808632549bb0481ed8 100644 (file)
@@ -2532,44 +2532,6 @@ dist_bs(PG_FUNCTION_ARGS)
    PG_RETURN_FLOAT8(box_closept_lseg(NULL, box, lseg));
 }
 
-/*
- * Distance from a line to a box
- */
-Datum
-dist_lb(PG_FUNCTION_ARGS)
-{
-#ifdef NOT_USED
-   LINE       *line = PG_GETARG_LINE_P(0);
-   BOX        *box = PG_GETARG_BOX_P(1);
-#endif
-
-   /* need to think about this one for a while */
-   ereport(ERROR,
-           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-            errmsg("function \"dist_lb\" not implemented")));
-
-   PG_RETURN_NULL();
-}
-
-/*
- * Distance from a box to a line
- */
-Datum
-dist_bl(PG_FUNCTION_ARGS)
-{
-#ifdef NOT_USED
-   BOX        *box = PG_GETARG_BOX_P(0);
-   LINE       *line = PG_GETARG_LINE_P(1);
-#endif
-
-   /* need to think about this one for a while */
-   ereport(ERROR,
-           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-            errmsg("function \"dist_bl\" not implemented")));
-
-   PG_RETURN_NULL();
-}
-
 static float8
 dist_cpoly_internal(CIRCLE *circle, POLYGON *poly)
 {
@@ -2947,48 +2909,6 @@ close_pb(PG_FUNCTION_ARGS)
    PG_RETURN_POINT_P(result);
 }
 
-
-/* close_sl()
- * Closest point on line to line segment.
- *
- * XXX THIS CODE IS WRONG
- * The code is actually calculating the point on the line segment
- * which is backwards from the routine naming convention.
- * Copied code to new routine close_ls() but haven't fixed this one yet.
- * - thomas 1998-01-31
- */
-Datum
-close_sl(PG_FUNCTION_ARGS)
-{
-#ifdef NOT_USED
-   LSEG       *lseg = PG_GETARG_LSEG_P(0);
-   LINE       *line = PG_GETARG_LINE_P(1);
-   Point      *result;
-   float8      d1,
-               d2;
-
-   result = (Point *) palloc(sizeof(Point));
-
-   if (lseg_interpt_line(result, lseg, line))
-       PG_RETURN_POINT_P(result);
-
-   d1 = line_closept_point(NULL, line, &lseg->p[0]);
-   d2 = line_closept_point(NULL, line, &lseg->p[1]);
-   if (float8_lt(d1, d2))
-       *result = lseg->p[0];
-   else
-       *result = lseg->p[1];
-
-   PG_RETURN_POINT_P(result);
-#endif
-
-   ereport(ERROR,
-           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-            errmsg("function \"close_sl\" not implemented")));
-
-   PG_RETURN_NULL();
-}
-
 /*
  * Closest point on line segment to line.
  *
@@ -3120,22 +3040,6 @@ close_sb(PG_FUNCTION_ARGS)
 }
 
 
-Datum
-close_lb(PG_FUNCTION_ARGS)
-{
-#ifdef NOT_USED
-   LINE       *line = PG_GETARG_LINE_P(0);
-   BOX        *box = PG_GETARG_BOX_P(1);
-#endif
-
-   /* think about this one for a while */
-   ereport(ERROR,
-           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-            errmsg("function \"close_lb\" not implemented")));
-
-   PG_RETURN_NULL();
-}
-
 /*---------------------------------------------------------------------
  *     on_
  *             Whether one object lies completely within another.
@@ -4503,20 +4407,6 @@ path_div_pt(PG_FUNCTION_ARGS)
 }
 
 
-Datum
-path_center(PG_FUNCTION_ARGS)
-{
-#ifdef NOT_USED
-   PATH       *path = PG_GETARG_PATH_P(0);
-#endif
-
-   ereport(ERROR,
-           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-            errmsg("function \"path_center\" not implemented")));
-
-   PG_RETURN_NULL();
-}
-
 Datum
 path_poly(PG_FUNCTION_ARGS)
 {
index 6b19ffddde9b72d7844f37cfdb9e2c56cb05dcfd..6b24d90c762b0d2e5b67fafb7553baa7b6375b1d 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 202112111
+#define CATALOG_VERSION_NO 202112131
 
 #endif
index 67f73cb6fb2b624a4931ea4df1642e1fdb5a9db6..9a3e74c3f638a5594f5849431b48ac994c52814c 100644 (file)
   castcontext => 'a', castmethod => 'f' },
 { castsource => 'lseg', casttarget => 'point', castfunc => 'point(lseg)',
   castcontext => 'e', castmethod => 'f' },
-{ castsource => 'path', casttarget => 'point', castfunc => 'point(path)',
-  castcontext => 'e', castmethod => 'f' },
 { castsource => 'path', casttarget => 'polygon', castfunc => 'polygon(path)',
   castcontext => 'a', castmethod => 'f' },
 { castsource => 'box', casttarget => 'point', castfunc => 'point(box)',
index 0075a02f32374e614b1144c22641e791050de783..2bc7cc35484971586e791d905e3298af3604a5e7 100644 (file)
 { oid => '969', descr => 'center of',
   oprname => '@@', oprkind => 'l', oprleft => '0', oprright => 'lseg',
   oprresult => 'point', oprcode => 'lseg_center' },
-{ oid => '970', descr => 'center of',
-  oprname => '@@', oprkind => 'l', oprleft => '0', oprright => 'path',
-  oprresult => 'point', oprcode => 'path_center' },
 { oid => '971', descr => 'center of',
   oprname => '@@', oprkind => 'l', oprleft => '0', oprright => 'polygon',
   oprresult => 'point', oprcode => 'poly_center' },
   oprresult => 'float8', oprcom => '<->(circle,polygon)',
   oprcode => 'dist_polyc' },
 
-# additional geometric operators - thomas 1997-07-09
-{ oid => '1524', descr => 'distance between',
-  oprname => '<->', oprleft => 'line', oprright => 'box', oprresult => 'float8',
-  oprcom => '<->(box,line)', oprcode => 'dist_lb' },
-{ oid => '1382', descr => 'distance between',
-  oprname => '<->', oprleft => 'box', oprright => 'line', oprresult => 'float8',
-  oprcom => '<->(line,box)', oprcode => 'dist_bl' },
-
 { oid => '1525', descr => 'intersect',
   oprname => '?#', oprleft => 'lseg', oprright => 'lseg', oprresult => 'bool',
   oprcom => '?#(lseg,lseg)', oprcode => 'lseg_intersect' },
   oprname => '##', oprleft => 'point', oprright => 'box', oprresult => 'point',
   oprcode => 'close_pb' },
 
-{ oid => '1566', descr => 'closest point to A on B',
-  oprname => '##', oprleft => 'lseg', oprright => 'line', oprresult => 'point',
-  oprcode => 'close_sl' },
 { oid => '1567', descr => 'closest point to A on B',
   oprname => '##', oprleft => 'lseg', oprright => 'box', oprresult => 'point',
   oprcode => 'close_sb' },
-{ oid => '1568', descr => 'closest point to A on B',
-  oprname => '##', oprleft => 'line', oprright => 'box', oprresult => 'point',
-  oprcode => 'close_lb' },
 { oid => '1577', descr => 'closest point to A on B',
   oprname => '##', oprleft => 'line', oprright => 'lseg', oprresult => 'point',
   oprcode => 'close_ls' },
index 79d787cd26af9daafc293a47818c462d49894345..4d992dc2241766b07b2a8fcd8aa56f15b7a7441d 100644 (file)
 { oid => '225',
   proname => 'lseg_center', prorettype => 'point', proargtypes => 'lseg',
   prosrc => 'lseg_center' },
-{ oid => '226',
-  proname => 'path_center', prorettype => 'point', proargtypes => 'path',
-  prosrc => 'path_center' },
 { oid => '227',
   proname => 'poly_center', prorettype => 'point', proargtypes => 'polygon',
   prosrc => 'poly_center' },
 { oid => '702',
   proname => 'dist_lp', prorettype => 'float8', proargtypes => 'line point',
   prosrc => 'dist_lp' },
-{ oid => '726',
-  proname => 'dist_lb', prorettype => 'float8', proargtypes => 'line box',
-  prosrc => 'dist_lb' },
-{ oid => '703',
-  proname => 'dist_bl', prorettype => 'float8', proargtypes => 'box line',
-  prosrc => 'dist_bl' },
 { oid => '727',
   proname => 'dist_sl', prorettype => 'float8', proargtypes => 'lseg line',
   prosrc => 'dist_sl' },
 { oid => '961',
   proname => 'close_pl', prorettype => 'point', proargtypes => 'point line',
   prosrc => 'close_pl' },
-{ oid => '962',
-  proname => 'close_sl', prorettype => 'point', proargtypes => 'lseg line',
-  prosrc => 'close_sl' },
-{ oid => '963',
-  proname => 'close_lb', prorettype => 'point', proargtypes => 'line box',
-  prosrc => 'close_lb' },
 
 { oid => '964', descr => 'large object unlink (delete)',
   proname => 'lo_unlink', provolatile => 'v', proparallel => 'u',
 { oid => '1532', descr => 'center of',
   proname => 'point', prorettype => 'point', proargtypes => 'lseg',
   prosrc => 'lseg_center' },
-{ oid => '1533', descr => 'center of',
-  proname => 'point', prorettype => 'point', proargtypes => 'path',
-  prosrc => 'path_center' },
 { oid => '1534', descr => 'center of',
   proname => 'point', prorettype => 'point', proargtypes => 'box',
   prosrc => 'box_center' },
index eb717d364340880e935077a7140f3d708811e05e..d91d829f0f6037b8e8b9ef92fb745f05a7e9662a 100644 (file)
@@ -1467,11 +1467,6 @@ SELECT l1.s, l2.s, l1.s <-> l2.s FROM LINE_TBL l1, LINE_TBL l2;
  {-1,0,3}                              | {-1,0,3}                              |        0
 (100 rows)
 
--- Distance to box
-SELECT l.s, b.f1, l.s <-> b.f1 FROM LINE_TBL l, BOX_TBL b;
-ERROR:  function "dist_lb" not implemented
-SELECT l.s, b.f1, b.f1 <-> l.s FROM LINE_TBL l, BOX_TBL b;
-ERROR:  function "dist_bl" not implemented
 -- Intersect with line
 SELECT l1.s, l2.s FROM LINE_TBL l1, LINE_TBL l2 WHERE l1.s ?# l2.s;
                    s                   |                   s                   
@@ -1773,9 +1768,6 @@ SELECT l.s, l1.s, l.s ## l1.s FROM LINE_TBL l, LSEG_TBL l1;
  {-1,0,3}                              | [(NaN,1),(NaN,90)]            | 
 (80 rows)
 
--- Closest point to box
-SELECT l.s, b.f1, l.s ## b.f1 FROM LINE_TBL l, BOX_TBL b;
-ERROR:  function "close_lb" not implemented
 --
 -- Line segments
 --
@@ -2376,9 +2368,6 @@ SELECT l1.s, l2.s, l1.s # l2.s FROM LSEG_TBL l1, LSEG_TBL l2;
  [(NaN,1),(NaN,90)]            | [(NaN,1),(NaN,90)]            | 
 (64 rows)
 
--- Closest point to line
-SELECT l.s, l1.s, l.s ## l1.s FROM LSEG_TBL l, LINE_TBL l1;
-ERROR:  function "close_sl" not implemented
 -- Closest point to line segment
 SELECT l1.s, l2.s, l1.s ## l2.s FROM LSEG_TBL l1, LSEG_TBL l2;
                s               |               s               |            ?column?             
@@ -2922,9 +2911,6 @@ SELECT f1, @-@ f1 FROM PATH_TBL;
  ((11,12),(13,14))         | 5.65685424949
 (9 rows)
 
--- Center
-SELECT f1, @@ f1 FROM PATH_TBL;
-ERROR:  function "path_center" not implemented
 -- To polygon
 SELECT f1, f1::polygon FROM PATH_TBL WHERE isclosed(f1);
         f1         |        f1         
index bbb6acd4555a9ede66340bda54303c26b10a4225..0aa06bcc9d88ca8007c403844f61f37e4849a8d3 100644 (file)
@@ -129,10 +129,6 @@ SELECT l1.s, l2.s FROM LINE_TBL l1, LINE_TBL l2 WHERE l1.s ?-| l2.s;
 -- Distance to line
 SELECT l1.s, l2.s, l1.s <-> l2.s FROM LINE_TBL l1, LINE_TBL l2;
 
--- Distance to box
-SELECT l.s, b.f1, l.s <-> b.f1 FROM LINE_TBL l, BOX_TBL b;
-SELECT l.s, b.f1, b.f1 <-> l.s FROM LINE_TBL l, BOX_TBL b;
-
 -- Intersect with line
 SELECT l1.s, l2.s FROM LINE_TBL l1, LINE_TBL l2 WHERE l1.s ?# l2.s;
 
@@ -145,9 +141,6 @@ SELECT l1.s, l2.s, l1.s # l2.s FROM LINE_TBL l1, LINE_TBL l2;
 -- Closest point to line segment
 SELECT l.s, l1.s, l.s ## l1.s FROM LINE_TBL l, LSEG_TBL l1;
 
--- Closest point to box
-SELECT l.s, b.f1, l.s ## b.f1 FROM LINE_TBL l, BOX_TBL b;
-
 --
 -- Line segments
 --
@@ -213,9 +206,6 @@ SELECT l.s, b.f1 FROM LSEG_TBL l, BOX_TBL b WHERE l.s ?# b.f1;
 -- Intersection point with line segment
 SELECT l1.s, l2.s, l1.s # l2.s FROM LSEG_TBL l1, LSEG_TBL l2;
 
--- Closest point to line
-SELECT l.s, l1.s, l.s ## l1.s FROM LSEG_TBL l, LINE_TBL l1;
-
 -- Closest point to line segment
 SELECT l1.s, l2.s, l1.s ## l2.s FROM LSEG_TBL l1, LSEG_TBL l2;
 
@@ -285,9 +275,6 @@ SELECT f1, area(f1) FROM PATH_TBL;
 -- Length
 SELECT f1, @-@ f1 FROM PATH_TBL;
 
--- Center
-SELECT f1, @@ f1 FROM PATH_TBL;
-
 -- To polygon
 SELECT f1, f1::polygon FROM PATH_TBL WHERE isclosed(f1);