Senin, 16 April 2012

Dynamic WMS styling with GeoServer: SLD and library mode

Hi all,
today I want to delve a bit in the dynamic styling abilities that GeoServer provides.

GeoServer fully supports a client's ability to specify a custom SLD 1.0 style instead of a built-in named style, this can be done in different ways:
  1. adding a reference to a internet accessible sld file via the &sld=url parameter
  2. specifying the full SLD, url-encoded, in the request URL via the
  3. SLD_BODY=fullStyleDefinitionHere parameter
  4. POST-ing a GetMap XML document, as defined by the SLD 1.0 spec
  5. POST-ing the usual GET request, where each KVP parameter is sent over as a form parameter (this is a GeoServer extension)
Let's have a look at case 3) since it's a bit different than the others. In that case you need to post a XML document just like in WFS/WCS requests, the document looks as follows:


As you can see it's pretty much the usual GetMap request, but expressed in XML format, with the ability to embed UserStyle objects in it, which make it fully dynamic.

Ways 1, 3 and 4 rely on most of the usal GET parameters, and allow you to specify a custom SLD file, but the way the SLD file it's interpreted is radically different depending on whater you did specify the layers and styles param in your request, or not.

The simpler behavior is obtained if you don't specify layers and styles: the NamedLayer objects refer to layers in the server, the NameStyles to styles in the server, and UserStyle allow you to specify your custom style. Each layer is rendered with the style associated to it, and that's it.

