This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
thinkgeo_cloud_routing [2019/06/21 21:14] brianr created |
thinkgeo_cloud_routing [2019/12/16 21:57] (current) brianr [TSP] |
||
---|---|---|---|
Line 4: | Line 4: | ||
===== RESTful APIs ===== | ===== RESTful APIs ===== | ||
- | * //**Try it Online**:// All the ThinkGeo Projection RESTful APIs can be tested online following the instructions below: | + | * //**Try it Online**:// All the ThinkGeo Cloud RESTful APIs can be tested online following the instructions below: |
* Get a ThinkGeo Cloud Client Key. Check out [[https://wiki.thinkgeo.com/wiki/thinkgeo_cloud_client_keys_guideline|ThinkGeo Cloud Client Keys Guideline]] see how to apply one. It's free for 60 days. | * Get a ThinkGeo Cloud Client Key. Check out [[https://wiki.thinkgeo.com/wiki/thinkgeo_cloud_client_keys_guideline|ThinkGeo Cloud Client Keys Guideline]] see how to apply one. It's free for 60 days. | ||
* Visit our [[https://cloud.thinkgeo.com/help/|ThinkGeo Cloud API Explorer]], click the "Authorize" button at the top and enter your client credentials. You are then free to play with all the APIs online. | * Visit our [[https://cloud.thinkgeo.com/help/|ThinkGeo Cloud API Explorer]], click the "Authorize" button at the top and enter your client credentials. You are then free to play with all the APIs online. | ||
Line 18: | Line 18: | ||
</code> | </code> | ||
- | //Details coming soon// | + | //**URL Parameters**// |
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinates</span>: A semicolon-delimited list of {y},{x} coordinates to travel in order.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">srid</span>: Optional. The SRID of the input and output feature's coordinate system. Defaults to 4326.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">proj4String</span>: Optional. The Proj4 string of the input and output feature's coordinate system.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">turnByTurn</span>: Optional. Whether to return turn-by-turn instructions or not. Defaults to false.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadius</span>: Optional. The maximum distance of a coordinate can be snapped to the road network. Defaults to 5000 meters.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadiusUnit</span>: Optional. The unit of the radius to snap the input coordinate to road network.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">distanceUnit</span>: Optional. The unit of measure in which to express the length of the route.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">durationUnit</span>: Optional. The unit of the time in which to express the duration of the route.</span></html> | ||
- | Visit the [[https://cloud.thinkgeo.com/help/index.html#/Routing/Get%20routeV1|Routing]] API explorer page and click "Try It Out" to explore this API online. | + | Visit the [[https://cloud.thinkgeo.com/help/index.html#/Routing/Get%20routeV1|Routing]] API explorer page and click "Try It Out" to explore this API online. |
==== Find Service Area ==== | ==== Find Service Area ==== | ||
Line 30: | Line 38: | ||
</code> | </code> | ||
- | //Details coming soon// | + | //**URL Parameters**// |
+ | * <html><span class="api-parameter"><span class="api-parameter-name">pointY</span>: The Y coordinate of the point.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">pointX</span>: The X coordinate of the point.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">srid</span>: Optional. The SRID of the input and output feature's coordinate system. Defaults to 4326.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">proj4String</span>: Optional. The Proj4 string of the input and output feature's coordinate system.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">serviceLimits</span>: A comma-delimited list of integer array, which specifies the travel distances or travel times to generate for each facility. The maximum number of <span class="api-parameter-name">serviceLimits</span> is 6.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">contourGranularity</span>: Optional. A float in the range of (0, 1.0) to identify how much we want to remove the contours. 0 means do not remove any contour at all, 1.0 means only return the largest contours.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadius</span>: Optional. The maximum distance of a coordinate can be snapped to the road network. Defaults to 5000 meters.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadiusUnit</span>: Optional. The unit of the radius to snap the input coordinate to road network.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">distanceUnit</span>: Optional. The unit of measure in which to express the length of the route.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">durationUnit</span>: Optional. The unit of the time in which to express the duration of traveling the route.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">gridSizeInMeters</span>: Optional. A float value in meters used as the tolerance for concave polygon. The smaller of the number is getting more accurate of the service areas but slower performance, better a value bigger than 300, but depends on the size of the result coverage. Defaults to 400.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">serviceAreaSeparationType</span>: Optional. Specify whether to include the region covered by the smaller service area into the region covered by the larger service area.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">serviceAreaType</span>: Optional. Indicates whether the result is returned as polygons enveloping the accessible roads, or as linestrings surrounding those roads.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">serviceLimitsType</span>: Optional. Indicates the unit of the <span class="api-parameter-name">serviceLimits</span>.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">travelDirection</span>: Optional. Indicates the direction of travel to or from the coordinate.</span></html> | ||
Visit the [[https://cloud.thinkgeo.com/help/index.html#/Routing/Get%20service%20areaV1|Routing: Service Area]] API explorer page and click "Try It Out" to explore this API online. | Visit the [[https://cloud.thinkgeo.com/help/index.html#/Routing/Get%20service%20areaV1|Routing: Service Area]] API explorer page and click "Try It Out" to explore this API online. | ||
+ | |||
+ | ==== Get Cost Matrix ==== | ||
+ | Calculates the travel time or distance between each waypoint in a series of coordinates and returns a matrix. | ||
+ | |||
+ | <code html> | ||
+ | HTTP GET | ||
+ | https://cloud.thinkgeo.com/api/v1/route/matrix/?origins={origins}&destinations={destinations} | ||
+ | </code> | ||
+ | |||
+ | //**URL Parameters**// | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">origins</span>: A semicolon-delimited list of {y},{x} coordinates to treat at route starting points.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">destinations</span>: A semicolon-delimited list of {y},{x} coordinates to treat as route ending points.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">costMatrixType</span>: Optional. Whether to return a matrix of travel times or distances. Acceptable values are <code>time</code> and <code>distance</code>. Defaults to <code>time</code>.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">srid</span>: Optional. The SRID of the coordinate system in which to express the input and output origins and destinations. Defaults to 4326.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">proj4String</span>: Optional. The Proj4 string of the coordinate system in which to express the input and output origins and destinations.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadius</span>: Optional. The maximum distance of a coordinate can be snapped to the road network. Defaults to 5000 meters.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadiusUnit</span>: Optional. The unit of the radius to snap the input coordinate to road network.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">distanceUnit</span>: Optional. The unit of measure in which to express the length of each route in the matrix.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">durationUnit</span>: Optional. The unit of the time in which to express the travel time for each route in the matrix.</span></html> | ||
+ | |||
+ | Visit the [[https://cloud.thinkgeo.com/help/index.html#/Routing/Get%20cost%20matrixV1|Routing: Cost Matrix]] API explorer page and click "Try It Out" to explore this API online. | ||
+ | |||
+ | ==== Optimize Route for TSP ==== | ||
+ | Find the shortest route through a series of destinations, optionally returning to the starting point. | ||
+ | |||
+ | <code html> | ||
+ | HTTP GET | ||
+ | https://cloud.thinkgeo.com/api/v1/route/optimization/{coordinates} | ||
+ | </code> | ||
+ | |||
+ | //**URL Parameters**// | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinates</span>: A semicolon-separated list of {y},{x} coordinate pairs to visit along the route. You can specify between 2 and 25 coordinates.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">srid</span>: Optional. The SRID of the input and output feature's coordinate system. Defaults to 4326.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">proj4String</span>: Optional. The Proj string of the input and output feature's coordinate system.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">roundtrip</span>: Optional. Indicates whether the returned route is round-trip, meaning the route returns to the starting location (true) or not (false). Defaults to true.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">source</span>: Optional. Identifies which coordinate should be used as the start point of the route. Acceptable values are <code>first</code>, which uses the first point in the coordinates array, or <code>any</code>, which chooses the most efficient start point. Defaults to <code>first</code>.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">destination</span>: Optional. Identifies which coordinate should be used as the final destination of the route. Acceptable values are <code>any</code>, which chooses the most efficient start point, or <code>last</code>, which uses the last point in the coordinates array. Defaults to <code>any</code>.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">turnByTurn</span>: Optional. Specifies whether to return turn-by-turn directions with your route. Defaults to false.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadius</span>: Optional. The maximum distance a coordinate can be snapped to the road network. Defaults to 5000.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">coordinateSnapRadiusUnit</span>: Optional. The unit of the radius to snap the input coordinate to road network. Defaults to meters.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">distanceUnit</span>: Optional. The unit of measure in which to express the length of the route. Defaults to meters.</span></html> | ||
+ | * <html><span class="api-parameter"><span class="api-parameter-name">durationUnit</span>: Optional. The unit of the time in which to express the duration of traveling the route. Defaults to minutes.</span></html> | ||
+ | |||
+ | Visit the [[https://cloud.thinkgeo.com/help/index.html#/Routing/OptimizationV1|Routing: Optimization]] API explorer page and click "Try It Out" to explore this API online. | ||
===== Consume from Client Side===== | ===== Consume from Client Side===== | ||
Line 52: | Line 119: | ||
Online Sample: | Online Sample: | ||
- | <code csharp> | + | * [[https://samples.thinkgeo.com/cloud/#RoutinginNorthAmerica|ThinkGeo Cloud Routing Online Sample]] |
- | + | ||
- | Coming soon | + | |
- | + | ||
- | </code> | + | |
Desktop Sample: | Desktop Sample: |