HowToWFSpangeoGeoserver » Historique » Version 16

« Précédent - Version 16/39 (diff) - Suivant » - Version actuelle
Agnes Tellez Arenas, 09/03/2017 17:17


Pour mémoire tant que le server est up, ancienne version avec eXows (et ancienne version de la data spec)
http://pangeo.brgm-rec.fr/exowsPangeoFR/?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&typename=PANGEO_ENG_london_ground_stability&MAXFEATURES=1

remarque: install plug-in XMLTools pour nodepad++, qui permet la validation (attention, ne placer qu'un seul xsd dans le xsj:schemaLocation).

Urls et servers

  • BD : server EPOS [voir keepass]

Install geoserver pour INSPIRE et WFS app-schema

mapping des données

On choisit (? à valider par thématicien?) de partir sur "ObservedEvent": Discrete spatial objects representing natural phenomenon relevant to the study of natural hazards which occurred, or is currently occuring, and which has been observed.
  • On aurait pu utiliser dans la table Pangeo la colonne "determine" qui peut être : "3_ObservedGeologyFieldCampaigns", "1_ObservedPSI", "4_PotentialInstability", "2_ObservedOtherDefMeasurement". MAIS lorsque c'est "potential" on a tout de même une date de début et de fin de l'event. donc... on reste sur de l'event observé.
  • la colonne "determine" n'est donc pas utilisé (on va le mettre dans le name histoire de conserver qlq chose)

Exemple de XML qui valide

   <nz-core:ObservedEvent  gml:id="PGGH_London_009" 
             xmlns:gml="http://www.opengis.net/gml/3.2" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/nz-core/4.0/NaturalRiskZonesCore.xsd" 
             xmlns:nz-core="http://inspire.ec.europa.eu/schemas/nz-core/4.0" 
             xmlns:xlink="http://www.w3.org/1999/xlink" 
             xmlns:wfs="http://www.opengis.net/wfs/2.0" 
             xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"    
        >
    <!-- Discrete spatial objects representing natural phenomenon relevant to the study of natural hazards which occurred, or is currently occuring, and which has been observed.. -->

        <nz-core:beginLifeSpanVersion xsi:nil="true"/>
            <!--  Date and time at which this version of the spatial object was inserted or changed in the spatial data set.-->
        <nz-core:endLifeSpanVersion xsi:nil="true"/><!-- no value in our database -->
      <nz-core:inspireId>
        <base:Identifier >
          <base:localId>PGGH_London_009</base:localId>
          <base:namespace>GBPangeoHazard</base:namespace>
        </base:Identifier>
      </nz-core:inspireId>            
      <nz-core:nameOfEvent>XXX</nz-core:nameOfEvent>
      <nz-core:typeOfHazard>
        <!-- A generic classification and a specific classification of the type of natural hazard. -->
        <nz-core:NaturalHazardClassification>
            <nz-core:hazardCategory><!--4_AnthropogenicGroundInstability--></nz-core:hazardCategory> <!-- http://inspire.ec.europa.eu/codeList/RiskOrHazardCategory -->
            <nz-core:specificHazardType><!--4_5UndergroundConstruction--></nz-core:specificHazardType> <!-- 
                                                                Additional classification of the natural hazard that further specifies the hazard 
                                                                type according to a nomenclature that is specific to this dataset. -->
        </nz-core:NaturalHazardClassification>
    </nz-core:typeOfHazard>
    <nz-core:validFrom>1992-06-19T00:00:00</nz-core:validFrom><!-- The time when the observed event started to exist in the real world.-->
    <nz-core:validTo>2010-09-17T00:00:00</nz-core:validTo>

      <nz-core:geometry></nz-core:geometry>

    <nz-core:magnitudeOrIntensity xsi:nil="true"/>
        <!-- An expression of the magnitude or the intensity of a phenomenon.
            It may address a value within the Richter scale, or a description of the european macro-seismic scale, or a flood flow, etc... -->

    </nz-core:ObservedEvent>

Configuration geoserver pour WFS app-schema

Voir aussi: https://forge.brgm.fr/projects/standardisation/wiki/REX_implementations_BRGM
Voir aussi: http://www.onegeology.org/docs/technical/OneGeologyWFSCookbook_v1.0.pdf
Voir aussi: http://docs.geoserver.org/stable/en/user/data/app-schema/index.html

Recharger par la console d'admin GEOSERVER quand modif des fichiers XML (il suffit de sauver la configuration globale).

Par l'interface admin geoserver:

  • aller déposer (par copie d'un exemple existant) workspaces/nz-core/nz-core_ObservedEvent/nz-core_ObservedEvent_mapping.xml
    • l'éditer correctement (...)
    • le bon url de .xsd: http://inspire.ec.europa.eu/schemas/nz-core/4.0/NaturalRiskZonesCore.xsd
    • et le mapping (sourceType est le nom de table)
                                <AttributeMapping>
                                   <targetAttribute>nz-core:ObservedEvent</targetAttribute><!-- TAG à placer -->
                          <idExpression>
                              <OCQL>inspireid</OCQL> <!-- pour l'ID, nom de la colonne -->
                          </idExpression>
                      </AttributeMapping>
                      <AttributeMapping><!-- TAG à placer -->
                          <targetAttribute>nz-core:beginLifeSpanVersion</targetAttribute>
                          <ClientProperty><!-- attribut (nom et valeur, ici en dur, pourrait être un nom de colonne ou fc SQL dans value) -->
                              <name>xsi:nil</name>
                              <value>'true'</value>
                          </ClientProperty>
                      </AttributeMapping>
                      <AttributeMapping>
                          <targetAttribute>nz-core:nameOfEvent</targetAttribute>
                          <sourceExpression><!-- valeur / content -->
                              <OCQL>deterline</OCQL>
                          </sourceExpression>                    
                      </AttributeMapping>
      
  • création datastore (entrepot) "datascoreAppschema-nz-core" de type "Application Schema DataAccess" ,
    • avec file:workspaces/nz-core/datascoreAppschema-nz-core/nz-core_ObservedEvent_datasource.xml (qu'il faut créer auparavant, par copie par exemple d'un fichier existant)

RESTE qlq chose à faire, manque la définition du featureType (sous folder avec featureType.xml qui configure le featureType)