Wiki » Historique » Version 22

Mickael Beaufils, 09/11/2017 13:08

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 22 Mickael Beaufils
h2. ## DB part (for xsd version 1.0.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 21 Mickael Beaufils
 CREATE TABLE epos.borehole_eu
29 21 Mickael Beaufils
(
30 6 Mickael Beaufils
  boreholeid character varying NOT NULL,
31 9 Mickael Beaufils
  gmlidentifier character varying,
32 9 Mickael Beaufils
  name character varying,
33 1 Mickael Beaufils
  gsmlpidentifier character varying,
34 21 Mickael Beaufils
  description text,
35 1 Mickael Beaufils
  purpose_href character varying(255),
36 21 Mickael Beaufils
  purpose character varying(255),
37 21 Mickael Beaufils
  boreholeuse text,
38 1 Mickael Beaufils
  boreholeuse_href character varying(255),
39 1 Mickael Beaufils
  status_href character varying(255),
40 6 Mickael Beaufils
  status character varying(30),
41 6 Mickael Beaufils
  drillingmethod_href character varying(255),
42 21 Mickael Beaufils
  drillingmethod text,
43 21 Mickael Beaufils
  operator text,
44 1 Mickael Beaufils
  driller character varying(50),
45 1 Mickael Beaufils
  drillstartdate date,
46 6 Mickael Beaufils
  drillenddate date,
47 6 Mickael Beaufils
  startpoint_href character varying(255),
48 1 Mickael Beaufils
  startpoint character varying(30),
49 1 Mickael Beaufils
  inclinationtype_href character varying(255),
50 1 Mickael Beaufils
  inclinationtype character varying(30),
51 21 Mickael Beaufils
  boreholematerialcustodian text,
52 6 Mickael Beaufils
  boreholelength_m real,
53 6 Mickael Beaufils
  elevation_m real,
54 6 Mickael Beaufils
  elevation_srs character varying,
55 6 Mickael Beaufils
  source character varying,
56 1 Mickael Beaufils
  parentborehole_uri character varying,
57 1 Mickael Beaufils
  metadata_uri character varying,
58 21 Mickael Beaufils
  genericsymbolizer character varying(255),
59 1 Mickael Beaufils
  cored boolean,
60 9 Mickael Beaufils
  accesstophysicaldrillcore boolean,
61 9 Mickael Beaufils
  detaileddescription character varying(255),
62 9 Mickael Beaufils
  detaileddescription_href character varying(255),
63 9 Mickael Beaufils
  geophysicallogs character varying(255),
64 9 Mickael Beaufils
  geophysicallogs_href character varying(255),
65 9 Mickael Beaufils
  geologicaldescription character varying(255),
66 9 Mickael Beaufils
  geologicaldescription_href character varying(255),
67 9 Mickael Beaufils
  groundwaterlevel character varying(255),
68 9 Mickael Beaufils
  groundwaterlevel_href character varying(255),
69 9 Mickael Beaufils
  groundwaterchemistry character varying(255),
70 1 Mickael Beaufils
  groundwaterchemistry_href character varying(255),
71 1 Mickael Beaufils
  rockgeochemistry character varying(255),
72 1 Mickael Beaufils
  rockgeochemistry_href character varying(255),
73 9 Mickael Beaufils
  poregaschemistry character varying(255),
74 9 Mickael Beaufils
  poregaschemistry_href character varying(255),
75 9 Mickael Beaufils
  geotechnicalinfo character varying(255),
76 9 Mickael Beaufils
  geotechnicalinfo_href character varying(255),
77 9 Mickael Beaufils
  location_wgs84 geometry,
78 21 Mickael Beaufils
  positionalaccuracy text,
79 21 Mickael Beaufils
  CONSTRAINT pk_borehole_eu_06_on_boreholeid PRIMARY KEY (boreholeid)
80 21 Mickael Beaufils
)
81 4 Mickael Beaufils
82 4 Mickael Beaufils
h2. ## app-schema.properties
83 8 Mickael Beaufils
84 8 Mickael Beaufils
The datastore part from gsmlp_BoreholeView.xml is linked to a app-schema.properties file.
85 1 Mickael Beaufils
86 1 Mickael Beaufils
This file actually indicate how app-schema should connect to your database.
87 15 Agnes Tellez Arenas
It should be put in geoserver/WEB-INF/classes.
88 19 Mickael Beaufils
89 19 Mickael Beaufils
h2. ## GML namespace and workspace
90 19 Mickael Beaufils
91 19 Mickael Beaufils
If GML namespace is not appearing in your BoreholeView response(replaced by null, e.g. null:name).
92 19 Mickael Beaufils
93 1 Mickael Beaufils
- Check in your GeoServer that gml namespace and workspace are properly set and attached to GML v3.2.
94 20 Mickael Beaufils
95 19 Mickael Beaufils
- Check in your "BoreholeView.xml" mapping that reference to GML is also pointing v3.2.
96 1 Mickael Beaufils
97 16 Agnes Tellez Arenas
h1. About WMS for BoreholeView
98 18 Agnes Tellez Arenas
99 1 Mickael Beaufils
* 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())
100 17 Agnes Tellez Arenas
<pre>
101 17 Agnes Tellez Arenas
CREATE TABLE epos.borehole_sld
102 17 Agnes Tellez Arenas
(
103 17 Agnes Tellez Arenas
  pk_rule serial NOT NULL,
104 17 Agnes Tellez Arenas
  name character varying(500),
105 17 Agnes Tellez Arenas
  filtre_purpose_href character varying(500),
106 17 Agnes Tellez Arenas
  filtre_length_greater integer,
107 17 Agnes Tellez Arenas
  filter_length_lessequal integer,
108 17 Agnes Tellez Arenas
  style1_symbol character varying(100),
109 17 Agnes Tellez Arenas
  style1_size numeric,
110 17 Agnes Tellez Arenas
  style1_color character varying(11),
111 17 Agnes Tellez Arenas
  style2_symbol character varying(100),
112 17 Agnes Tellez Arenas
  style2_size numeric,
113 17 Agnes Tellez Arenas
  style2_color character(11),
114 17 Agnes Tellez Arenas
  CONSTRAINT sldpk PRIMARY KEY (pk_rule)
115 17 Agnes Tellez Arenas
)
116 18 Agnes Tellez Arenas
</pre>
117 17 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.
118 16 Agnes Tellez Arenas
<pre>
119 1 Mickael Beaufils
-- select * from epos.insert_borehole_sld();
120 1 Mickael Beaufils
-- REFRESH MATERIALIZED VIEW  epos.borehole_eu_06_sld;
121 1 Mickael Beaufils
</pre>
122 17 Agnes Tellez Arenas
* 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).
123 17 Agnes Tellez Arenas
<pre>
124 17 Agnes Tellez Arenas
CREATE MATERIALIZED VIEW epos.borehole_eu_06_sld AS 
125 17 Agnes Tellez Arenas
 SELECT borehole_eu_06.location_wgs84::geometry(Point,4326) AS geom,