However, if you specify layers in the request, the SLD document is downgraded to a "style library", this is known as library mode. Here is how this works:
  • each layer in the layers parameter is drawn in order
  • for each layer, if styles is present the name of the style is picked, otherwise the "default" style is looked for (same happens if you don't specify the style name for that layer)
  • given the layer name and the style name, a layer is searched in the SLD file that has the same name, and the styles inside it are searched for a style with the specified name. If none is found, the server is searched, if the style is not even there, an error is thrown
  • given a layer name and the indication to search the default style, a layer is searched in the SLD file that has the same name, and the user styles inside it are searched for one that has the 1 element making it the default style. If none is found the default style defined on the server side is picked instead, ignoring the SLD file contents.
Given the fact that the library mode is certainly more complex, and that you need to line up layer and style names properly, it is of course recommended not to specify the layers parameter and fall back on the simpler mode.
However, the library mode comes in handy if you are making a complex request, with many layers, and you want to provide a custom style for just a few of them: you just need to add the styles for those few in the SLD file, all the others will fall back to use the server side styles instead.

This is just one of the many ways GeoServer allows to dynamically alter the way maps are being built, others are SLD parameter substitution, dynamic filtering, and rendering transformations.

Want to hear more about dynamic styling? Let us know!

The GeoSolutions team,


Jumat, 13 April 2012

State of GeoServer presentation from FOSS4G-NA


Dear all,
we wanted share the slides from another presentation that Andrea Aime and Justin Deoliveira gave recently at the FOSS4G North America conference about the state of GeoServer.

Here below you have the complete presentation.

The GeoSolutions team,

Rabu, 11 April 2012

Unveiling upcoming GeoServer 2.2 release

Dear all,
we have created this post to share the slides from the presentation that Andrea Aime and Justin de Oliveira gave recently at the FOSS4G North America conference about the new feature that will be available in the upcoming 2.2 release of the GeoServer.

A lot of work has been performed since the first beta release of the 2.1 release, almost 2 years ago, quickly summarising some of the most interesting ones we can enumerate:
  • improved WPS
  • rendering transformation, to perform transformation on-the-fly during rendering
  • improved security subsystem
  • support for bigtiff
  • support for oracle georaster
  • support for TIME and ELEVATION in WMS and WCS
and many more.

For a complete cover of all these features, here you have the complete presentation.



View more presentations from GeoSolutions



The GeoSolutions team,

Senin, 02 April 2012

Saving the world one application at a time: Atlas of Tuna and Billfish Catches

This blog post covers some work we have done to support the FAO Fishery and Acqualture Department, specifically the FIGIS group with information dissemination about catches of Tuna and Billfish over the last 60 years globally

As stated on their website:
"... the Atlas presents the global distribution of catches by gear from 1950 to 2010, at 5° latitude by 5° longitude resolution, of those tuna and tuna-like species for which this distribution is generally well known on the global scale. These species consist of the so-called principal market tunas and some billfishes."

Atlas of Tuna and Billfish catches website


Using Geoserver, OpenLayers and Ext-JSwe built for them a simplfied viewer that allow users to access dynamically their statistics and to map them by multiple dimensions:

  • by gears (one or more)
  • by species (one or more)
  • for a certain years' range
  • for a certain quarters' range
Moreover users can decide to view the following indicators:
  • Cumulative catches across years
  • Average catches across years 
  • Average catches across quarters
The selections made by users are reflected directly on the visualization combining data from various sources through the GeoServer; animations can be created across years as well as years' quarters to show the evolution of the catches. The result can be seen here and in the pictures below.










Let's take a look at the implementation.
Background maps are served via GeoWebCache, nothing too sophisticated there, while the maps are generated on the fly by GeoServer connected to the FAO corporate Oracle instance via SQL Views that are performing join and aggregations on the fly between tables containing live information about catches and tables containing ancillary information like species and gear types. In addition, users can print the current map (together with the eventual result of a request for info on the map), as shown here below,


or they can request to generate an animated GIF, leveraging on the WMS Animator work (see this page for additional info) using a specific panel shown below where multiple dimensions can be again controlled:


Here below the resulting animations is shown.



Let us now summarise a few points for this project:
  • background maps are served with GeoWebCache which is shared with all the others mapping applications in places withing the department
  • most of the data is stored inside the corporate instance of Oracle Spatial, demonstrating perfect integration of Open Source with COTS
  • extensive usage of CQL filters and SQL Parametric Views has been made to generate dynamic maps and animations
Last but not least, we believe it is worth to mention that this work was performed via our GeoSolutions Enterprise ServicesTherefore, if you'd like to know more about what we could achieve together, do not hesitate and get in touch with us!

The GeoSolutions team,

Senin, 26 Maret 2012

Developer's Corner: Authenticating dummy clients in GeoServer

In this blog post we'll introduce a simple authentication method we developed for GeoServer that allows to deal with security unaware clients.

GeoServer can be configured to force a user to authenticate, either directly when trying to access the capabilities document (challenge mode) or when trying to access a protected resource (mixed mode). GeoServer will send a "http basic authentication" challenge, that will force browsers to show up the "username/password" authentication dialog, and make other desktop application ask and send over the user credentials.

There are surely more secure means to authenticate a user, yet basic http authentication is the minimum common denominator, something that most clients support, and coupled with HTTPS transport it provides a good starting point for a secured site.

Unfortunately there are clients out there that cannot even deal with basic authentication.
Some of the existing solutions deal with this by making you install a little desktop proxy software that the other software can connect to, with the proxy dealing with all security considerations. That is fine when you are in control of the client side, but not practical when the user is not able, willing, or allowed to install extra software on their machine.

To allow for some level of authentication and security in those cases we developed a community module called "authkey", or "Key authentication module", where all that is requested to the client is to add a unique key indentifying the user into the capabilities request.
Something like:
http://myhost/geoserver/wms?service=WMS&request=GetCapabilities&authkey=ef18d7e7-963b-470f-9230-c7f9de166888
And voilĂ , the user associated to that code will be recognized. The capabilities document returned will also contain back links to GeoServer that replicate the same code, so that also GetMap and GetFeatureInfo requests will work under that same user.
This way the authentication is done without the software having to willingly participate in the authentication mechanism.

The default implementation of the module will look for a property file that configures the associations between the unique codes and the existing users, but different solutions can be plugged in that allow for authentication via hardware code tokens, or daily tokens, or whatever solution you might come up with: see the documentation for more details on the configuration and instructions on how to write your own plugin.

Of course the solution is simple, but coupled with HTTPS it's more or less as secure as using basic authentication, and allows a wider range of client software solutions to participate in the game.

What about you, looking for some missing GeoServer security features? Interested in knowing more about our Enterprise Services? Let us know!

The GeoSolutions team,

Selasa, 20 Maret 2012

Saving the world one application at a time: FAO Regional Fishery Bodies Viewer

At GeoSolutions we believe that success stories about important organizations and Open Source Software should be openly shared and they can be used as a measure of OSS success in the formal enterprise environment.  In this blog post we are going to quickly introduce some work we have done for the Fishery and Acqualture Department of the Food and Agriculture Organization (FAO) of the United Nations (UN).

The FAO Fishery and Acqualture Department, specifically the FIGIS group; is involved in many efforts geared towards the conservation of the marine ecosystem and GeoSolutions is honored to work with them on some of the mapping applications they need in order to create effective querying and visualizations of the data they manage.

This blog post covers some work we have done to support information dissemination about Regional Fishery Bodies (RFB). As stated on their website:
"Regional Fishery Bodies (RFB) -- a group of States or organizations that are parties to an international fishery arrangement -- work together towards the conservation and management of fish stocks.
RFB can play a critical role in promoting longterm sustainable fisheries where international cooperation is required in conservation and management."


Using Geoserver and OpenLayers we built with them a comprehensive web based API to create on the fly maps with the relevant information for each resource with just a couple of lines of Javascript code. Maps are embedded in the FIGIS portal, as can be seen here and in the pictures below,



but also a specific RFB Viewer can be used to quickly show the RFBs' coverage on a map as shown at this link and in the screenshot below.


Let's take a deeper look at the implementation.
Interacting with GeoServer's WMS module we dynamically build the map with the continental layer, the member countries, the coast lines and the fishery boundaries. The API supports 3 different projections: WGS84 (EPSG:4326), Google Mercator (EPSG:900913) and Polar Stereographic (EPSG:3031).
For each of the regional fisheries body selected in first drop down menu, we generate an embed code as pictured below, this is used by the Fishery department web designers to replace what previously were static images representing the resources distribution and limits. It could also be used by an external website to embed these maps into their site.


More could be said about this project regarding its infrastructure, let's summarise a few interesting points:
  • background maps are served with GeoWebCache
  • most of the data is stored inside the corporate instance of Oracle Spatial, demonstrating perfect integration of Open Source with COTS
  • Extensive usage of CQL filters to drive the dynamic maps is used
Last but not least, we believe it is worth to mention that this work was performed via our GeoSolutions Enterprise Service. Therefore, if you'd like to know more about what we could achieve together, do not hesitate and get in touch with us!

The GeoSolutions team,

Kamis, 08 Maret 2012

GeoSolutions Enterprise Services: Open Source meets Enterprise

  • Are you looking for high-end professional support to help you with the creation of a SDI based on Open Source frameworks?
  • Are you thinking about an infrastructure to support the OpenData and are you wondering if a proprietary software is the best choice?
  • Are you tired of spending all your budget for licenses without creating the infrastructure you need?
  • Would you like to integrate a proprietary SDI with an Open Source software?

GeoSolutions can help you! 

The GeoSolutions  Enterprises Plans offer the possibility for creating an Enterprise SDI based on the best Open Source frameworks as GeoServer, GeoNetwork and MapStore.

Thanks to GeoSolutions it is easy to meet the Open Source world, forget about licenses and decide the budget for the solutions you are looking for!
Our support plans are available in different packages because we care about who has small needs and budget and about who must manage complex infrastructures and needs high specialized support.

Don't get lost, leverage on the support from the developers of the software you are using!

Visit the web site for more information and ask us to contact you, we will discuss about how many users we can support with your computing resources rather than about how many licenses you should buy!

The GeoSolutions team,