[Geoserver-users] Chaining Rendering Transformations: Making isotherms using Barnes Surface + Contour process?

Hi all

I’m trying to calculate isotherms following the istructions showed in the post on OSGeo blog (http://blog.opengeo.org/2013/01/10/chaining-rendering-transformations-in-geoserver/)

I’m using GeoServer 2.2.3 on a Windows 7 machine (8 Gbyte RAM, biprocessor)

I’ve a shapefile with points and temperature (see the attached zip named data.zip) and I’m trying to use the Meteo-1.sld (see the attached file named Meteo-1.sld.

Using the layer in preview

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers

it works fine but when I try to use le Meteo-1.sld

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

the map is white. It seems that there are no errors in the log (see geoserver.log attached …).

When I try to use the Barnes Surface WPS directy (gs.BarnesSurface), I obtain a black tiff …

Could someone tell me which configurations I’ve to use in the sld for my data? Or give me a sample data and a sld that works?

Thank you in advance!!

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

Data.zip (16.2 KB)

Meteo-1.sld (5.19 KB)

geosrever.log (16.5 KB)

One problem is that you have two &styles parameters in the second URL. Try it with the redundant one removed and see what happens then.

On Wed, Jan 23, 2013 at 2:42 AM, cesare gerbino <cesaregerbino@anonymised.com> wrote:

Hi all

I’m trying to calculate isotherms following the istructions showed in the post on OSGeo blog (http://blog.opengeo.org/2013/01/10/chaining-rendering-transformations-in-geoserver/)

I’m using GeoServer 2.2.3 on a Windows 7 machine (8 Gbyte RAM, biprocessor)

I’ve a shapefile with points and temperature (see the attached zip named data.zip) and I’m trying to use the Meteo-1.sld (see the attached file named Meteo-1.sld.

Using the layer in preview

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers

it works fine but when I try to use le Meteo-1.sld

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

the map is white. It seems that there are no errors in the log (see geoserver.log attached …).

When I try to use the Barnes Surface WPS directy (gs.BarnesSurface), I obtain a black tiff …

Could someone tell me which configurations I’ve to use in the sld for my data? Or give me a sample data and a sld that works?

Thank you in advance!!

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


Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only – learn more at:
http://p.sf.net/sfu/learnnow-d2d


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Martin

thank you for the reply. I’ve just tried but it doesn’t work the same.

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

I think that the problem is in sld parameters: I’ve tried to change some of them but nothing happens… :frowning:

Did you try using my shp and my sld?

Thanks …

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/23 Martin Davis <mtnclimb@anonymised.com…>

One problem is that you have two &styles parameters in the second URL. Try it with the redundant one removed and see what happens then.

On Wed, Jan 23, 2013 at 2:42 AM, cesare gerbino <cesaregerbino@anonymised.com> wrote:

Hi all

I’m trying to calculate isotherms following the istructions showed in the post on OSGeo blog (http://blog.opengeo.org/2013/01/10/chaining-rendering-transformations-in-geoserver/)

I’m using GeoServer 2.2.3 on a Windows 7 machine (8 Gbyte RAM, biprocessor)

I’ve a shapefile with points and temperature (see the attached zip named data.zip) and I’m trying to use the Meteo-1.sld (see the attached file named Meteo-1.sld.

Using the layer in preview

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers

it works fine but when I try to use le Meteo-1.sld

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

the map is white. It seems that there are no errors in the log (see geoserver.log attached …).

When I try to use the Barnes Surface WPS directy (gs.BarnesSurface), I obtain a black tiff …

Could someone tell me which configurations I’ve to use in the sld for my data? Or give me a sample data and a sld that works?

Thank you in advance!!

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


Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only – learn more at:
http://p.sf.net/sfu/learnnow-d2d


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Yes, it’s possible the problem lies with the parameters. Unfortunately I won’t have much of a chance to try out your test case.

Some other things to try:

  • test the sample SLD and dataset that ships with GeoServer
  • try slimming your dataset down to a single point, and if that doesn’t work try altering some of the parameters
  • the last resort is to set up a GeoServer build environment and debug into the BarnesSurfaceProcess class

On Wed, Jan 23, 2013 at 11:42 PM, cesare gerbino <cesaregerbino@anonymised.com> wrote:

Hi Martin

thank you for the reply. I’ve just tried but it doesn’t work the same.

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

I think that the problem is in sld parameters: I’ve tried to change some of them but nothing happens… :frowning:

Did you try using my shp and my sld?

Thanks …

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/23 Martin Davis <mtnclimb@anonymised.com>

One problem is that you have two &styles parameters in the second URL. Try it with the redundant one removed and see what happens then.

On Wed, Jan 23, 2013 at 2:42 AM, cesare gerbino <cesaregerbino@anonymised.com> wrote:

Hi all

I’m trying to calculate isotherms following the istructions showed in the post on OSGeo blog (http://blog.opengeo.org/2013/01/10/chaining-rendering-transformations-in-geoserver/)

I’m using GeoServer 2.2.3 on a Windows 7 machine (8 Gbyte RAM, biprocessor)

I’ve a shapefile with points and temperature (see the attached zip named data.zip) and I’m trying to use the Meteo-1.sld (see the attached file named Meteo-1.sld.

Using the layer in preview

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers

it works fine but when I try to use le Meteo-1.sld

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&styles=&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

the map is white. It seems that there are no errors in the log (see geoserver.log attached …).

When I try to use the Barnes Surface WPS directy (gs.BarnesSurface), I obtain a black tiff …

Could someone tell me which configurations I’ve to use in the sld for my data? Or give me a sample data and a sld that works?

Thank you in advance!!

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


Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only – learn more at:
http://p.sf.net/sfu/learnnow-d2d


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On Thu, Jan 24, 2013 at 8:42 AM, cesare gerbino <cesaregerbino@anonymised.com…> wrote:

Hi Martin

thank you for the reply. I’ve just tried but it doesn’t work the same.

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

I think that the problem is in sld parameters: I’ve tried to change some of them but nothing happens… :frowning:

Cesare,
another thing to try out could be to change the color of the lowest level to something
other than white (so that it does not get confused with the background), maybe what’s
going on is that the interpolation results in values well lower than 0

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

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


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?

Thank you in advance!

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/24 Andrea Aime <andrea.aime@anonymised.com>

On Thu, Jan 24, 2013 at 8:42 AM, cesare gerbino <cesaregerbino@anonymised.com> wrote:

Hi Martin

thank you for the reply. I’ve just tried but it doesn’t work the same.

http://localhost:8080/geoserver/CesareWorkspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=CesareWorkspace:CentralineTemperature-01-01-2001&bbox=318287.0,4880823.0,515945.0,5142603.0&width=386&height=512&srs=EPSG:32632&format=application/openlayers&STYLES=Meteo-1

I think that the problem is in sld parameters: I’ve tried to change some of them but nothing happens… :frowning:

Cesare,
another thing to try out could be to change the color of the lowest level to something
other than white (so that it does not get confused with the background), maybe what’s
going on is that the interpolation results in values well lower than 0

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

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


On Fri, Jan 25, 2013 at 10:36 AM, cesare gerbino <cesaregerbino@anonymised.com…> 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

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

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


Good catch, Andrea. A couple more comments below:

On Sun, Jan 27, 2013 at 2:11 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

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)

Yes, choosing the scale value for Barnes seems to be a bit of a guessing game. I wasn’t able to find any references which gave a good strategy for it.

One final thing I’ve noticed is that the transformation does not seem to beworking 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.

Yes, tiled mode doesn’t currently work (well? At all?) for this RT. This may be partly due to a bug in the rendering stack which is not providing appropriate parameters for the tiles (as we discussed back in DC last May). There may be other issues as well - the code was not tested very much with tiling.

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

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

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