Package com.graphhopper.resources
Class RouteResource
java.lang.Object
com.graphhopper.resources.RouteResource
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 Summary
ConstructorsConstructorDescriptionRouteResource
(GraphHopperConfig config, GraphHopper graphHopper, ProfileResolver profileResolver, GHRequestTransformer ghRequestTransformer, Boolean hasElevation) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
doGet
(javax.servlet.http.HttpServletRequest httpReq, javax.ws.rs.core.UriInfo uriInfo, double minPathPrecision, Double minPathElevationPrecision, @NotNull List<GHPointParam> pointParams, String type, boolean instructions, boolean calcPoints, boolean enableElevation, boolean pointsEncoded, double pointsEncodedMultiplier, String profileName, String algoStr, String localeStr, List<String> pointHints, List<String> curbsides, List<String> snapPreventions, List<String> pathDetails, @NotNull List<Double> headings, boolean withRoute, boolean withTrack, boolean withWayPoints, String trackName, String timeString) javax.ws.rs.core.Response
static void
removeLegacyParameters
(PMap hints)
-
Constructor Details
-
RouteResource
@Inject public RouteResource(GraphHopperConfig config, GraphHopper graphHopper, ProfileResolver profileResolver, GHRequestTransformer ghRequestTransformer, @Named("hasElevation") Boolean hasElevation)
-
-
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
-