Class RouteResource

java.lang.Object
com.graphhopper.resources.RouteResource

@Path("route") public class RouteResource extends Object
Resource to use GraphHopper in a remote client application like mobile or browser. Note: If type is json it returns the points in GeoJson array format [longitude,latitude] unlike the format "lat,lon" used for the request. See the full API response format in docs/web/api-doc.md
Author:
Peter Karich
  • Constructor Details

  • Method Details

    • doGet

      @GET @Produces({"application/json","application/xml","application/gpx+xml"}) public javax.ws.rs.core.Response doGet(@Context javax.servlet.http.HttpServletRequest httpReq, @Context javax.ws.rs.core.UriInfo uriInfo, @QueryParam("way_point_max_distance") @DefaultValue("0.5") double minPathPrecision, @QueryParam("elevation_way_point_max_distance") Double minPathElevationPrecision, @QueryParam("point") @NotNull @NotNull List<GHPointParam> pointParams, @QueryParam("type") @DefaultValue("json") String type, @QueryParam("instructions") @DefaultValue("true") boolean instructions, @QueryParam("calc_points") @DefaultValue("true") boolean calcPoints, @QueryParam("elevation") @DefaultValue("false") boolean enableElevation, @QueryParam("points_encoded") @DefaultValue("true") boolean pointsEncoded, @QueryParam("points_encoded_multiplier") @DefaultValue("1e5") double pointsEncodedMultiplier, @QueryParam("profile") String profileName, @QueryParam("algorithm") @DefaultValue("") String algoStr, @QueryParam("locale") @DefaultValue("en") String localeStr, @QueryParam("point_hint") List<String> pointHints, @QueryParam("curbside") List<String> curbsides, @QueryParam("snap_prevention") List<String> snapPreventions, @QueryParam("details") List<String> pathDetails, @QueryParam("heading") @NotNull @NotNull List<Double> headings, @QueryParam("gpx.route") @DefaultValue("true") boolean withRoute, @QueryParam("gpx.track") @DefaultValue("true") boolean withTrack, @QueryParam("gpx.waypoints") @DefaultValue("false") boolean withWayPoints, @QueryParam("gpx.trackname") @DefaultValue("GraphHopper Track") String trackName, @QueryParam("gpx.millis") String timeString)
    • doPost

      @POST @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response doPost(@NotNull @NotNull GHRequest request, @Context javax.servlet.http.HttpServletRequest httpReq)
    • removeLegacyParameters

      public static void removeLegacyParameters(PMap hints)