Search in sources :

Example 1 with StopClusterDetail

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();
    }
}
Also used : StopCluster(org.opentripplanner.profile.StopCluster) StopClusterDetail(org.opentripplanner.index.model.StopClusterDetail) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 StopClusterDetail (org.opentripplanner.index.model.StopClusterDetail)1 StopCluster (org.opentripplanner.profile.StopCluster)1