|
399 | 399 | WHEN last_roundabout IS NOT NULL THEN |
400 | 400 | CASE |
401 | 401 | WHEN ST_Intersects(last_roundabout,ST_StartPoint(f.geom)) THEN |
402 | | - CASE |
| 402 | + CASE |
403 | 403 | WHEN ST_LineLocatePoint(last_roundabout, ST_EndPoint(full_way)) > ST_LineLocatePoint(last_roundabout, ST_StartPoint(f.geom)) THEN |
404 | 404 | full_way:= ST_MakeLine(full_way,ST_LineSubstring(last_roundabout, ST_LineLocatePoint(last_roundabout, ST_EndPoint(full_way)), 1)); |
405 | 405 | full_way:= ST_MakeLine(full_way,ST_LineSubstring(last_roundabout, 0, ST_LineLocatePoint(last_roundabout, ST_StartPoint(f.geom)))); |
|
408 | 408 | END CASE; |
409 | 409 | full_way:= ST_MakeLine(full_way,f.geom); |
410 | 410 | WHEN ST_Intersects(last_roundabout,ST_EndPoint(f.geom)) THEN |
411 | | - CASE |
| 411 | + CASE |
412 | 412 | WHEN ST_LineLocatePoint(last_roundabout, ST_EndPoint(full_way)) > ST_LineLocatePoint(last_roundabout, ST_EndPoint(f.geom)) THEN |
413 | 413 | full_way:= ST_MakeLine(full_way,ST_LineSubstring(last_roundabout, ST_LineLocatePoint(last_roundabout, ST_EndPoint(full_way)), 1)); |
414 | 414 | full_way:= ST_MakeLine(full_way,ST_LineSubstring(last_roundabout, 0, ST_LineLocatePoint(last_roundabout, ST_EndPoint(f.geom)))); |
|
475 | 475 | ROW_NUMBER () OVER (PARTITION BY route_linestring.id |
476 | 476 | ORDER BY stop_platform.morder) AS stop_order, |
477 | 477 | ROW_NUMBER () OVER (PARTITION BY route_linestring.id |
478 | | - ORDER BY ST_LineLocatePoint(ST_OffsetCurve(route_linestring.geom, -10), stop_platform.geom) DESC) AS projected_stop_order |
| 478 | + ORDER BY ST_LineLocatePoint(ST_OffsetCurve(route_linestring.geom, -10), stop_platform.geom) DESC) AS projected_stop_order, |
| 479 | + (CASE |
| 480 | + WHEN LEAD(stop_platform.morder, 1) OVER (PARTITION BY route_linestring.id |
| 481 | + ORDER BY stop_platform.morder) IS NULL THEN 1 |
| 482 | + ELSE 0 |
| 483 | + END) AS is_last_platform |
479 | 484 | FROM stop_platform |
480 | 485 | JOIN route_linestring ON route_linestring.id = stop_platform.id |
481 | 486 | WHERE stop_platform.mrole IN ('platform', |
|
506 | 511 | ST_AsText(ST_Transform(platform_that_can_project.stop, 4326)) |
507 | 512 | FROM platform_that_can_project |
508 | 513 | JOIN route_linestring ON route_linestring.id = platform_that_can_project.route_id |
509 | | -JOIN ( |
510 | | - SELECT |
511 | | - platform_that_can_project.route_id AS route_id, |
512 | | - MAX(platform_that_can_project.stop_order) AS last_platform |
513 | | - FROM platform_that_can_project |
514 | | - GROUP BY platform_that_can_project.route_id |
515 | | -) AS y ON platform_that_can_project.route_id = y.route_id |
516 | 514 | WHERE ST_DWithin(route_linestring.geom, platform_that_can_project.stop, 50) AND |
517 | 515 | NOT ST_Intersects(ST_Buffer(route_linestring.geom, 50, 'side={}'), platform_that_can_project.stop) AND |
518 | 516 | route_linestring.public_transport_mode IN ('bus', 'trolleybus', 'coach', 'share_taxi', 'school_bus') AND |
519 | | - platform_that_can_project.stop_order <> last_platform AND |
| 517 | + platform_that_can_project.is_last_platform <> 1 AND |
520 | 518 | platform_that_can_project.stop_order <> 1 |
521 | 519 | """ |
522 | 520 |
|
@@ -566,7 +564,7 @@ def __init__(self, config, logger = None): |
566 | 564 | self.callbackA0 = lambda res: {"class":10, "data":[self.node_full, self.positionAsText]} |
567 | 565 | self.callback100 = lambda res: {"class":11, "data":[self.relation_full, self.positionAsText]} |
568 | 566 | self.callback110 = lambda res: {"class":12, "data":[self.relation_full, self.any_full, self.positionAsText]} |
569 | | - |
| 567 | + |
570 | 568 | if self.config.options.get("driving_side") == "left": |
571 | 569 | self.buffer_driving_side = "left" |
572 | 570 | else: |
|
0 commit comments