Package org.opentripplanner.analyst

Examples of org.opentripplanner.analyst.TimeSurface


            EarliestArrivalSPTService sptService = new EarliestArrivalSPTService();
            sptService.maxDuration = (60 * cutoffMinutes);
            ShortestPathTree spt = sptService.getShortestPathTree(req);
            req.cleanup();
            if (spt != null) {
                TimeSurface surface = new TimeSurface(spt);
                surface.params = Maps.newHashMap();
                for (Map.Entry<String, List<String>> e : uriInfo.getQueryParameters().entrySet()) {
                    // include only the first instance of each query parameter
                    surface.params.put(e.getKey(), e.getValue().get(0));
                }
View Full Code Here


    }

    /** Describe a specific surface. */
    @GET @Path("/{surfaceId}")
    public Response getTimeSurfaceList (@PathParam("surfaceId") Integer surfaceId) {
        TimeSurface surface = server.surfaceCache.get(surfaceId);
        if (surface == null) return Response.status(Response.Status.NOT_FOUND).entity("Invalid surface ID.").build();
        return Response.ok().entity(new TimeSurfaceShort(surface)).build();
        // DEBUG return Response.ok().entity(surface).build();
    }
View Full Code Here

                                  @QueryParam("targets"String  targetPointSetId,
                                  @QueryParam("origins"String  originPointSetId,
                                  @QueryParam("detail")   boolean detail) {


      final TimeSurface surf = server.surfaceCache.get(surfaceId);
     
        if (surf == null) return badRequest("Invalid TimeSurface ID.");
        final PointSet pset = server.pointSetCache.get(targetPointSetId);
        if (pset == null) return badRequest("Missing or invalid target PointSet ID.");
       
View Full Code Here

    /** Create vector isochrones for a surface. */
    @GET @Path("/{surfaceId}/isochrone")
    public Response getIsochrone (
            @PathParam("surfaceId") Integer surfaceId,
            @QueryParam("spacing") int spacing) {
        final TimeSurface surf = server.surfaceCache.get(surfaceId);
        if (surf == null) return badRequest("Invalid TimeSurface ID.");
        if (spacing < 1) spacing = 5;
        List<IsochroneData> isochrones = getIsochronesAccumulative(surf, spacing);
        final FeatureCollection fc = LIsochrone.makeContourFeatures(isochrones);
        return Response.ok().entity(new StreamingOutput() {
View Full Code Here

                            @PathParam("x") int x,
                            @PathParam("y") int y,
                            @PathParam("z") int z) throws Exception {

        Envelope2D env = SlippyTile.tile2Envelope(x, y, z);
        TimeSurface surfA = server.surfaceCache.get(surfaceId);
        if (surfA == null) return badRequest("Unrecognized surface ID.");
         
        TileRequest tileRequest = new TileRequest(surfA.routerId, env, 256, 256);
      
        MIMEImageFormat imageFormat = new MIMEImageFormat("image/png");
View Full Code Here

            rr.setRoutingContext(graph, tstop, null); // Set origin vertex directly instead of generating link edges
            astar.setTraverseVisitor(new ExtremaPropagationTraverseVisitor(mins[index], maxs[index]));
            ShortestPathTree spt = astar.getShortestPathTree(rr, 5);
            rr.rctx.destroy();
        }
        minSurface = new TimeSurface(this, false);
        maxSurface = new TimeSurface(this, true);
        LOG.info("done making timesurfaces.");
        return new P2<TimeSurface>(minSurface, maxSurface);
    }
View Full Code Here

TOP

Related Classes of org.opentripplanner.analyst.TimeSurface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.