-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Problème
Nous devrions rencontrer des erreurs mentionnant l'absence d'identifiant sur les géométries avec le fichier suivant :
<?xml version="1.0" encoding="utf-8" ?>
<PlanCorpsRueSimplifie xmlns="http://cnig.gouv.fr/pcrs" xmlns:gml="http://www.opengis.net/gml/3.2" version="1.0" gml:id="keifmOES" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://cnig.gouv.fr/pcrs https://raw.githubusercontent.com/cnigfr/PCRS/master/schemas/CNIG_PCRS_v2.0.xsd">
<featureMember>
<PointCanevasPCRS gml:id="id-canevas-007-001">
<idObjet>007-001</idObjet>
<thematique>01</thematique>
<qualiteCategorisation>01</qualiteCategorisation>
<precisionPlanimetrique>002</precisionPlanimetrique>
<precisionAltimetrique>002</precisionAltimetrique>
<producteur>Agglomération de là-bas</producteur>
<geometrie><gml:Point srsName="EPSG:3948"><gml:coordinates>[2029343.427,7215771](callto:2029343.427,7215771).109,191.071</gml:coordinates></gml:Point>
</geometrie>
<canevas>nc</canevas>
<precisionXY>2</precisionXY>
<precisionZ>1</precisionZ>
<immatriculation>007-001</immatriculation>
<dateCreation>1900-01-01</dateCreation>
<fiche>007-001.pdf</fiche>
</PointCanevasPCRS>
</featureMember>
</PlanCorpsRueSimplifie>Ce problème ne sort ni avec le validateur IGN, ni avec ceux en ligne ( ex : https://www.freeformatter.com/xml-validator-xsd.html )
Explication
M. Bayard (GRDF) :
Dans CNIG_PCRS_v2.0.xsd il y a un import du XSD du GML (). Les validateurs ne savent pas l'exploiter.
Nous ne couperons pas à priori à télécharger les schémas pour résoudre par exemple comme suit :
<?xml version="1.0" encoding="iso-8859-1"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:gco="http://www.isotc211.org/2005/gco"
targetNamespace="http://cnig.gouv.fr/pcrs">
<!-- Modifications effectuées sur les autres fichiers pour faire fonctionner celui-ci :
1- dans gco/gcoBase.xsd (2 endroits) : changement du namespace gml xmlns:gml="http://www.opengis.net/gml" en "http://www.opengis.net/gml/3.2"
2- dans gco/gcoBase.xsd : changement de <xs:attributeGroup ref="xlink:simpleLink"/> en <xs:attributeGroup ref="xlink:simpleAttrs"/>
3- dans gco/basicTypes.xsd (2 endroits) : changement du namespace gml xmlns:gml="http://www.opengis.net/gml" en "http://www.opengis.net/gml/3.2"
4- dans gco/basicTypes.xsd : changement de <xs:attributeGroup ref="xlink:simpleLink"/> en <xs:attributeGroup ref="xlink:simpleAttrs"/>
5- dans gsr/spatialReferencing.xsd (2 endroits): changement du namespace gml xmlns:gml="http://www.opengis.net/gml" en "http://www.opengis.net/gml/3.2"
6- dans gts/temporalObjects.xsd (2 endroits): changement du namespace gml xmlns:gml="http://www.opengis.net/gml" en "http://www.opengis.net/gml/3.2"
7- dans gss/geometry.xsd (2 endroits): changement du namespace gml xmlns:gml="http://www.opengis.net/gml" en "http://www.opengis.net/gml/3.2"
-->
<!-- Schémas principal du PCRS, fourni par le CNIG -->
<include schemaLocation="CNIG_PCRS_v2.0.xsd"/>
<!-- xlink pour W3C xlinks pour OGC -->
<import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink\xlink.xsd"/>
<import namespace="http://www.opengis.net/gml/3.2" schemaLocation="gml\3.2.1.2\gml.xsd"/>
<import namespace="http://www.isotc211.org/2005/gmd" schemaLocation="gmd\gmd.xsd"/>
</schema>Remarque : Les modifications du type
xmlns:gml="http://www.opengis.net/gml"=>"http://www.opengis.net/gml/3.2"sont là pour préciser la version du GML (par défaut, on n'aurait pas 3.2 en interne dans le schéma GML)
Solutions à explorer
Partir sur ce principe
à tester et discuter avec MLambois et groupe PCRS
- Construire un dossier (ex :
xsd-schemas) avec l'ensemble des schémas - Voir comment le maintenir
- En profiter pour imposer l'utilisation d'une liste de schéma connu?
Ajouter un ResourceResolver
c.f. https://stackoverflow.com/a/2342859 (à priori, on peut résoudre les URL au besoin en accès à un dossier "schema.opengis.net" embarqué dans le jar.