Hi Alan.

Also I'm not sure if the "service1 c, service1 d" and the "AND c.service_id<>
d.service_id" parts are right. I'm not sure but sinse you don't uses this
two tables in your query you can remove that parts of your query and it can
be faster cause otherwise this two tables will be combined as cartesian
product with the others and I don't think this is what you want. (I'm not
pretty sure but I think this is what will happen if you do not remove that
parts of your querys).

Rodrigo.

On 7/10/07, Paul Ramsey <[EMAIL PROTECTED]> wrote:

Try this:

CREATE table topology (stop_a, stop_b, distance)
AS SELECT DISTINCT a.stop_reference, b.stop_reference,
distance(a.east_north, b.east_north)
FROM bus_stops1 a, bus_stops1 b, service1 c, service1 d
WHERE distance(a.east_north, b.east_north) < 200
AND expand(a.east_north, 200) && b.east_north
AND a.stop_reference <> b.stop_reference
AND c.service_id <> d.service_id
ORDER BY distance;

--

   Paul Ramsey
   Refractions Research
   http://www.refractions.net
   [EMAIL PROTECTED]
   Phone: 250-383-3022
   Cell: 250-885-0632
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to