Wiki » Historique » Version 20

Mickael Beaufils, 09/11/2017 13:06

1 1 Mickael Beaufils
h1. About WFS App Schema for BoreholeView
2 1 Mickael Beaufils
3 13 Agnes Tellez Arenas
https://epos.brgm-rec.fr/geoserver/ows?service=wfs&version=2.0.0&request=GetFeature&TYPENAMES=gsmlp:BoreholeView&OUTPUTFORMAT=text/xml;%20subtype=gml/3.2&count=1&resolveDepth=*
4 12 Agnes Tellez Arenas
5 4 Mickael Beaufils
h2. # Trusted environment
6 1 Mickael Beaufils
7 4 Mickael Beaufils
This app schema has been successfully set up with those versions of GeoServer:
8 4 Mickael Beaufils
- BRGM ressource-rec: GeoServer 2.8.0
9 4 Mickael Beaufils
- BRGM epos-rec: GeoServer 2.9.2
10 1 Mickael Beaufils
11 1 Mickael Beaufils
12 4 Mickael Beaufils
h2. # Link to resources
13 1 Mickael Beaufils
14 4 Mickael Beaufils
Several content are offered in https://forge.brgm.fr/svnrepository/epos/trunk/tools/geoserver/
15 1 Mickael Beaufils
16 4 Mickael Beaufils
17 4 Mickael Beaufils
18 4 Mickael Beaufils
h1. # Tips for configuration of App-schema
19 4 Mickael Beaufils
20 4 Mickael Beaufils
h2. ## workspace
21 4 Mickael Beaufils
22 4 Mickael Beaufils
The content of workspaces (the gsmlp folder) should be put in your geoserver/data/workspaces.
23 4 Mickael Beaufils
24 10 Mickael Beaufils
h2. ## DB part (for xsd version 0.6.0)
25 1 Mickael Beaufils
26 6 Mickael Beaufils
App schema provided in SVN is actually set up for one table called "borehole_eu" with those columns:
27 1 Mickael Beaufils
28 6 Mickael Beaufils
  boreholeid character varying NOT NULL,
29 9 Mickael Beaufils
  gmlidentifier character varying,
30 1 Mickael Beaufils
  name character varying,
31 9 Mickael Beaufils
  gsmlpidentifier character varying,
32 1 Mickael Beaufils
  description character varying(255),
33 6 Mickael Beaufils
  purpose_href character varying(255),
34 1 Mickael Beaufils
  purpose character varying(50),
35 9 Mickael Beaufils
  boreholeuse character varying(50),
36 9 Mickael Beaufils
  boreholeuse_href character varying(255),
37 6 Mickael Beaufils
  status_href character varying(255),
38 1 Mickael Beaufils
  status character varying(30),
39 6 Mickael Beaufils
  drillingmethod_href character varying(255),
40 6 Mickael Beaufils
  drillingmethod character varying(50),
41 1 Mickael Beaufils
  operator character varying(50),
42 1 Mickael Beaufils
  driller character varying(50),
43 1 Mickael Beaufils
  drillstartdate date,
44 1 Mickael Beaufils
  drillenddate date,
45 6 Mickael Beaufils
  startpoint_href character varying(255),
46 1 Mickael Beaufils
  startpoint character varying(30),
47 6 Mickael Beaufils
  inclinationtype_href character varying(255),
48 1 Mickael Beaufils
  inclinationtype character varying(30),
49 1 Mickael Beaufils
  boreholematerialcustodian character varying(50),
50 6 Mickael Beaufils
  boreholelength_m real,
51 6 Mickael Beaufils
  elevation_m real,
52 6 Mickael Beaufils
  elevation_srs character varying,
53 6 Mickael Beaufils
  positionalaccuracy real,
54 6 Mickael Beaufils
  source character varying,
55 6 Mickael Beaufils
  parentborehole_uri character varying,
56 1 Mickael Beaufils
  metadata_uri character varying,
