Voici la documentation : https://geoplateforme.pages.gpf-tech.ign.fr/documentation

Skip to content
Extraits de code Groupes Projets

fix(#IGNGPF-2640): return -99999 si hors plage pyramide

Fusionnées Sylvain Beorchia a demandé de fusionner fix/return_99999_si_hors_plage vers main
1 fichier
+ 35
1
Comparer les modifications
  • Côte à côte
  • En ligne
+ 35
1
@@ -14,7 +14,11 @@ from lxml import etree as ET
from moto import mock_s3
from alti_api.main import fast_api_app
from alti_api.versions.v1_0.models.parameters import SAMPLING_MAXIMUM, SAMPLING_MINIMUM
from alti_api.versions.v1_0.models.parameters import (
NO_DATA,
SAMPLING_MAXIMUM,
SAMPLING_MINIMUM,
)
from alti_api.versions.v1_0.responses import (
DIFFERENT_NUMBER_LONGITUDES_LATITUDES,
INVALID_DELIMITER,
@@ -66,11 +70,13 @@ from tests.conftest import (
WRONG_LAT_BAR,
WRONG_LAT_BAR_OUTSIDE_MAXIMUM,
WRONG_LAT_BAR_OUTSIDE_MINIMUM,
WRONG_LAT_BAR_ROK4,
WRONG_LAT_BAR_TOO_MANY,
WRONG_LAT_BAR_TWO_SAME_POINTS_PROFILE,
WRONG_LON_BAR,
WRONG_LON_BAR_OUTSIDE_MAXIMUM,
WRONG_LON_BAR_OUTSIDE_MINIMUM,
WRONG_LON_BAR_ROK4,
WRONG_LON_BAR_TOO_MANY,
WRONG_LON_BAR_TWO_SAME_POINTS_PROFILE,
WRONG_MEASURES,
@@ -389,6 +395,34 @@ class TestProfile(unittest.IsolatedAsyncioTestCase):
assert response.text == await format_response_error(
content=response_content, output_format="xml", indent=CORRECT_INDENT_FALSE
)
# Invalid longitude (coordinates outside a ROK tile)
# Response in json format
response = await self.client.get(
f"/calcul/alti/rest/elevationLine.{CORRECT_FORMAT_JSON}?lon={WRONG_LON_BAR_ROK4}&lat={CORRECT_LAT_BAR}&resource={CORRECT_RESOURCE_RGEALTI}"
)
assert response.status_code == 200
assert response.json()["elevations"][0]["z"] == NO_DATA
# Response in xml format
response = await self.client.get(
f"/calcul/alti/rest/elevationLine.{CORRECT_FORMAT_XML}?lon={WRONG_LON_BAR_ROK4}&lat={CORRECT_LAT_BAR}&resource={CORRECT_RESOURCE_RGEALTI}"
)
assert response.status_code == 200
response_xml = ET.fromstring(response.text)
assert int(round(float(response_xml[0][2].text))) == NO_DATA
# Invalid latitude (coordinates outside a ROK tile)
# Response in json format
response = await self.client.get(
f"/calcul/alti/rest/elevationLine.{CORRECT_FORMAT_JSON}?lon={CORRECT_LON_BAR}&lat={WRONG_LAT_BAR_ROK4}&resource={CORRECT_RESOURCE_RGEALTI}"
)
assert response.status_code == 200
assert response.json()["elevations"][0]["z"] == NO_DATA
# Response in xml format
response = await self.client.get(
f"/calcul/alti/rest/elevationLine.{CORRECT_FORMAT_XML}?lon={CORRECT_LON_BAR}&lat={WRONG_LAT_BAR_ROK4}&resource={CORRECT_RESOURCE_RGEALTI}"
)
assert response.status_code == 200
response_xml = ET.fromstring(response.text)
assert int(round(float(response_xml[0][2].text))) == NO_DATA
# Invalid longitude/latitude (same coordinates for the 2 points)
# Response in json format
response = await self.client.get(
Chargement en cours