Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Plain Text by A ( 12 years ago )
rumap_1402=# EXPLAIN ANALYZE SELECT ptype, line, und_constr, fullname,
CASE WHEN ptype IN ('RWPL', 'RWST') THEN (SELECT 90 + degrees(ST_Azimuth(
ST_Line_Interpolate_Point(
r.geom,
CASE
WHEN
(ST_Line_Locate_Point(r.geom, ST_ClosestPoint(r.geom, p.geom)) - 10.0/ST_Length(r.geom) < 0)
THEN
0
ELSE
ST_Line_Locate_Point(r.geom, ST_ClosestPoint(r.geom, p.geom)) - 10.0/ST_Length(r.geom)
END
),
ST_Line_Interpolate_Point(
r.geom,
CASE
WHEN
(ST_Line_Locate_Point(r.geom, ST_ClosestPoint(r.geom, p.geom)) + 10.0/ST_Length(r.geom) > 1)
THEN
1
ELSE
ST_Line_Locate_Point(r.geom, ST_ClosestPoint(r.geom, p.geom)) + 10.0/ST_Length(r.geom)
END
)))
FROM (SELECT * FROM (SELECT (ST_Dump(ST_Multi(r.geom))).geom AS geom FROM rway r WHERE ST_DWithin(r.geom, p.geom, 100)) r ORDER BY ST_Distance(r.geom, p.geom) LIMIT 1) r) END as angle
FROM transport p WHERE ptype IN ('TMST', 'BUST', 'WHRF', 'RWPL', 'RWST', 'PORT', 'MREX', 'MTEX', 'MRST', 'MTST', 'AIRP') AND p.geom && ST_SetSRID('BOX3D(4186303.16512478 7434571.119133374,4227884.908511939 7476152.862520533)'::box3d, 3395);
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Bitmap Heap Scan on transport p (cost=100.14..21182.63 rows=2121 width=189) (actual time=2.465..239.356 rows=4343 loops=1)
Recheck Cond: (geom && '0103000020430D000001000000050000000DCF22955FF04F4196E19FC7525C5C410DCF22955FF04F4152893337EE845C41430F253ACB20504152893337EE845C41430F253ACB20504196E19FC7525C5C410DCF22955FF04F4196E19FC7525C5C41'::geometry)
Filter: ((ptype)::text = ANY ('{TMST,BUST,WHRF,RWPL,RWST,PORT,MREX,MTEX,MRST,MTST,AIRP}'::text[]))
-> Bitmap Index Scan on transport_geom_gist (cost=0.00..99.60 rows=3113 width=0) (actual time=2.194..2.194 rows=4489 loops=1)
Index Cond: (geom && '0103000020430D000001000000050000000DCF22955FF04F4196E19FC7525C5C410DCF22955FF04F4152893337EE845C41430F253ACB20504152893337EE845C41430F253ACB20504196E19FC7525C5C410DCF22955FF04F4196E19FC7525C5C41'::geometry)
SubPlan 1
-> Subquery Scan on r (cost=8.80..8.88 rows=1 width=32) (actual time=4.845..4.845 rows=1 loops=48)
-> Limit (cost=8.80..8.81 rows=1 width=32) (actual time=4.628..4.628 rows=1 loops=48)
-> Sort (cost=8.80..8.81 rows=1 width=32) (actual time=4.627..4.627 rows=1 loops=48)
Sort Key: (st_distance(r.geom, p.geom))
Sort Method: top-N heapsort Memory: 33kB
-> Subquery Scan on r (cost=0.00..8.79 rows=1 width=32) (actual time=2.670..4.616 rows=6 loops=48)
-> Index Scan using rway_geom_gist on rway r (cost=0.00..8.53 rows=1 width=39044) (actual time=2.655..4.565 rows=6 loops=48)
Index Cond: (geom && st_expand(p.geom, 100::double precision))
Filter: ((p.geom && st_expand(geom, 100::double precision)) AND _st_dwithin(geom, p.geom, 100::double precision))
Total runtime: 239.572 ms
(16 rows)
Revise this Paste
Parent: 73226
Children: 73228