@antoine-de Comment modifier manuellement les géométries d’une annotation avec Swagger ?
https://panoramax.openstreetmap.fr/api/annotations/975dfacc-795a-424e-aa6d-b04ea233ad00 renvoi le polygon de cette annotation.
{
"id": "975dfacc-795a-424e-aa6d-b04ea233ad00",
"picture_id": "5711ac48-4e25-467f-b9e3-2372c5aa8a1a",
"shape": {
"type": "Polygon",
"coordinates": [
[
[
602,
2614
],
[
2066,
2614
],
[
2066,
354
],
[
602,
354
],
[
602,
2614
]
]
]
},
"semantics": [
{
"key": "osm",
"value": "node/11570349916"
},
{
"key": "osm|climbing",
"value": "route_bottom"
},
{
"key": "osm|climbing:grade:uiaa",
"value": "6-"
},
{
"key": "osm|name",
"value": "Komín divů"
},
{
"key": "osm|sport",
"value": "climbing"
}
]
}
En m’inspirant des modifications de la sémantique, si je patch avec ces données un peu modifiées l’API renvoi une erreur 500 :
{
"shape": {
"type": "Polygon",
"coordinates": [
[
[
602,
2600
],
[
2066,
2600
],
[
2066,
354
],
[
602,
354
],
[
602,
2600
]
]
]
}
}
On peut déja créer une annotation avec un polygone quelconque comme celui-ci.
https://panoramax.openstreetmap.fr/api/pictures/5711ac48-4e25-467f-b9e3-2372c5aa8a1a/annotations
{
"shape": {
"type": "Polygon",
"coordinates": [
[
[164,139],
[123,133],
[94,163],
[88,122],
[51,104],
[88,85],
[93,44],
[122,74],
[163,66],
[144,103],
[164,139]
]
]
},
"semantics": [
{
"key": "osm|note",
"value": "test étoile"
}
]
}
Ou un polygone avec un ou plusieurs trous comme celui-là :
{
"shape": {
"type": "Polygon",
"coordinates": [
[
[
2700,
700
],
[
3200,
700
],
[
3200,
1200
],
[
2700,
1200
],
[
2700,
700
]
],
[
[
2750,
750
],
[
2750,
1150
],
[
3150,
1150
],
[
3150,
750
],
[
2750,
750
]
]
]
},
"semantics": [
{
"key": "note",
"value": "square with an hole"
}
]
}
L’API n’accepte que des géométries de type Polygon (cf. source)
(Pas de Point, MultiPoint, LineString, MultiLineString, MultiPolygon, GeometryCollection).