57 1 Mickael Beaufils
  genericsymbolizer character varying(50),
58 1 Mickael Beaufils
  cored boolean,
59 1 Mickael Beaufils
  accesstophysicaldrillcore boolean,
60 9 Mickael Beaufils
  detaileddescription character varying(255),
61 9 Mickael Beaufils
  detaileddescription_href character varying(255),
62 9 Mickael Beaufils
  geophysicallogs character varying(255),
63 9 Mickael Beaufils
  geophysicallogs_href character varying(255),
64 9 Mickael Beaufils
  geologicaldescription character varying(255),
65 9 Mickael Beaufils
  geologicaldescription_href character varying(255),
66 9 Mickael Beaufils
  groundwaterlevel character varying(255),
67 9 Mickael Beaufils
  groundwaterlevel_href character varying(255),
68 9 Mickael Beaufils
  groundwaterchemistry character varying(255),
69 9 Mickael Beaufils
  groundwaterchemistry_href character varying(255),
70 9 Mickael Beaufils
  rockgeochemistry character varying(255),
71 9 Mickael Beaufils
  rockgeochemistry_href character varying(255),
72 9 Mickael Beaufils
  poregaschemistry character varying(255),
73 9 Mickael Beaufils
  poregaschemistry_href character varying(255),
74 9 Mickael Beaufils
  geotechnicalinfo character varying(255),
75 9 Mickael Beaufils
  geotechnicalinfo_href character varying(255),
76 4 Mickael Beaufils
  location_wgs84 geometry,
