Tests endpoint dans geoplateforme#
Ajout du endpoint#
POST {{baseUrl}}/administrator/endpoints
Le technical_name
doit correspondre au nom du service défini dans le chart helm.
On doit prendre comme type ITINERARY-ISOCURVE
.
{
"name": "gpf-road2",
"technical_name": "gpf-road2",
"type": "ITINERARY-ISOCURVE",
"urls": [{"type" :"test_url_type", "url":"test_url_url"}],
"open": true,
"metadata_fi": "gpf-road2"
}
L’identifiant du endpoint créé est nommé endpoint-id
dans les chapitres suivants.
Ajout endpoint dans datastore#
Récupération endpoint déjà présent#
GET {{baseUrl}}/administrator/datastores/:datastore
On récupère la liste des endpoint déjà présents:
"endpoints": [
{
"use": 0,
"quota": 99999999996,
"endpoint": {
"name": "gpf-download",
"technical_name": "gpf-download",
"type": "DOWNLOAD",
"urls": [],
"_id": "ae042611-13eb-4a18-8d04-9b7604a031cc",
"open": true,
"metadata_fi": "gpf-download"
}
},
{
"use": 0,
"quota": 99999999999,
"endpoint": {
"name": "gpf-geoserver-wms-v",
"technical_name": "gpf-geoserver-wms-v",
"type": "WMS-VECTOR",
"urls": [
{
"type": "WMS",
"url": "Url"
}
],
"_id": "ae022611-13eb-4a18-8d04-9b7604a031cc",
"open": true,
"metadata_fi": "gpf-geoserver-wms-v"
}
},
{
"use": 0,
"quota": 99999999990,
"endpoint": {
"name": "gpf-geoserver-wfs-inspire",
"technical_name": "gpf-geoserver-wfs-inspire",
"type": "WFS-INSPIRE",
"urls": [],
"_id": "ae032611-13eb-4a18-8d04-9b7604a031cc",
"open": true,
"metadata_fi": "gpf-geoserver-wfs-inspire"
}
},
{
"use": 0,
"quota": 99999999998,
"endpoint": {
"name": "gpf-geoserver-wfs",
"technical_name": "gpf-geoserver-wfs",
"type": "WFS",
"urls": [
{
"type": "WFS",
"url": "secondUrl"
},
{
"type": "WFS",
"url": "firstUrl"
}
],
"_id": "ae012611-13eb-4a18-8d04-9b7604a031cc",
"open": true,
"metadata_fi": "gpf-geoserver-wfs"
}
},
{
"use": 0,
"quota": 99999999992,
"endpoint": {
"name": "gpf-rok4-server-wms-r",
"technical_name": "gpf-rok4-server-wms-r",
"type": "WMS-RASTER",
"urls": [],
"_id": "ae062611-13eb-4a18-8d04-9b7604a031cc",
"open": true,
"metadata_fi": "gpf-rok4-server-wms-r"
}
},
{
"use": 0,
"quota": 99999999994,
"endpoint": {
"name": "gpf-rok4-server-wmts-tms",
"technical_name": "gpf-rok4-server-wmts-tms",
"type": "WMTS-TMS",
"urls": [],
"_id": "ae052611-13eb-4a18-8d04-9b7604a031cc",
"open": true,
"metadata_fi": "gpf-rok4-server-wmts-tms"
}
}
]
Modification datastore#
On va patcher le datastore pour lui ajouter le nouveau endoint.
Note
Il faut absolument avoir récupérer les endpoint déjà présents ou ils ne seront plus disponible pour le datastore.
PATCH {{baseUrl}}/administrator/datastores/:datastore
En paramètre, on indique la liste des processings déjà présent plus le nouveau processing à intégrer:
{
"endpoints": [
{
"endpoint": "ae012611-13eb-4a18-8d04-9b7604a031cc",
"quota": 99999999990
},
{
"endpoint": "ae062611-13eb-4a18-8d04-9b7604a031cc",
"quota": 99999999990
},
{
"endpoint": "ae032611-13eb-4a18-8d04-9b7604a031cc",
"quota": 99999999990
},
{
"endpoint": "ae022611-13eb-4a18-8d04-9b7604a031cc",
"quota": 99999999990
},
{
"endpoint": "ae042611-13eb-4a18-8d04-9b7604a031cc",
"quota": 99999999990
},
{
"endpoint": "ae042611-13eb-4a18-8d04-9b7604a031cc",
"quota": 99999999990
},
{
"endpoint": "ae052611-13eb-4a18-8d04-9b7604a031cc",
"quota": 99999999990
},
{
"endpoint": "{{endpoint-id}}",
"quota": 99999999990
}
]
}
Création d’une configuration#
POST {{baseUrl}}/datastores/:datastore/configurations
On va indiquer les informations de la publication et les stored data utilisés.
L’identifiant de la stored data correspond à une stored data de type GRAPH-DB
/ GRAPH-VALHALLA
/ GRAPH-OSRM
.
Pour la procédure de génération de la données, veuillez vous référer à la documentation du processing pivot-road2-to-graph-road2
.
Voici un exemple pour une publication d’un GRAPH-VALHALLA
:
{
"layer_name": "valhalla",
"name": "Service itinéraire Valhalla",
"type": "ITINERARY-ISOCURVE",
"type_infos": {
"abstract": "Publication du service Itinéraire via Valhalla",
"title": "itineraire_valahalla",
"used_data": [
{
"stored_data": "{{stored-data-id}}",
"profile": "car",
"optimization": "fastest",
"cost_type": "time",
"costing": "auto"
},
{
"stored_data": "{{stored-data-id}}",
"profile": "car",
"optimization": "shortest",
"cost_type": "distance",
"costing": "auto_shorter"
}
],
"keywords": [
"valhalla",
"itineraire",
"publication"
],
"constraints": {
"defaultPreferredCostRatio": 0.8,
"defaultAvoidCostRatio": 1.2,
"values": [
{
"keyType": "name-valhalla",
"key": "wayType",
"availableConstraintType": [
"banned"
],
"availableValues": [
{
"value": "autoroute",
"field": "exclude_tolls"
},
{
"value": "pont",
"field": "exclude_bridges"
},
{
"value": "tunnel",
"field": "exclude_tunnels"
}
]
}
]
}
}
}
Voici un exemple pour une publication d’un GRAPH-DB
:
{
"layer_name": "pgr",
"name": "Service itinéraire, isochrone PGRouting",
"type": "ITINERARY-ISOCURVE",
"type_infos": {
"title": "pgrouting",
"abstract": "Publication du service Itinéraire / Isochrone via PGRouting",
"keywords": [
"pgrouting",
"itineraire",
"publication",
"isochrone"
],
"constraints": {
"defaultPreferredCostRatio": 0.8,
"defaultAvoidCostRatio": 1.2,
"values": [
{
"keyType": "name-pgr",
"key": "wayType",
"availableConstraintType": [
"banned"
],
"availableValues": [
{
"value": "autoroute",
"field": "acces_vehicule_leger",
"condition": {
"type": "equal",
"value": "$niv4$A péage$niv4$"
}
},
{
"value": "tunnel",
"field": "position_par_rapport_au_sol",
"condition": {
"type": "less",
"value": "0"
}
},
{
"value": "pont",
"field": "position_par_rapport_au_sol",
"condition": {
"type": "greater",
"value": "0"
}
}
]
},
{
"keyType": "numerical-pgr",
"key": "largeur_de_chaussee",
"availableConstraintType": [
"banned"
],
"field": "largeur_de_chaussee"
},
{
"keyType": "numerical-pgr",
"key": "importance",
"availableConstraintType": [
"banned",
"prefer",
"avoid"
],
"field": "importance"
},
{
"keyType": "name-pgr",
"key": "nature",
"availableConstraintType": [
"banned"
],
"availableValues": [
{
"value": "sentier",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Sentier$niv4$"
}
},
{
"value": "bac_ou_liaison_maritime",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Bac ou liaison maritime$niv4$"
}
},
{
"value": "bretelle",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Bretelle$niv4$"
}
},
{
"value": "chemin",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Chemin$niv4$"
}
},
{
"value": "escalier",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Escalier$niv4$"
}
},
{
"value": "piste_cyclable",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Piste cyclable$niv4$"
}
},
{
"value": "rond-point",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Rond-point$niv4$"
}
},
{
"value": "route_a_1_chaussee",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Route à 1 chaussée$niv4$"
}
},
{
"value": "route_a_2_chaussees",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Route à 2 chaussées$niv4$"
}
},
{
"value": "route_empierree",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Route empierrée$niv4$"
}
},
{
"value": "type_autoroutier",
"field": "nature",
"condition": {
"type": "equal",
"value": "$niv4$Type autoroutier$niv4$"
}
}
]
},
{
"keyType": "numerical-pgr",
"key": "restriction_de_hauteur",
"availableConstraintType": [
"banned"
],
"field": "restriction_de_hauteur"
},
{
"keyType": "numerical-pgr",
"key": "restriction_de_largeur",
"availableConstraintType": [
"banned"
],
"field": "restriction_de_largeur"
},
{
"keyType": "numerical-pgr",
"key": "restriction_de_poids_total",
"availableConstraintType": [
"banned"
],
"field": "restriction_de_poids_total"
},
{
"keyType": "numerical-pgr",
"key": "restriction_de_poids_par_essieu",
"availableConstraintType": [
"banned"
],
"field": "restriction_de_poids_par_essieu"
},
{
"keyType": "name-pgr",
"key": "matieres_dangereuses_interdites",
"availableConstraintType": [
"banned"
],
"availableValues": [
{
"value": "vrai",
"field": "matieres_dangereuses_interdites",
"condition": {
"type": "equal",
"value": "true"
}
},
{
"value": "faux",
"field": "matieres_dangereuses_interdites",
"condition": {
"type": "equal",
"value": "false"
}
}
]
},
{
"keyType": "name-pgr",
"key": "itineraire_vert",
"availableConstraintType": [
"banned",
"prefer",
"avoid"
],
"availableValues": [
{
"value": "vrai",
"field": "itineraire_vert",
"condition": {
"type": "equal",
"value": "true"
}
},
{
"value": "faux",
"field": "itineraire_vert",
"condition": {
"type": "equal",
"value": "false"
}
}
]
},
{
"keyType": "name-pgr",
"key": "cpx_classement_administratif",
"availableConstraintType": [
"banned",
"prefer",
"avoid"
],
"availableValues": [
{
"value": "vide",
"field": "cpx_classement_administratif",
"condition": {
"type": "equal",
"value": "$niv4$$niv4$"
}
},
{
"value": "autoroute",
"field": "cpx_classement_administratif",
"condition": {
"type": "like",
"value": "$niv4$%Autoroute%$niv4$"
}
},
{
"value": "nationale",
"field": "cpx_classement_administratif",
"condition": {
"type": "equal",
"value": "$niv4$Nationale$niv4$"
}
},
{
"value": "departementale",
"field": "cpx_classement_administratif",
"condition": {
"type": "equal",
"value": "$niv4$Départementale$niv4$"
}
},
{
"value": "voie_communale",
"field": "cpx_classement_administratif",
"condition": {
"type": "equal",
"value": "$niv4$Voie communale$niv4$"
}
},
{
"value": "chemin_rural",
"field": "cpx_classement_administratif",
"condition": {
"type": "equal",
"value": "$niv4$Chemin rural$niv4$"
}
}
]
}
]
},
"used_data": [
{
"stored_data": "{{stored-data-id}}",
"profile": "car",
"optimization": "fastest",
"cost_column": "cost_s_car",
"reverse_cost_column": "reverse_cost_s_car",
"cost_type": "time",
"attributes": [
{
"public_name": "name",
"native_name": "name",
"default": "false"
},
{
"public_name": "nom_1_gauche",
"native_name": "nom_1_gauche",
"default": "true"
},
{
"public_name": "nom_1_droite",
"native_name": "nom_1_droite",
"default": "true"
},
{
"public_name": "cpx_numero",
"native_name": "cpx_numero",
"default": "true"
},
{
"public_name": "cpx_toponyme_route_nommee",
"native_name": "cpx_toponyme_route_nommee",
"default": "true"
},
{
"public_name": "cleabs",
"native_name": "cleabs",
"default": "false"
},
{
"public_name": "nature",
"native_name": "nature",
"default": "false"
},
{
"public_name": "importance",
"native_name": "importance",
"default": "false"
},
{
"public_name": "position_par_rapport_au_sol",
"native_name": "position_par_rapport_au_sol",
"default": "false"
},
{
"public_name": "nombre_de_voies",
"native_name": "nombre_de_voies",
"default": "false"
},
{
"public_name": "largeur_de_chaussee",
"native_name": "largeur_de_chaussee",
"default": "false"
},
{
"public_name": "itineraire_vert",
"native_name": "itineraire_vert",
"default": "false"
},
{
"public_name": "sens_de_circulation",
"native_name": "sens_de_circulation",
"default": "false"
},
{
"public_name": "bande_cyclable",
"native_name": "bande_cyclable",
"default": "false"
},
{
"public_name": "reserve_aux_bus",
"native_name": "reserve_aux_bus",
"default": "false"
},
{
"public_name": "urbain",
"native_name": "urbain",
"default": "false"
},
{
"public_name": "vitesse_moyenne_vl",
"native_name": "vitesse_moyenne_vl",
"default": "false"
},
{
"public_name": "acces_vehicule_leger",
"native_name": "acces_vehicule_leger",
"default": "false"
},
{
"public_name": "acces_pieton",
"native_name": "acces_pieton",
"default": "false"
},
{
"public_name": "nature_de_la_restriction",
"native_name": "nature_de_la_restriction",
"default": "false"
},
{
"public_name": "restriction_de_hauteur",
"native_name": "restriction_de_hauteur",
"default": "false"
},
{
"public_name": "restriction_de_poids_total",
"native_name": "restriction_de_poids_total",
"default": "false"
},
{
"public_name": "restriction_de_poids_par_essieu",
"native_name": "restriction_de_poids_par_essieu",
"default": "false"
},
{
"public_name": "restriction_de_largeur",
"native_name": "restriction_de_largeur",
"default": "false"
},
{
"public_name": "restriction_de_longueur",
"native_name": "restriction_de_longueur",
"default": "false"
},
{
"public_name": "matieres_dangereuses_interdites",
"native_name": "matieres_dangereuses_interdites",
"default": "false"
},
{
"public_name": "insee_commune_gauche",
"native_name": "insee_commune_gauche",
"default": "false"
},
{
"public_name": "insee_commune_droite",
"native_name": "insee_commune_droite",
"default": "false"
},
{
"public_name": "cpx_numero_route_europeenne",
"native_name": "cpx_numero_route_europeenne",
"default": "false"
},
{
"public_name": "cpx_classement_administratif",
"native_name": "cpx_classement_administratif",
"default": "false"
},
{
"public_name": "cpx_gestionnaire",
"native_name": "cpx_gestionnaire",
"default": "false"
}
]
},
{
"stored_data": "{{stored-data-id}}",
"profile": "car",
"optimization": "shortest",
"cost_column": "cost_m_car",
"reverse_cost_column": "reverse_cost_m_car",
"cost_type": "distance",
"attributes": [
{
"public_name": "name",
"native_name": "name",
"default": "false"
},
{
"public_name": "nom_1_gauche",
"native_name": "nom_1_gauche",
"default": "true"
},
{
"public_name": "nom_1_droite",
"native_name": "nom_1_droite",
"default": "true"
},
{
"public_name": "cpx_numero",
"native_name": "cpx_numero",
"default": "true"
},
{
"public_name": "cpx_toponyme_route_nommee",
"native_name": "cpx_toponyme_route_nommee",
"default": "true"
},
{
"public_name": "cleabs",
"native_name": "cleabs",
"default": "false"
},
{
"public_name": "nature",
"native_name": "nature",
"default": "false"
},
{
"public_name": "importance",
"native_name": "importance",
"default": "false"
},
{
"public_name": "position_par_rapport_au_sol",
"native_name": "position_par_rapport_au_sol",
"default": "false"
},
{
"public_name": "nombre_de_voies",
"native_name": "nombre_de_voies",
"default": "false"
},
{
"public_name": "largeur_de_chaussee",
"native_name": "largeur_de_chaussee",
"default": "false"
},
{
"public_name": "itineraire_vert",
"native_name": "itineraire_vert",
"default": "false"
},
{
"public_name": "sens_de_circulation",
"native_name": "sens_de_circulation",
"default": "false"
},
{
"public_name": "bande_cyclable",
"native_name": "bande_cyclable",
"default": "false"
},
{
"public_name": "reserve_aux_bus",
"native_name": "reserve_aux_bus",
"default": "false"
},
{
"public_name": "urbain",
"native_name": "urbain",
"default": "false"
},
{
"public_name": "vitesse_moyenne_vl",
"native_name": "vitesse_moyenne_vl",
"default": "false"
},
{
"public_name": "acces_vehicule_leger",
"native_name": "acces_vehicule_leger",
"default": "false"
},
{
"public_name": "acces_pieton",
"native_name": "acces_pieton",
"default": "false"
},
{
"public_name": "nature_de_la_restriction",
"native_name": "nature_de_la_restriction",
"default": "false"
},
{
"public_name": "restriction_de_hauteur",
"native_name": "restriction_de_hauteur",
"default": "false"
},
{
"public_name": "restriction_de_poids_total",
"native_name": "restriction_de_poids_total",
"default": "false"
},
{
"public_name": "restriction_de_poids_par_essieu",
"native_name": "restriction_de_poids_par_essieu",
"default": "false"
},
{
"public_name": "restriction_de_largeur",
"native_name": "restriction_de_largeur",
"default": "false"
},
{
"public_name": "restriction_de_longueur",
"native_name": "restriction_de_longueur",
"default": "false"
},
{
"public_name": "matieres_dangereuses_interdites",
"native_name": "matieres_dangereuses_interdites",
"default": "false"
},
{
"public_name": "insee_commune_gauche",
"native_name": "insee_commune_gauche",
"default": "false"
},
{
"public_name": "insee_commune_droite",
"native_name": "insee_commune_droite",
"default": "false"
},
{
"public_name": "cpx_numero_route_europeenne",
"native_name": "cpx_numero_route_europeenne",
"default": "false"
},
{
"public_name": "cpx_classement_administratif",
"native_name": "cpx_classement_administratif",
"default": "false"
},
{
"public_name": "cpx_gestionnaire",
"native_name": "cpx_gestionnaire",
"default": "false"
}
]
}
]
}
}
Voici un exemple pour une publication d’un GRAPH-OSRM
:
{
"layer_name": "osrm",
"name": "Service itinéraire OSRM",
"type": "ITINERARY-ISOCURVE",
"type_infos": {
"title": "itineraire_osrm",
"abstract": "Publication du service Itinéraire via OSRM",
"keywords": [
"osrm",
"itineraire",
"publication"
],
"constraints": {
"defaultPreferredCostRatio": 0.8,
"defaultAvoidCostRatio": 1.2,
"values": [
{
"keyType": "name-osrm",
"key": "wayType",
"availableConstraintType": [
"banned"
],
"availableValues": [
{
"value": "autoroute",
"field": "toll"
},
{
"value": "tunnel",
"field": "tunnel"
},
{
"value": "pont",
"field": "bridge"
}
]
}
]
},
"used_data": [
{
"stored_data": "{{stored-data-id}}",
"profile": "car",
"optimization": "fastest"
}
]
}
}
On va pouvoir récupérer un identifiant de configuration dans le champs _id
retourné par l’API. Il est nommé configuration-id
pour les chapitres suivants.
Publication de la configuration#
POST {{baseUrl}}/datastores/:datastore/configurations/:configuration/offerings
On va indiquer sur quel endpoint on veut déployer la configuration:
{
"endpoint": "{{endpoint-id}}",
"visibility": "PRIVATE",
"open": true
}
En retour on récupère un identifiant nommé offering-id
dans la suite du document.
Dépublication de la configuration#
DELETE {{baseUrl}}/datastores/:datastore/offerings/:offering
On indique offering-id
dans les variables de chemin pour offering
.
Tests API#
Voici une requete possible pour un layer_name valhalla :
Route :
https://geoplateforme-road2.dev.gpf-tech.ign.fr/simple/1.0.0/route?resource=valhalla&profile=car&optimization=fastest&start=2.32,48.86&end=2.33,48.87&intermediates=&constraints=&geometryFormat=polyline&getSteps=true&getBbox=true
Isochrone
https://geoplateforme-road2.dev.gpf-tech.ign.fr/simple/1.0.0/isochrone?resource=valhalla&profile=car&costType=time&costValue=100&direction=departure&point=2.32,48.86&constraints=&geometryFormat=geojson