conveyal / analysis-backend

Server component of Conveyal Analysis
http://conveyal.com/analysis
MIT License
23 stars 12 forks source link

Fix automatic stop creation #119

Closed ansoncfit closed 6 years ago

ansoncfit commented 6 years ago

118 was caused by distanceToLastStop = distanceToLineSegmentStart being outside an if block it should have been inside, which had the effect of claiming stops were created at the end of every segment and making the while condition of the main stop-creation block false (unless there happened to be a segment longer than spacing).

This PR adds some clarifying comments and fixes the main issue, making this consistent with https://github.com/conveyal/analysis-ui/blob/dev/lib/utils/get-stops.js#L53 (which maybe begs the question why we're duplicating this code in both the client and the server).

Requesting a merge straight into master, since many intermediate changes have been made to dev, and users have requested a fix.

codecov-io commented 6 years ago

Codecov Report

Merging #119 into master will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #119   +/-   ##
=========================================
  Coverage     14.14%   14.14%           
  Complexity       36       36           
=========================================
  Files            47       47           
  Lines          1859     1859           
  Branches        143      143           
=========================================
  Hits            263      263           
  Misses         1590     1590           
  Partials          6        6
Impacted Files Coverage Δ Complexity Δ
...ava/com/conveyal/taui/models/ModificationStop.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 513c940...8dbc20f. Read the comment docs.