GeoServer Blog
Polymorphism in application-schema
Support for polymorphism is included in Geoserver 2.0.2. Why do we need polymorphism support in app-schema? Some complex attributes are polymorphic by nature, which means they can have different types for different features.
Before polymorphism was supported, attribute types had to be specified in the mapping file, so could not vary across features. With polymorphism support, filter functions can now be used to specify conditions when determining the encoded type.
For example:
If MaterialCode is “rock”, er:material should be encoded as gsml:RockMaterial, otherwise it should be encoded as gsml:Mineral.
This can be expressed in the mapping file like this:
<AttributeMapping>
<targetAttribute>er:material</targetAttribute>
<sourceExpression>
<linkElement>
if_then_else(equalTo(MaterialCode, 'rock'), 'gsml:RockMaterial', 'gsml:Mineral')
</linkElement>
</sourceExpression>
</AttributeMapping>
Another common example is replacing null values with an xlink:href to a URI representing missing values:
<AttributeMapping>
<targetAttribute>er:startDate</targetAttribute>
<sourceExpression>
<linkElement>if_then_else(isNull(START_DATE), toXlinkHref('urn:ogc:def:nil:OGC::missing'),
'gml:TimeInstantPropertyType')
</linkElement>
</sourceExpression>
</AttributeMapping>
Read more about app-schema polymorphism support: polymorphism.
Oracle GeoRaster & Custom JDBC Access
With the soon-to-be-released GeoServer 2.0.2, there are some exciting new features, two of which I would like to mention here.
GeoServer will soon be able to handle raster/image data in customized JDBC database layouts. This is useful for special use cases or existing image databases, offering the freedom of choosing individual table layouts, provided the needed data and image meta information is available.
Because of this new feature, GeoServer will be able to serve Oracle GeoRaster files. This new functionality is due to improvements to underlying GeoTools imagemosaic-jdbc module.
For those who aren’t familiar, the imagemosaic-jdbc extension enables storing tiles and pyramids into a JDBC database. This is useful for building and storing an image SQL database from scratch, following a predefined table layout. See the image mosaic tutorial for more information on how this works.
Increasing GeoServer performance and stability with flow control
Putting a public OGC server in production can be a daunting task. Dynamic web GIS requests (be they WMS or WFS) consume significantly more resources than a regular web site, making the service quite demanding in terms of memory, CPU, and bandwith consumption. When a service becomes popular, requests start fighting for limited resources and put the hardware under considerable strain, possibly leading to failure due to lack of available memory.
The default GeoServer configuration already provides some help in this regard: it is already possible to limit the resources used by a single request by setting the maximum amount of features returned in a WFS request and by setting the maximum time and memory allowed for a WMS request. That is not enough, however, as it is still possible for the service to be bogged down by a large number of requests.
The control flow community module was developed to enable an administrator to impose limits on the total amount of work GeoServer may execute in parallel. With control flow, it is possible to limit the number of GetMap requests that will ever be served concurrently or to limit the number of requests that a single user may run in parallel. This simultaneously improves resource consumption, fairness, and performance.
Because it is a community module, you’ll only be able to find control flow in nightly builds. I recommend everyone running a public GeoServer instance look into the documentation, install it, and reap the benefits of increased resource control. I’ve actually been running it for over two months without issue on a relatively busy server (up to 60 thousand requests per day), resulting in greater up-times and fewer failed requests. Let us know how it works for you—if the module becomes popular we plan to turn it into an official extension that will be available in official releases.
GeoServer helps you get a job
The opportunities available to those with experience in GeoServer seem to be growing all the time. As more organizations rely on GeoServer for their applications they seek people who already have experience working with the software. The best kind of experience is being able to point to actual involvement in the project, so I encourage everyone to contribute—code, documentation and just helping answer questions on the list are all appreciated by the core developers and can indeed help you get a job.
In the last couple weeks I’ve seen a few different opportunities, so thought I’d post them here:
• The Global Biodiversity Information Facility (GBIF) is looking for a consultant to provide “the development of geospatial services for species related data” which will be “offered as OGC web services provided by GeoServer”. There is also a listing for a client-side developer who would consume GeoServer services in an OpenLayers, GeoExt, or Flash–based client.
• On Twitter, I came across a company searching for a “Senior GeoServer Developer” who has at least a year of experience with GeoServer and is a “proven contributor and committer” on the project. **
• The World Bank put up a job post seeking a developer to help them with core programming and deployment for “Haiti Data Dissemination Web Portals” to be built on the GeoNode project, which is based on GeoServer, Django, and GeoExt.
• With a bit of searching on Monster.com, I found a post for a developer with Java and GeoServer experience to help on a “Weather Data Analysis Capability” project.
If anyone else is looking for people with GeoServer expertise please email and I can add them here or do a job post in the future—or just add other listings in the comments. I’m also pretty sure a number of the core contributing companies behind GeoServer are on the lookout for new hires. Though they don’t yet have a ‘jobs’ section on the site, I wanted to give a shout out to GeoSolutions and their great-looking redesigned website, as I know they’ve been growing and on the lookout for great people.
UPDATE: I also meant to mention that my organization is looking for a Salesperson and a Director of Marketing to help sell the OpenGeo Suite, which has GeoServer at its core and funds all our time on the project.
SLD Cookbook
Styling map layers in GeoServer can be challenging. While there are some ways to craft map layers without ever needing to look at Styled Layer Descriptor (SLD) code, there are some who don’t want an intermediary and want to code with SLD directly. For those, there are few options:
- Read the OGC SLD 1.0 specification. At 100+ pages, it can be a bit dense.
- Read the SLD schema. Because, really, who doesn’t love interpreting schemas?
Failing those, the would-be map stylist is usually out of luck, needing to eke out an understanding of styling by asking on mailing lists and doing web searches.
When I was learning SLD, I wanted simple examples that I could understand and edit. I wanted screenshots. I wanted to know which line of code did what. I wanted to look up styles as if they were in a recipe book. But this type of reference didn’t exist at the time.
The SLD Cookbook is that reference. It is a “practical reference” to show how map styling works. It is not designed to be exhaustive, and it won’t tell you about every possible edge case. But it also has no SLDs that are hundreds of lines long, a strong hurdle to comprehension.
Want to know how to style a simple point? Look at the example, download the SLD (and the shapefile that generated the screenshot too, if you’d like), and read the details. See which line of code accomplishes what, so if you want to make the points blue instead of red, you’ll know what line to change (line 8 in this case). Want to see how to make a style where lines are styled differently by data attributes? Or by zoom level? Refer as necessary. Even those experienced with SLD may find the examples useful.
There are a few examples mixed in that leverage extensions to GeoServer/GeoTools (polygon fill hatching, labels that follow lines) but for the most part, the examples are perfectly valid according to the SLD 1.0 specification.
I’m sure that more examples can and will be added in time. I’ve already received some very good feedback from others, and some styles will likely be optimized. But every example, every screenshot, and every SLD was tested in the most recent version of GeoServer.
So take a look, and get styling! I hope you enjoy. Special thanks goes out to Geonovum, who funded this project. I personally appreciate it.
Tutorials
- Powerful SLD Styles & Filters in GeoServer
- Using Logical Operators in GeoServer Filters
- Exploring CQL/ECQL Filtering in GeoServer
- Using Spatial Operators in GeoServer Filters
- Using Value Comparison Operators in GeoServer Filters
- Using Binary Comparison Operators in GeoServer Filters
- Utilizing the Demo Section in Geoserver
- How to Implement Basic Security in Geoserver
- How to create Tile Layers with GeoServer
- How to style layers using GeoServer and QGIS