pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Implement poly_distance().
Date: Mon, 13 Dec 2021 22:33:40 +0000
Message-ID: <E1mwtt6-0007ky-Eg@gemulon.postgresql.org> (raw)

Implement poly_distance().

geo_ops.c contains half a dozen functions that are just stubs throwing
ERRCODE_FEATURE_NOT_SUPPORTED.  Since it's been like that for more
than twenty years, there's clearly not a lot of interest in filling in
the stubs.  However, I'm uncomfortable with deleting poly_distance(),
since every other geometric type supports a distance-to-another-object-
of-the-same-type function.  We can easily add this capability by
cribbing from poly_overlap() and path_distance().

It's possible that the (existing) test case for this will show some
numeric instability, but hopefully the buildfarm will expose it if so.

In passing, improve the documentation to try to explain why polygons
are distinct from closed paths in the first place.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c5c192d7bdfa78f19e735610488b1cc5ad6e41cc

Modified Files
--------------
doc/src/sgml/datatype.sgml             |  5 ++-
src/backend/utils/adt/geo_ops.c        | 77 +++++++++++++++++++++++++++++-----
src/test/regress/expected/geometry.out | 54 +++++++++++++++++++++++-
3 files changed, 123 insertions(+), 13 deletions(-)



Message-ID: <E1mwtt6-0007ky-Eg@gemulon.postgresql.org>
Permalink:  ../E1mwtt6-0007ky-Eg@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mwtt6-0007ky-Eg@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Implement poly_distance().
  In-Reply-To: <E1mwtt6-0007ky-Eg@gemulon.postgresql.org>
  References: <E1mwtt6-0007ky-Eg@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox