Wiki » Historique » Version 19

Mickael Beaufils, 09/11/2017 13:05

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
86 19 Mickael Beaufils
h2. ## GML namespace and workspace
87 19 Mickael Beaufils
88 19 Mickael Beaufils
If GML namespace is not appearing in your BoreholeView response(replaced by null, e.g. null:name).
89 19 Mickael Beaufils
90 19 Mickael Beaufils
- Check in your GeoServer that gml namespace and workspace are properly set and attached to GML v3.2.
91 19 Mickael Beaufils
92 19 Mickael Beaufils
- Check in your "BoreholeView.xml" mapping that reference to GML match the same version as that GeoServer is suppose to use.
93 19 Mickael Beaufils
94 19 Mickael Beaufils
95 19 Mickael Beaufils
96 19 Mickael Beaufils
97 19 Mickael Beaufils
98 1 Mickael Beaufils
h1. About WMS for BoreholeView
99 16 Agnes Tellez Arenas
100 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())
101 1 Mickael Beaufils
<pre>
102 17 Agnes Tellez Arenas
CREATE TABLE epos.borehole_sld
103 17 Agnes Tellez Arenas
(
104 17 Agnes Tellez Arenas
  pk_rule serial NOT NULL,
105 17 Agnes Tellez Arenas
  name character varying(500),
106 17 Agnes Tellez Arenas
  filtre_purpose_href character varying(500),
107 17 Agnes Tellez Arenas
  filtre_length_greater integer,
108 17 Agnes Tellez Arenas
  filter_length_lessequal integer,
109 17 Agnes Tellez Arenas
  style1_symbol character varying(100),
110 17 Agnes Tellez Arenas
  style1_size numeric,
111 17 Agnes Tellez Arenas
  style1_color character varying(11),
112 17 Agnes Tellez Arenas
  style2_symbol character varying(100),
113 17 Agnes Tellez Arenas
  style2_size numeric,
114 17 Agnes Tellez Arenas
  style2_color character(11),
115 17 Agnes Tellez Arenas
  CONSTRAINT sldpk PRIMARY KEY (pk_rule)
116 17 Agnes Tellez Arenas
)
117 17 Agnes Tellez Arenas
</pre>
118 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.
119 17 Agnes Tellez Arenas
<pre>
120 16 Agnes Tellez Arenas
-- select * from epos.insert_borehole_sld();
121 1 Mickael Beaufils
-- REFRESH MATERIALIZED VIEW  epos.borehole_eu_06_sld;
122 1 Mickael Beaufils
</pre>
123 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).
124 17 Agnes Tellez Arenas
<pre>
125 17 Agnes Tellez Arenas
CREATE MATERIALIZED VIEW epos.borehole_eu_06_sld AS 
126 17 Agnes Tellez Arenas
 SELECT borehole_eu_06.location_wgs84::geometry(Point,4326) AS geom,
127 17 Agnes Tellez Arenas
    borehole_eu_06.boreholeid,
128 17 Agnes Tellez Arenas
    borehole_eu_06.purpose_href,
129 17 Agnes Tellez Arenas
    borehole_eu_06.purpose,
130 17 Agnes Tellez Arenas
    borehole_eu_06.status,
131 17 Agnes Tellez Arenas
    borehole_eu_06.operator,
132 17 Agnes Tellez Arenas
    borehole_eu_06.driller,
133 17 Agnes Tellez Arenas
    borehole_eu_06.drillstartdate,
134 17 Agnes Tellez Arenas
    borehole_eu_06.drillenddate,
135 17 Agnes Tellez Arenas
    borehole_eu_06.startpoint,
136 17 Agnes Tellez Arenas
    borehole_eu_06.inclinationtype,
137 17 Agnes Tellez Arenas
    borehole_eu_06.boreholematerialcustodian,
138 17 Agnes Tellez Arenas
    borehole_eu_06.elevation_m,
139 17 Agnes Tellez Arenas
    borehole_eu_06.boreholelength_m,
140 17 Agnes Tellez Arenas
    sld.name,
141 17 Agnes Tellez Arenas
    sld.style1_symbol,
142 17 Agnes Tellez Arenas
    sld.style1_color,
143 17 Agnes Tellez Arenas
    sld.style1_size,
144 17 Agnes Tellez Arenas
    sld.style2_symbol,
145 17 Agnes Tellez Arenas
    sld.style2_color,
146 17 Agnes Tellez Arenas
    sld.style2_size
147 17 Agnes Tellez Arenas
   FROM epos.borehole_eu_06,
148 17 Agnes Tellez Arenas
    epos.borehole_sld sld
149 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
150 17 Agnes Tellez Arenas
WITH DATA;
151 17 Agnes Tellez Arenas
152 17 Agnes Tellez Arenas
</pre>
153 16 Agnes Tellez Arenas
154 15 Agnes Tellez Arenas
h1. HOW TO - détail de mise en place WFS NRZ (Natural Risk Zones) sur données Pangeo (Europe)
155 15 Agnes Tellez Arenas
156 15 Agnes Tellez Arenas
[[howToWFSpangeoGeoserver]]