use of org.opentripplanner.index.model.StopClusterDetail in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getStopCluster.
/**
* Return a cluster of stops by its ID.
* A cluster is not the same thing as a GTFS parent station.
* Clusters are an unsupported experimental feature that was added to assist in "profile routing".
* As such the stop clustering method probably only works right with one or two GTFS data sets in the world.
*/
@GET
@Path("/clusters/{clusterId}")
public Response getStopCluster(@PathParam("clusterId") String clusterIdString) {
index.clusterStopsAsNeeded();
StopCluster cluster = index.stopClusterForId.get(clusterIdString);
if (cluster != null) {
return Response.status(Status.OK).entity(new StopClusterDetail(cluster, true)).build();
} else {
return Response.status(Status.NOT_FOUND).entity(MSG_404).build();
}
}
Aggregations