[postgis-devel] [PostGIS] #231: New distance-calculations proposal
PostGIS
trac at osgeo.org
Mon Oct 19 04:38:55 PDT 2009
#231: New distance-calculations proposal
--------------------------+-------------------------------------------------
Reporter: nicklas | Owner: robe
Type: enhancement | Status: assigned
Priority: medium | Milestone: postgis 1.5.0
Component: postgis | Version:
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by robe):
Ah yes its good we can figure out how a black box works by interrogating
it.
Speaking of ST_ShortestLine and ST_LongestLine, as much as I hate non-
symmetric functions and introducing trivial functions, I really think we
should have a ST_ClosestPoint and ST_FurthestPoint.
Which would be wrappers like the below (might be better to do them in C
than as SQL wrappers)
{{{
ST_ClosestPoint(A,B) => SELECT ST_StartPoint(ST_ShortestLine(A,B));
ST_FurthestPoint(A,B) => SELECT ST_StartPoint(ST_LongestLine(A,B));
}}}
And as you can see would return the respective closest/furthest point on A
from geometry B. The reason I think we need these is because I think 80%
of the time people will just take our 2 gifts for the price of 1 and pull
out one of them and discard the other. At least that's what in 80% of my
usecases I would do.
Its also a vocabulary thing -- I think people think in terms of closest
furthest, nearest furthest. So when you say shortest line/longest line --
I think people will be scratching their heads, where as if you say "This
will give you the closest point", then lightbulbs will go off. The
longest and shortest should of course stay since when you need both points
at the same time you would use those.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/231#comment:22>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS
More information about the postgis-devel
mailing list