126 17 Agnes Tellez Arenas
    borehole_eu_06.boreholeid,
127 17 Agnes Tellez Arenas
    borehole_eu_06.purpose_href,
128 17 Agnes Tellez Arenas
    borehole_eu_06.purpose,
129 17 Agnes Tellez Arenas
    borehole_eu_06.status,
130 17 Agnes Tellez Arenas
    borehole_eu_06.operator,
131 17 Agnes Tellez Arenas
    borehole_eu_06.driller,
132 17 Agnes Tellez Arenas
    borehole_eu_06.drillstartdate,
133 17 Agnes Tellez Arenas
    borehole_eu_06.drillenddate,
134 17 Agnes Tellez Arenas
    borehole_eu_06.startpoint,
135 17 Agnes Tellez Arenas
    borehole_eu_06.inclinationtype,
136 17 Agnes Tellez Arenas
    borehole_eu_06.boreholematerialcustodian,
137 17 Agnes Tellez Arenas
    borehole_eu_06.elevation_m,
138 17 Agnes Tellez Arenas
    borehole_eu_06.boreholelength_m,
139 17 Agnes Tellez Arenas
    sld.name,
140 17 Agnes Tellez Arenas
    sld.style1_symbol,
141 17 Agnes Tellez Arenas
    sld.style1_color,
142 17 Agnes Tellez Arenas
    sld.style1_size,
143 17 Agnes Tellez Arenas
    sld.style2_symbol,
144 17 Agnes Tellez Arenas
    sld.style2_color,
145 17 Agnes Tellez Arenas
    sld.style2_size
146 17 Agnes Tellez Arenas
   FROM epos.borehole_eu_06,
147 17 Agnes Tellez Arenas
    epos.borehole_sld sld
148 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
149 17 Agnes Tellez Arenas
WITH DATA;
150 17 Agnes Tellez Arenas
151 16 Agnes Tellez Arenas
</pre>
152 15 Agnes Tellez Arenas
153 15 Agnes Tellez Arenas
h1. HOW TO - détail de mise en place WFS NRZ (Natural Risk Zones) sur données Pangeo (Europe)
154 15 Agnes Tellez Arenas
155 1 Mickael Beaufils
[[howToWFSpangeoGeoserver]]