Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- osm=> SELECT f.id, uphill[1] as uphill,uphill[2] as uphill_rev,dist,round((uphill[1]*0.08+dist*15/1000)/5)*5 As time_n, round((uphill[2]*0.08+dist*15/1000)/5)*5 As time_rev FROM ( SELECT id,(SUM_AGG(elev)) AS uphill,MAX(dist) AS dist FROM ( SELECT * FROM ( SELECT elev,planet.id,ST_Length(planet.line)*ST_Line_Locate_Point(planet.line,(ST_Dump(ST_Intersection(planet.line,the_geom))).geom) As dist FROM contour, ( SELECT * FROM planet_trails_times LIMIT 20 ) AS planet WHERE ST_Intersects(the_geom,planet.line) ) As f ORDER BY dist ) AS f GROUP BY f.id ) AS f, planet_trails_times WHERE f.id=planet_trails_times.id;
- id | uphill | uphill_rev | dist | time_n | time_rev
- -----+--------+------------+------------------+--------+----------
- 35 | 450 | 450 | 307948.020225077 | 4655 | 4655
- 37 | 1150 | 1150 | 77528.285073006 | 1255 | 1255
- 38 | 2920 | 2900 | 191076.914469338 | 3100 | 3100
- 39 | 270 | 280 | 12725.6368767719 | 210 | 215
- 40 | 130 | 140 | 8450.45185986812 | 135 | 140
- 41 | 0 | 0 | 17.2246238208772 | 0 | 0
- 42 | 60 | 0 | 6128.02826133953 | 95 | 90
- 43 | 70 | 70 | 95001.1510235913 | 1430 | 1430
- 44 | 20 | 0 | 239.847710813882 | 5 | 5
- 45 | 1170 | 1180 | 79015.2557328517 | 1280 | 1280
- 46 | 970 | 980 | 65894.5339905987 | 1065 | 1065
- 47 | 470 | 470 | 52234.1287518399 | 820 | 820
- 48 | 190 | 200 | 99950.577966632 | 1515 | 1515
- 49 | 30 | 30 | 62500.9779750959 | 940 | 940
- 50 | 90 | 0 | 1052.62909435818 | 25 | 15
- 51 | 10 | 20 | 11459.2764260173 | 175 | 175
- 52 | 670 | 670 | 39103.3985016757 | 640 | 640
- 59 | 110 | 110 | 2050.89475062529 | 40 | 40
- 158 | 140 | 150 | 3815.82109589999 | 70 | 70
- (19 rows)
Add Comment
Please, Sign In to add comment