/** * Return an array of startDate and completionDate * in ISO8601 format from input date or date interval */ function getDatesFromInterval($interval) { /* * Nothing in input, set an array of * two null values */ if (!isset($interval)) { return array('startDate' => null, 'completionDate' => null); } /* * Three cases are possible * - YYYY-MM-DD or YYYY-MM-DD/ => only startDate is set * - YYYY-MM-DD/YYYY-MM-DD => startDate and completionDate are set * - /YYYY-MM-DD => only completionDate is set */ $dates = preg_split('/\\//', $interval); return array('startDate' => isset($dates[0]) && $dates[0] !== "" ? addTimeToDate(urldecode($dates[0])) : null, 'completionDate' => isset($dates[1]) && $dates[1] !== "" ? addTimeToDate(urldecode($dates[1])) : null); }
$req = 'selat=' . $bbox[1]; $req .= '&nwlon=' . $bbox[0]; $req .= '&nwlat=' . $bbox[3]; $req .= '&selon=' . $bbox[2]; } else { $req = 'selat=-90'; $req .= '&nwlon=-180'; $req .= '&nwlat=90'; $req .= '&selon=180'; } $dates = getDatesFromInterval(isset($_REQUEST["sd"]) ? $_REQUEST["sd"] : null); /* * If completionDate is set it replaces $dates['completionDate'] */ if (isset($_REQUEST["ed"])) { $dates['completionDate'] = addTimeToDate(urldecode($_REQUEST["ed"])); } $req .= '&ed=' . ($dates['completionDate'] ? $dates['completionDate'] : ""); $req .= '&sd=' . ($dates['startDate'] ? $dates['startDate'] : ""); /* * Satellites */ if (isset($_REQUEST["q"])) { $req .= '&sn=' . $_REQUEST["q"]; } /* * SPOT Dali Rest Server information * * Server : engine.mapshup.info * IP : 213.251.187.141 * API KEY: 2KYfZcCsisLrlToDWn5_uQ::
$nbOfFilters = 0; $useGeo = 0; // bbox is optional (Structure is lllon,lllat,urlon,urlat) if (isset($_REQUEST['bbox']) && $_REQUEST['bbox'] != "") { $bbox = preg_split('/,/', $_REQUEST['bbox']); $latmin = $bbox[1]; $lonmin = $bbox[0]; $latmax = $bbox[3]; $lonmax = $bbox[2]; $useGeo = 1; $nbOfFilters++; } // $dates is an array of two dates (startDate and completionDate) that are retrieved from startDate interval $dates = getDatesFromInterval(isset($_REQUEST["startDate"]) ? $_REQUEST["startDate"] : null); // Archiving date $archivingDate = isset($_REQUEST["archivingDate"]) ? addTimeToDate($_REQUEST["archivingDate"]) : null; // Datastrip ID $DSID = isset($_REQUEST["DSID"]) ? $_REQUEST["DSID"] : null; // PHR operateur name $operateur = isset($_REQUEST["operateur"]) ? $_REQUEST["operateur"] : null; // If DatastripID is set, do not use geographical coordinates if ($DSID) { $useGeo = 0; } // Compute number of filters (used to determine if a <ogc:And> property is needed) if ($dates["startDate"]) { $nbOfFilters++; } if ($dates["completionDate"]) { $nbOfFilters++; }