Пример #1
0
}
if ($nbOfFilters > 1) {
    $request .= '</ogc:And>';
}
$request .= '</ogc:Filter></wfs:Query></wfs:GetFeature>';
// Send HITS request
$theData = postRemoteData($url, $requestHits . $request, array("REMOTE_USER: "******"Content-Type: text/xml"));
// Store request and response
if (MSP_DEBUG) {
    $tmp = createPassword(10);
    saveFile($request, MSP_UPLOAD_DIR . "csw_" . $tmp . "_request.xml");
    saveFile($theData, MSP_UPLOAD_DIR . "csw_" . $tmp . "_response.xml");
}
// Get the number of results
$nbOfResults = getNbOfResults($theData);
// Send RESULTS request
$theData = postRemoteData($url, $requestResults . $request, array("REMOTE_USER: "******"Content-Type: text/xml"));
// Store request and response
if (MSP_DEBUG) {
    $tmp = createPassword(10);
    saveFile($request, MSP_UPLOAD_DIR . "csw_" . $tmp . "_request.xml");
    saveFile($theData, MSP_UPLOAD_DIR . "csw_" . $tmp . "_response.xml");
}
//  Check if a SOAP Fault occured
$error = OWSExceptionToJSON($theData);
if ($error) {
    echo $error;
} else {
    // Stream result
    echo outputToGeoJSON($theData, $nbOfResults);
}
Пример #2
0
      </Constraint>
   </csw:Query>
</GetRecords>';
/**
 * Send a post $request at $url
 * 
 * If headers is set to false, do not force headers
 * during POST request
 */
if (isset($_REQUEST["headers"]) && $_REQUEST["headers"] == "false") {
    $theData = postRemoteData($url, $request, false);
} else {
    $theData = postRemoteData($url, $request, true);
}
/**
 * Store request and response
 */
if (MSP_DEBUG) {
    $tmp = createPassword(10);
    saveFile($request, MSP_UPLOAD_DIR . "csw_" . $tmp . "_request.xml");
    $resultFileURI = saveFile($theData, MSP_UPLOAD_DIR . "csw_" . $tmp . "_response.xml");
}
/**
 *  Check if a SOAP Fault occured
 */
$error = OWSExceptionToJSON($theData);
if ($error) {
    echo $error;
} else {
    echo outputToGeoJSON($theData);
}
Пример #3
0
if ($dates['startDate']) {
    $request .= '<ogc:PropertyIsGreaterThanOrEqualTo>' . PHP_EOL . '<ogc:PropertyName>/rim:ExtrinsicObject/rim:Slot[@name="' . $slotprefix . 'beginPosition"]/rim:ValueList/rim:Value[1]</ogc:PropertyName>' . PHP_EOL . '<ogc:Literal>' . $dates['startDate'] . '</ogc:Literal>' . PHP_EOL . '</ogc:PropertyIsGreaterThanOrEqualTo>' . PHP_EOL;
}
if ($dates['completionDate']) {
    $request .= '<ogc:PropertyIsLessThanOrEqualTo>' . PHP_EOL . '<ogc:PropertyName>/rim:ExtrinsicObject/rim:Slot[@name="' . $slotprefix . 'endPosition"]/rim:ValueList/rim:Value[1]</ogc:PropertyName>' . PHP_EOL . '<ogc:Literal>' . $dates['completionDate'] . '</ogc:Literal>' . PHP_EOL . '</ogc:PropertyIsLessThanOrEqualTo>' . PHP_EOL;
}
$request .= '</ogc:And>' . PHP_EOL . '</ogc:Filter>' . PHP_EOL . '</csw:Constraint>' . PHP_EOL . '</csw:Query>' . PHP_EOL . '</csw:GetRecords>' . PHP_EOL . '</soapenv:Body>' . PHP_EOL . '</soapenv:Envelope>' . PHP_EOL;
/**
 * Send a post $request at $url
 */
$theData = postRemoteData($url, $request, true);
/**
 * Store request and response
 */
if (MSP_DEBUG) {
    $tmp = createPassword(10);
    saveFile($request, MSP_UPLOAD_DIR . "csw_" . $tmp . "_request.xml");
    $resultFileURI = saveFile($theData, MSP_UPLOAD_DIR . "csw_" . $tmp . "_response.xml");
}
/**
 *  Check if a SOAP Fault occured
 */
$error = OWSExceptionToJSON($theData);
if ($error) {
    echo $error;
} else {
    echo outputToGeoJSON($theData, $slotprefix, $objprefix);
}
?>