Skip to content

Commit

Permalink
add default resource param to IGN request
Browse files Browse the repository at this point in the history
  • Loading branch information
nworr committed Mar 8, 2024
1 parent e38baf9 commit 5039b77
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions altiProfil/lib/AltiServicesFromIGN.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@
*/
protected $config;

/**
* the resource id as defined by IGN geoplateforme
* https://data.geopf.fr/altimetrie/resources
* mandatory for each request
*
* @var string
*/
private string $resource_id;
/**
* Get config parameters
**/
function __construct(\AltiProfil\AltiConfig $config)
{
$this->config = $config;
$this->resource_id = 'ign_rge_alti_wld';
}

/**
Expand All @@ -25,7 +34,8 @@ public function getAlti($lon, $lat)

$data = array(
'lon' => $lon,
'lat' => $lat
'lat' => $lat,
'resource' => $this->resource_id
);

$urlAltiIGN = $this->config->getIgnServiceUrl($APIRestElev, $data);
Expand Down Expand Up @@ -54,7 +64,8 @@ public function getProfil($p1Lon, $p1Lat, $p2Lon, $p2Lat, $sampling)
$data = array(
'lon' => $p1Lon."|".$p2Lon,
'lat' => $p1Lat."|".$p2Lat,
'sampling' => 10
'sampling' => 10,
'resource' => $this->resource_id
);

$fullURL = $this->config->getIgnServiceUrl($APIRestProfil, $data);
Expand Down

0 comments on commit 5039b77

Please sign in to comment.