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

Skip to content
Extraits de code Groupes Projets
Valider 93654052 rédigé par Florian Cerizay's avatar Florian Cerizay
Parcourir les fichiers

Merge branch 'master' into '1.0'

Master

See merge request !6
parents 8b57df37 82622bac
Aucune branche associée trouvée
Étiquettes v1.0.4
Aucune requête de fusion associée trouvée
......@@ -29,6 +29,9 @@ class Client {
*/
private $proxy;
const DEFAULT_FORMAT = "application/gml+xml; version=3.2";
// const DEFAULT_FORMAT = "gml32";
/**
* Constructor
*
......@@ -70,13 +73,17 @@ class Client {
}
$xpath = new \DOMXPath( $document );
$xpath->registerNamespace('wfs', "http://www.opengis.net/wfs/2.0");
$capabilities = $xpath->query( '//wfs:WFS_Capabilities' );
if ( ! $capabilities || $capabilities->length == 0){
return false;
}
return true;
} catch ( \Exception $e ) {
return false;
} catch ( \DOMException $e) {
......@@ -84,6 +91,25 @@ class Client {
}
}
/**
* hasValidOutputFormat
*
* @return boolean
*/
public function hasValidOutputFormat(){
$formats = $this->getFeatureFormats();
if ( in_array(self::DEFAULT_FORMAT,$formats ) ){
return true;
}
return false;
}
/**
* getUpdateSequence
......@@ -159,7 +185,9 @@ class Client {
return false;
}
$featureList = $this->featureListToArray( $features );
return $featureList;
}
......@@ -199,7 +227,7 @@ class Client {
$typeName,
$featureFilter
){
$query = '<wfs:GetFeature service="WFS" outputFormat="gml32" ';
$query = '<wfs:GetFeature service="WFS" outputFormat="'.self::DEFAULT_FORMAT.'" ';
$query.= 'xmlns:wfs="http://www.opengis.net/wfs" ';
$query.= 'xmlns:ogc="http://www.opengis.net/ogc" ';
$query.= 'xmlns:gml="http://www.opengis.net/gml" >';
......@@ -319,6 +347,7 @@ class Client {
$document->loadXML( $features );
$xpath = new \DOMXPath( $document );
$xpath->registerNamespace('wfs', "http://www.opengis.net/wfs/2.0");
$members = $xpath->query('//wfs:FeatureCollection/wfs:member/*');
......@@ -376,6 +405,7 @@ class Client {
$document = new \DOMDocument;
$document->loadXML( $data );
$xpath = new \DOMXPath( $document );
$xpath->registerNamespace('wfs', "http://www.opengis.net/wfs/2.0");
$updateSequenceElement = $xpath->query('//wfs:WFS_Capabilities');
if ( $updateSequenceElement->length == 0){
......@@ -397,6 +427,8 @@ class Client {
$document = new \DOMDocument;
$document->loadXML( $data );
$xpath = new \DOMXPath( $document );
$xpath->registerNamespace('wfs', "http://www.opengis.net/wfs/2.0");
$xpath->registerNamespace('ows', 'http://www.opengis.net/ows');
$formats = $xpath
->query(
......@@ -427,6 +459,7 @@ class Client {
$xpath = new \DOMXPath( $document );
$xpath->registerNamespace( 'xsd', 'http://schemas.opengis.net/gml/3.2.1/gml.xsd' );
$xpath->registerNamespace('wfs', "http://www.opengis.net/wfs/2.0");
$types = $xpath->query( '//xsd:schema/xsd:complexType' );
......@@ -483,6 +516,7 @@ class Client {
$xmlDoc->loadXML ( $content );
$xpath = new \DOMXPath( $xmlDoc );
$xpath->registerNamespace('wfs', "http://www.opengis.net/wfs/2.0");
$xpath->registerNamespace('ows', 'http://www.opengis.net/ows');
$error = $xpath->query('//ows:ExceptionReport');
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter