private void writeStopIntoSequence(Stop stop) throws IOException { if (preStop != null) { GHResponse resp = preStop.road(stop); if (shapePtSequence != -1) { PointList points = resp.getPoints(); for (GHPoint3D point : points) { shapePtLat = point.lat; shapePtLon = point.lon; writeShape(); shapePtSequence++; } } time = time.add(new TimeString(resp.getTime())).add(TimeString.seconds(30)); } else { if (shapesFile.get("shape_id").contains(shapeId())) { shapePtSequence = -1; } else { log.println("Writing shape: " + shapeId()); shapePtSequence = 0; } } stopId = stop.stopId(); writeStopTime(); preStop = stop; sequence++; }