Wiki » Historique » Version 18

Agnes Tellez Arenas, 06/11/2017 13:02

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 1 Mickael Beaufils
h1. About WMS for BoreholeView
86 16 Agnes Tellez Arenas
87 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())
88 1 Mickael Beaufils
<pre>
89 17 Agnes Tellez Arenas
CREATE TABLE epos.borehole_sld
90 17 Agnes Tellez Arenas
(
91 17 Agnes Tellez Arenas
  pk_rule serial NOT NULL,
92 17 Agnes Tellez Arenas
  name character varying(500),
93 17 Agnes Tellez Arenas
  filtre_purpose_href character varying(500),
94 17 Agnes Tellez Arenas
  filtre_length_greater integer,
95 17 Agnes Tellez Arenas
  filter_length_lessequal integer,
96 17 Agnes Tellez Arenas
  style1_symbol character varying(100),
97 17 Agnes Tellez Arenas
  style1_size numeric,
98 17 Agnes Tellez Arenas
  style1_color character varying(11),
99 17 Agnes Tellez Arenas
  style2_symbol character varying(100),
100 17 Agnes Tellez Arenas
  style2_size numeric,
101 17 Agnes Tellez Arenas
  style2_color character(11),
102 17 Agnes Tellez Arenas
  CONSTRAINT sldpk PRIMARY KEY (pk_rule)
103 17 Agnes Tellez Arenas
)
104 17 Agnes Tellez Arenas
</pre>
105 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.
106 17 Agnes Tellez Arenas
<pre>
107 16 Agnes Tellez Arenas
-- select * from epos.insert_borehole_sld();
108 1 Mickael Beaufils
-- REFRESH MATERIALIZED VIEW  epos.borehole_eu_06_sld;
109 1 Mickael Beaufils
</pre>
110 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).
111 17 Agnes Tellez Arenas
<pre>
112 17 Agnes Tellez Arenas
CREATE MATERIALIZED VIEW epos.borehole_eu_06_sld AS 
113 17 Agnes Tellez Arenas
 SELECT borehole_eu_06.location_wgs84::geometry(Point,4326) AS geom,
114 17 Agnes Tellez Arenas
    borehole_eu_06.boreholeid,
115 17 Agnes Tellez Arenas
    borehole_eu_06.purpose_href,
116 17 Agnes Tellez Arenas
    borehole_eu_06.purpose,
117 17 Agnes Tellez Arenas
    borehole_eu_06.status,
118 17 Agnes Tellez Arenas
    borehole_eu_06.operator,
119 17 Agnes Tellez Arenas
    borehole_eu_06.driller,
120 17 Agnes Tellez Arenas
    borehole_eu_06.drillstartdate,
121 17 Agnes Tellez Arenas
    borehole_eu_06.drillenddate,
122 17 Agnes Tellez Arenas
    borehole_eu_06.startpoint,
123 17 Agnes Tellez Arenas
    borehole_eu_06.inclinationtype,
124 17 Agnes Tellez Arenas
    borehole_eu_06.boreholematerialcustodian,
125 17 Agnes Tellez Arenas
    borehole_eu_06.elevation_m,
126 17 Agnes Tellez Arenas
    borehole_eu_06.boreholelength_m,
127 17 Agnes Tellez Arenas
    sld.name,
128 17 Agnes Tellez Arenas
    sld.style1_symbol,
129 17 Agnes Tellez Arenas
    sld.style1_color,
130 17 Agnes Tellez Arenas
    sld.style1_size,
131 17 Agnes Tellez Arenas
    sld.style2_symbol,
132 17 Agnes Tellez Arenas
    sld.style2_color,
133 17 Agnes Tellez Arenas
    sld.style2_size
134 17 Agnes Tellez Arenas
   FROM epos.borehole_eu_06,
135 17 Agnes Tellez Arenas
    epos.borehole_sld sld
136 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
137 17 Agnes Tellez Arenas
WITH DATA;
138 17 Agnes Tellez Arenas
139 17 Agnes Tellez Arenas
</pre>
140 16 Agnes Tellez Arenas
141 15 Agnes Tellez Arenas
h1. HOW TO - détail de mise en place WFS NRZ (Natural Risk Zones) sur données Pangeo (Europe)
142 15 Agnes Tellez Arenas
143 15 Agnes Tellez Arenas
[[howToWFSpangeoGeoserver]]