77 5 Mickael Beaufils
78 4 Mickael Beaufils
h2. ## app-schema.properties
79 4 Mickael Beaufils
80 8 Mickael Beaufils
The datastore part from gsmlp_BoreholeView.xml is linked to a app-schema.properties file.
81 8 Mickael Beaufils
82 1 Mickael Beaufils
This file actually indicate how app-schema should connect to your database.
83 1 Mickael Beaufils
It should be put in geoserver/WEB-INF/classes.
84 15 Agnes Tellez Arenas
85 19 Mickael Beaufils
h2. ## GML namespace and workspace
86 19 Mickael Beaufils
87 19 Mickael Beaufils
If GML namespace is not appearing in your BoreholeView response(replaced by null, e.g. null:name).
88 19 Mickael Beaufils
89 19 Mickael Beaufils
- Check in your GeoServer that gml namespace and workspace are properly set and attached to GML v3.2.
90 1 Mickael Beaufils
91 20 Mickael Beaufils
- Check in your "BoreholeView.xml" mapping that reference to GML is also pointing v3.2.
92 19 Mickael Beaufils
93 1 Mickael Beaufils
h1. About WMS for BoreholeView
94 16 Agnes Tellez Arenas
95 18 Agnes Tellez Arenas
* Creation of a table epos.borehole_sld for translating the SLD rules (from https://forge.brgm.fr/svnrepository/epos/trunk/sld/): this operation is not automatic... (see function epos.insert_borehole_sld())
96 1 Mickael Beaufils
<pre>
97 17 Agnes Tellez Arenas
CREATE TABLE epos.borehole_sld
98 17 Agnes Tellez Arenas
(
99 17 Agnes Tellez Arenas
  pk_rule serial NOT NULL,
100 17 Agnes Tellez Arenas
  name character varying(500),
101 17 Agnes Tellez Arenas
  filtre_purpose_href character varying(500),
102 17 Agnes Tellez Arenas
  filtre_length_greater integer,
103 17 Agnes Tellez Arenas
  filter_length_lessequal integer,
104 17 Agnes Tellez Arenas
  style1_symbol character varying(100),
105 17 Agnes Tellez Arenas
  style1_size numeric,
106 17 Agnes Tellez Arenas
  style1_color character varying(11),
107 17 Agnes Tellez Arenas
  style2_symbol character varying(100),
108 17 Agnes Tellez Arenas
  style2_size numeric,
109 17 Agnes Tellez Arenas
  style2_color character(11),
110 17 Agnes Tellez Arenas
  CONSTRAINT sldpk PRIMARY KEY (pk_rule)
111 17 Agnes Tellez Arenas
)
112 17 Agnes Tellez Arenas
</pre>
113 18 Agnes Tellez Arenas
* if the SLD is updated, the table has to be updated as well. The best to do so is to update *the function epos.insert_borehole_sld()* which contains everything to create the SLD table. THen to refresh the materialized view.
114 17 Agnes Tellez Arenas
<pre>
115 16 Agnes Tellez Arenas
-- select * from epos.insert_borehole_sld();
116 1 Mickael Beaufils
-- REFRESH MATERIALIZED VIEW  epos.borehole_eu_06_sld;
117 1 Mickael Beaufils
</pre>
118 1 Mickael Beaufils
* Creation of a materialized view borehole_eu_06_sld joining the data and SLD rules. The Mapfile does only contain one Style (CLASS) rule, using the values from the database (performaces are better that way).
119 17 Agnes Tellez Arenas
<pre>
120 17 Agnes Tellez Arenas
CREATE MATERIALIZED VIEW epos.borehole_eu_06_sld AS 
121 17 Agnes Tellez Arenas
 SELECT borehole_eu_06.location_wgs84::geometry(Point,4326) AS geom,
122 17 Agnes Tellez Arenas
    borehole_eu_06.boreholeid,
123 17 Agnes Tellez Arenas
    borehole_eu_06.purpose_href,
124 17 Agnes Tellez Arenas
    borehole_eu_06.purpose,
125 17 Agnes Tellez Arenas
    borehole_eu_06.status,
126 17 Agnes Tellez Arenas
    borehole_eu_06.operator,
127 17 Agnes Tellez Arenas
    borehole_eu_06.driller,
128 17 Agnes Tellez Arenas
    borehole_eu_06.drillstartdate,
129 17 Agnes Tellez Arenas
    borehole_eu_06.drillenddate,
130 17 Agnes Tellez Arenas
    borehole_eu_06.startpoint,
131 17 Agnes Tellez Arenas
    borehole_eu_06.inclinationtype,
132 17 Agnes Tellez Arenas
    borehole_eu_06.boreholematerialcustodian,
133 17 Agnes Tellez Arenas
    borehole_eu_06.elevation_m,
134 17 Agnes Tellez Arenas
    borehole_eu_06.boreholelength_m,
135 17 Agnes Tellez Arenas
    sld.name,
136 17 Agnes Tellez Arenas
    sld.style1_symbol,
137 17 Agnes Tellez Arenas
    sld.style1_color,
138 17 Agnes Tellez Arenas
    sld.style1_size,
139 17 Agnes Tellez Arenas
    sld.style2_symbol,
140 17 Agnes Tellez Arenas
    sld.style2_color,
141 17 Agnes Tellez Arenas
    sld.style2_size
142 17 Agnes Tellez Arenas
   FROM epos.borehole_eu_06,
143 17 Agnes Tellez Arenas
    epos.borehole_sld sld
144 17 Agnes Tellez Arenas
  WHERE borehole_eu_06.purpose_href::text = sld.filtre_purpose_href::text AND borehole_eu_06.boreholelength_m > sld.filtre_length_greater::double precision AND borehole_eu_06.boreholelength_m <= sld.filter_length_lessequal::double precision
145 17 Agnes Tellez Arenas
WITH DATA;
146 17 Agnes Tellez Arenas
147 17 Agnes Tellez Arenas
</pre>
148 16 Agnes Tellez Arenas
149 15 Agnes Tellez Arenas
h1. HOW TO - détail de mise en place WFS NRZ (Natural Risk Zones) sur données Pangeo (Europe)
150 15 Agnes Tellez Arenas
151 15 Agnes Tellez Arenas
[[howToWFSpangeoGeoserver]]