Hi Andrea,
thank you for your test!
I doubt I would have managed to get any surface out of the transformation.
I worked a little bit more and I was able to take a few more steps and achieve some more results.
Here you are a new SLD that generate a temperature bands surface.
<?xml version="1.0" encoding="ISO-8859-1"?>
Barnes surface
Barnes Surface
A style that produces a Barnes surface using a rendering transformation
data
valueAttr
Temperatur
scale
1000
convergence
0.3
passes
100
minObservations
2
maxObservationDistance
0
pixelsPerCell
25
queryBuffer
2000
outputBBOX
wms_bbox
outputWidth
wms_width
outputHeight
wms_height
the_geom
0.8
I played with the Barnes parameters and fix some errors in my first SLD. Now I can obtain a surface …
Here you are tle SLD to obtain the isotherms …
<?xml version="1.0" encoding="ISO-8859-1"?>
BarnesContours
Barnes Surface Contours
Extracts contours from a computed surface
data
data
valueAttr
Temperatur
scale
1000
convergence
0.2
passes
3
minObservations
2
maxObservationDistance
0
pixelsPerCell
0
outputBBOX
wms_bbox
outputWidth
wms_width
outputHeight
wms_height
queryBuffer
1000
levels
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6
7
8
9
10
simplify
true
rule1
Isotherm
value
1.0
0
#000000
1
value
Arial
Normal
12
2
#FFFFFF
0.6
#000000
2000
true
100
50
30
It’s still not a good job but it’s something more … In any case your surface is better, great job! Thank you!
each and every point the algorithm decided there was not enough reference points close enough to use
I think so …
Also, at first I was wondering why some block of points were not interpolated,
and found out later that they have a NULL temperature, it’s easy to see
which points actually have a valid one by adding “Temperatur is not null”
as a CQL filter in the GetMap request for the point map
I’ve noted the NULL value of Temperature: in fact I think to find a source data with more records and not NULL value … I think that my data it’s not so good at the moment for this interpolation I have to make it more dense.
Ah, one final observation, the results of the interpolation of ground temperatures
(these are ground whether stations right?) at different elevations might be, if memory serves
me right, methodologically incorrect.
At minimum you’d need a digital elevation model, perform elevation compensation
based on the station elevation, pushing all temperatures down to sea level, interpolate,
and then use the DEM again to move back the results at the actual elevation
of that cell (this does not take into account inversion layers, but should be better
than ignoring elevation altogether)
Right ande thanks. I don’t have a DEM now but I’m looking for it …
Here you’re the full SDL that calculate the isotherms merging your SLD and my firt SLD …
<?xml version="1.0" encoding="ISO-8859-1"?>
BarnesContours
Barnes Surface Contours
Extracts contours from a computed surface
data
data
valueAttr
Temperatur
scale
10000
convergence
0.5
passes
3
minObservations
1
maxObservationDistance
70000
pixelsPerCell
10
outputBBOX
wms_bbox
outputWidth
wms_width
outputHeight
wms_height
queryBuffer
10000
levels
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6
7
8
9
10
simplify
true
rule1
Isotherm
value
1.0
0
#000000
1
value
Arial
Normal
12
2
#FFFFFF
0.6
#000000
2000
true
100
50
30
It seems better: try to creare a Group Layer using the point, the surface and the isothems and it looks a letter better now …
Thank you very much for the support …
Bye
Cesare
Cesare Gerbino
http://cesaregerbino.wordpress.com/
http://www.facebook.com/cesare.gerbino
http://www.facebook.com/pages/Cesare-Gerbino-GIS-Blog/246234455498174?ref=hl
https://twitter.com/CesareGerbino
http://www.linkedin.com/pub/cesare-gerbino/56/494/77b
2013/1/27 Andrea Aime <andrea.aime@anonymised.com>
On Fri, Jan 25, 2013 at 10:36 AM, cesare gerbino <cesaregerbino@…84…> wrote:
Hi Martin and Andrea,
I’ll try to test your suggestions … Only an answer: Martin suggest “… test the sample SLD and dataset that ships with GeoServer”: which SLD and dataset? In the GeoServer installation there are not demo data and SLD for this function (at least I don’t find them … ), and also in the original post on OSGeo blog (http://blog.opengeo.org/2013/01/10/chaining-rendering-transformations-in-geoserver/), there are no data to download and test.
I’m wrong? Could you show me where I can find all this stuff?
Hi Cesare,
took some time to play with your data.
I was getting the same results as you, and without a debugger, I doubt I would have managed
to get any surface out of the transformation.
However, debugging and reading the parameter definitions (looking at the WPS process builder)
I’ve managed to get something out of it.
The original SLD resulted in -999 being in all cells, where -999 is the default nodata value
for the process. This happened because for each and every point the algorithm decided
there was not enough reference points close enough to use.
Looking at the description of the parameters:
- maxObservationDistance: Maximum distance to an observation for it to support a grid cell, in units of the source CRS (default = 0, meaning all observations used)
- scale: Length scale for the interpolation, in units of the source data CRS
- queryBuffer: Distance to expand the query envelope by, in units of the source CRS (larger values provide a more stable surface)
“units in the source CRS” is the key, the values in the SLD were meant to interpolate
spare values in degrees, whilst in this case we have meters.
This SLD returns a surface:
<?xml version="1.0" encoding="ISO-8859-1"?>
Barnes surface
Barnes Surface
A style that produces a Barnes surface using a rendering transformation
data
valueAttr
Temperatur
scale
10000
convergence
0.5
passes
3
minObservations
1
maxObservationDistance
70000
pixelsPerCell
10
queryBuffer
100000
outputBBOX
wms_bbox
outputWidth
wms_width
outputHeight
wms_height
point
0.8
I’ve noticed the results vary wildly by changing the scale, which is a weighting
factor used as follows (so, not linear, but exponential on the ratio between
the distance and the scale)
double dr = dist / lengthScale;
double w = Math.exp(-(dr * dr / convergenceFactor));
One final thing I’ve noticed is that the transformation does not seem to be
working at all in tiled mode, in the 3x3 metatile blocks used by GeoServer
only one of the tiles is filled, the others are black, despite the generous
query buffer used in the SLD.
Also, at first I was wondering why some block of points were not interpolated,
and found out later that they have a NULL temperature, it’s easy to see
which points actually have a valid one by adding “Temperatur is not null”
as a CQL filter in the GetMap request for the point map.
Ah, one final observation, the results of the interpolation of ground temperatures
(these are ground whether stations right?) at different elevations might be, if memory serves
me right, methodologically incorrect.
At minimum you’d need a digital elevation model, perform elevation compensation
based on the station elevation, pushing all temperatures down to sea level, interpolate,
and then use the DEM again to move back the results at the actual elevation
of that cell (this does not take into account inversion layers, but should be better
than ignoring elevation altogether). See also:
http://en.wikipedia.org/wiki/Altitude#Relation_between_temperature_and_altitude_in_Earth.27s_atmosphere
That said, this is not my field of expertise, there is a good chance I’m just wrong
about it.
Cheers
Andrea
–
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it