[postgis-devel] [PostGIS] #231: New distance-calculations proposal
PostGIS
trac at osgeo.org
Fri Aug 7 06:33:37 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 nicklas):
Great
One thing to check is if we should use the old calculations for smaller
geometries. I guess maybe my function gives more overhead-cost than gain.
It also would be very easy to put in a rule where for instance npoints og
geom1 * npoints of geom2 is more than 500 or something like that otherwise
it just uses the old one.
The real gain is big geometries far from eachother. Then I have had cases
where the querytime reduses from 220000ms to jus about 2000 ms. Try the
queries at your slide 19 you mentioned, Regina. I think the querytime is
reduced by approx 90% at least eat some of them :-)
Now I'm working on a proposal for better handling of subgeoms. There is
two good things about it. First, of course it will reduce querytime when
there is many subgeoms involved in the geometries. st_distance(alaska,
texas) in Reginas dataset takes about 7 seconds with my patch, but with
this subgeoms handling it is under 1 sec.
But the other nice thing about it, is that it's usable innearest neighbour
queries. just collect all geometries and get the closest point with
st_shortestline. Then st_shortestline first arrange all incomming
geometries like it would have been just any subgeoms. find the closest one
and returns a line to the closest point of it.
I think it's a good thing. I have it running for st_shortestline and
st_distance but I have to modifie it to also take st_max_distance and
st_longestline.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/231#comment:5>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS
More information about the postgis-devel
mailing list