### Multiple Start Points Source: https://github.com/2gis/docs-mirror/blob/main/docs/api/navigation/directions/examples.mdx Example showing how to specify multiple start points for optimal routing. ```APIDOC ### Multiple Start Points Specify multiple start points by setting `"start": true` for each. ### Request Body Example ```json "points": [ { "type": "stop", "x": 82.93057, "y": 54.943207, "start": true }, { "type": "stop", "x": 82.93856, "y": 54.943112, "start": true }, { "type": "stop", "x": 82.945039, "y": 55.033879 } ] ``` ``` -------------------------------- ### Full Example Rules File Source: https://github.com/2gis/docs-mirror/blob/main/docs/on-premise-api-platform/api-platform/install/navigation.mdx This is a comprehensive example of a rules file for the API Platform, covering various transport types and query types. Copy only the necessary blocks for your installation. ```yaml rules: - name: freeroam queries: ["free_roam"] routing: [] - name: all-car queries: ["routing", "get_hull", "map_matching", "route_planner", "area_clustering", "get_pairs", "get_dist_matrix"] routing: ["driving"] - name: all-truck queries: ["routing", "get_dist_matrix"] routing: ["truck"] - name: all-pedestrian queries: ["routing", "get_hull", "get_pairs", "get_dist_matrix"] routing: ["pedestrian"] - name: all-bicycle queries: ["routing", "get_hull", "get_pairs", "get_dist_matrix"] routing: ["bicycle", "scooter"] - name: all-taxi queries: ["routing", "get_pairs", "get_dist_matrix"] routing: ["taxi"] - name: all-motorcycle queries: ["routing", "get_hull", "get_dist_matrix"] routing: ["motorcycle"] - name: all-ctx queries: ["public_transport", "get_dist_matrix", "get_hull"] routing: ["public_transport", "ctx"] - name: emergency queries: ["routing"] routing: ["emergency"] - name: async-car queries: ["get_dist_matrix"] routing: ["driving"] - name: async-truck queries: ["get_dist_matrix"] routing: ["truck"] - name: async-bicycle queries: ["get_dist_matrix"] routing: ["bicycle", "scooter"] - name: async-pedestrian queries: ["get_dist_matrix"] routing: ["pedestrian"] - name: async-ctx queries: ["get_dist_matrix"] routing: ["ctx"] - name: route-planner queries: ["route_planner", "area_clustering"] routing: ["driving"] ``` -------------------------------- ### Initial GIS Platform Installation with Helm Source: https://github.com/2gis/docs-mirror/blob/main/docs/on-premise-gis-platform/install/installation.mdx Use this Helm command for the initial installation of the GIS Platform. Ensure you specify the correct version and use the prepared values file. The `spcore.resetCluster=true` flag is crucial for the first-time setup. ```bash helm upgrade --install --version=VERSION --atomic --wait-for-jobs --values ./values-gis-platform.yaml gis-platform 2gis-on-premise/gis-platform --set spcore.resetCluster=true ``` -------------------------------- ### Specify Start Point Source: https://github.com/2gis/docs-mirror/blob/main/docs/api/navigation/route-planner/examples.mdx This example shows how to specify a custom starting point for the route planner by sending a POST request with the `start_point` parameter. ```APIDOC ## POST /route_planner/2.0.0 ### Description Allows users to specify a custom starting point for route planning. If the specified point is outside the polygon, a path from the point to the polygon will be added to the route. ### Method POST ### Endpoint /route_planner/2.0.0 ### Parameters #### Request Body - **start_point** (object) - Required - The coordinates (latitude and longitude) of the desired starting point. - **lat** (number) - Required - Latitude of the start point. - **lon** (number) - Required - Longitude of the start point. - **geometry_objects** (array) - Required - An array of geometric objects defining the route area. - **type** (string) - Required - The type of geometry object (e.g., "polygon"). - **area** (object) - Required - Defines the area for the route. - **points** (array) - Required - An array of points defining the polygon. - **lat** (number) - Required - Latitude of a polygon point. - **lon** (number) - Required - Longitude of a polygon point. - **locale** (string) - Optional - The locale for the response (e.g., "ru"). ### Request Example ```curl curl --request POST \ --url 'https://routing.api.2gis.com/route_planner/2.0.0?key=API_KEY' \ --header 'Content-Type: application/json' \ --data ' \ { "start_point": { "lat": 55.0243125573308, "lon": 82.91832447313938 }, "geometry_objects": [ { "type": "polygon", "area": { "points": [ { "lat": 55.026907806856286, "lon": 82.91738891522984 }, { "lat": 55.026194437684474, "lon": 82.90977144162754 }, { "lat": 55.030277689546075, "lon": 82.90884876172642 }, { "lat": 55.03219618229847, "lon": 82.91213178556065 }, { "lat": 55.031507503160256, "lon": 82.91603708188633 }, { "lat": 55.026907806856286, "lon": 82.91738891522984 } ] } } ], "locale": "ru" }' ``` ### Response #### Success Response (200) - **error_message** (string) - An empty string if the request was successful. - **route** (object) - Contains information about the calculated route. - **algorithm** (string) - The algorithm used for routing (e.g., "с учётом пробок"). - **begin_pedestrian_path** (object) - Information about the initial pedestrian path. - **geometry** (object) - Geometric data for the path. - **selection** (string) - A string representing the line geometry. - **filter_road_types** (array) - An array of road types filtered for the route. - **id** (string) - The unique identifier for the route. - **maneuvers** (array) - An array of maneuvers for the route. - **comment** (string) - A comment describing the maneuver. - **icon** (string) - The icon identifier for the maneuver. - **id** (string) - The unique identifier for the maneuver. - **outcoming_path** (object) - Information about the path following the maneuver. - **distance** (number) - The distance of the path segment. - **duration** (number) - The duration of the path segment. - **geometry** (array) - An array of geometry objects for the path segment. - **color** (string) - The color of the geometry segment. - **length** (number) - The length of the geometry segment. - **selection** (string) - A string representing the line geometry. - **style** (string) - The style of the geometry segment. - **names** (array) - An array of names associated with the path segment. - **outcoming_path_comment** (string) - A comment describing the path following the maneuver. - **turn_angle** (number) - The angle of the turn for the maneuver. - **turn_direction** (string) - The direction of the turn (e.g., "left", "right"). - **type** (string) - The type of maneuver (e.g., "begin", "crossroad"). ### Response Example ```json { "error_message": "", "route": { "algorithm": "с учётом пробок", "begin_pedestrian_path": { "geometry": { "selection": "LINESTRING(82.918324 55.024312, 82.918508 55.024261)" } }, "filter_road_types": [ "highway" ], "id": "14469420573683478551", "maneuvers": [ { "comment": "start", "icon": "start", "id": "4738002958960119805", "outcoming_path": { "distance": 14, "duration": 3, "geometry": [ { "color": "ignore", "length": 14, "selection": "LINESTRING(82.918508 55.024261, 82.918497 55.024248, 82.918509 55.024262, 82.918534 55.024272, 82.918673 55.024285)", "style": "living_zone" } ], "names": [ "Октябрьская" ] }, "outcoming_path_comment": "10 м прямо", "type": "begin" }, { "comment": "Поворот налево на ул. Октябрьская", "icon": "crossroad_left", "id": "2546912131167556994", "outcoming_path": { "distance": 22, "duration": 5, "geometry": [ { "color": "ignore", "length": 22, "selection": "LINESTRING(82.918673 55.024285, 82.918643 55.024394, 82.918619 55.024486)", "style": "living_zone" } ], "names": [ "Октябрьская" ] }, "outcoming_path_comment": "20 м прямо", "turn_angle": -86, "turn_direction": "left", "type": "crossroad" }, { "comment": "Поворот налево на ул. Октябрьская", "icon": "crossroad_left", "id": "1738735375809050842", "outcoming_path": { "distance": 42, "duration": 22, "geometry": [ { "color": "fluid", "length": 42, "selection": "LINESTRING(82.918619 55.024486, 82.918427 55.024469, 82.918108 55.024441, 82.917942 55.024426)", "style": "normal" } ], "names": [ "Октябрьская" ] }, "outcoming_path_comment": "40 м прямо", "turn_angle": -90, "turn_direction": "left", "type": "crossroad" }, { "comment": "Поворот направо на ул. Советская", "icon": "crossroad_right", "id": "9052307276045134658", "outcoming_path": { "distance": 614, "duration": 521, ``` -------------------------------- ### Define Route Start Point Source: https://github.com/2gis/docs-mirror/blob/main/docs/api/navigation/route-planner/examples.mdx Example of how to define the starting point for a route. This includes coordinates and optional address information. ```json { "point": { "lat": 55.030000, "lon": 82.920000 }, "address": "ул. Ленина, 1" } ``` -------------------------------- ### Full Example with MapGL and React Source: https://github.com/2gis/docs-mirror/blob/main/docs/mapgl/start/react.mdx This HTML example demonstrates a complete integration of MapGL within a React application, including context setup, map initialization, and interaction from a separate button component. ```html