[postgis-devel] [PostGIS] #231: New distance-calculations proposal
PostGIS
trac at osgeo.org
Fri Aug 7 08:51:07 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):
Hmm I see. Strange. I ran my torture ST_Distance tests against this (but
it wasn't really designed to catch corner cases). It did come up with
when dealing with M and Z geometries, your distance is off by a decimal
from the other. I wonder if this is some other difference between 1.4 and
1.5 and not specifically your changes.
See below query:
In 8.4 1.4 gives -- 5.65685424949238
4.24264068711929
In 8.4 1.5 with your patch gives -- 5.65685424949238
4.24264068711928
But its not a significant difference:
--ST_Distance LineSet3D(g1, g2): Start Testing MultiLineMSet, LINESTRING
SELECT ST_Distance(foo1.the_geom, foo2.the_geom)
FROM ((SELECT ST_Collect(s.the_geom) As the_geom
FROM (SELECT
ST_MakeLine(ST_SetSRID(ST_MakePointM(i,j,m),4326),ST_SetSRID(ST_MakePointM(j,i,m),4326))
As the_geom
FROM generate_series(-10,50,20) As i
CROSS JOIN generate_series(50,70, 25) As j
CROSS JOIN generate_series(1,2) As m
WHERE NOT(i = j)) As s)) As foo1 CROSS JOIN
((SELECT ST_SetSRID(ST_MakeLine(ST_MakePoint(i,j,k),
ST_MakePoint(i+k,j+k,k)),4326) As the_geom
FROM generate_series(-10,50,20) As i
CROSS JOIN generate_series(40,70, 20) j
CROSS JOIN generate_series(1,2) k
ORDER BY i, j, i+j+k, k, i*j*k)) As foo2
LIMIT 2;
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/231#comment:8>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS
More information about the postgis-devel
mailing list