Thursday 15 May 2014

S-57 Styling ENC Group 1 Classes (Skin of the Earth) for #GeoServer #ECDIS

Class LNDARE (Land area) requires a simple color fill with color token LANDA.

The S-52 Specification for ECDIS Display consists of 64 color tokens, in three (or five - depending on the version of the Spec) color palettes for DAY (DAY BRIGHT, DAY WHITE, and DAY BLACK), DUSK, and NIGHT displays. The differing color palettes enables the ECDIS to behave in a similar fashion to how a GPS Navigator in your car turns from a bright white display into a dark navy display in order to preserve your night vision during night time driving.

These color tokens are provided as CIE Yxy colors, and need to be converted into RGB colors by the ECDIS manufacturers.

For the DAY BRIGHT palette, LANDA maps to a soft yellow/light brown color. This shifts to a very dark e brown tone for night time use.

The next Class we want to show s DEPARE (Depth area) – this is the water, essentially. The DEPARE can be rendered in either 2 (default) or 4 distinguishing shades (of greyish blue for DAY BRIGHT palette, and dark violet/black for NIGHT) - DEPDW (deep water), DEPMD (medium deep water), DEPMS (medium shallow), DEPVS (very shallow), plus DEPIT (intertidal).

The NIGHT palette can only distinguish three shades – deep (using DEPDW), shallow (DEPVS), and intertidal (DEPIT). Note that deep and shallow are in reference to the safety contour.
The S-52 Specification recommends that the ECDIS allow the mariner to select a deep contour (default 30 metres) and a shallow contour (default 2.0 metres) in addition to safety contour (default 30 metres).
 
The actual contour lines are handled by the Class DEPCNT which is a Line Geometry. We shall look at this later.

In order to show the WRECKS layer with the LNDARE and DEPARE layers, we need to create a Layer Group, and this brings up the issue of the order of layering. The S-52 Specification consists of a field called Display Priority which is a number between 0 and 9, with the lowest priority 0 being laid down first and higher numbers being displayed on top. In cases where the Display Priority is the same, Geometries of type Point go on top of Lines, which go on top of Areas.

To facilitate this layering, I have developed a naming convention for these SLD Style files like so:

LNDARE_A1.sld – this signifies that style LNDARE is for Area Geometry, Display Priority 1
DEPARE_A1.sld – also for Area Geometry, Display Priority 1
WRECKS_P4.sld – this is for Point Geometry, Display Priority 4 (goes on top of the other two)

Putting all this together, we now have this for Cell US5FL24M:




Saturday 10 May 2014

S-57 ENC Styling for GeoServer

To get started styling S-57 ENC, I selected a layer of Point geometries from the previously converted S-57 ENC Cell US5FL24M that would be interesting for me to display – WRECKS. This Class actually comes in two flavours -  Point and Area, and we will revisit the latter at a later date.

I proceeded to load in the WRECKS, and it picked up the default point style as shown here:



Looking at the S-52 Specification, WRECKS has two important attributes that affect the styling – CATWRK (Category of wreck) and also VALSOU (Value of sounding). Keeping things simple, I developed an SLD with rules based on the CATWRK values. I also created three graphics based on the designs in the S-52 ENC Symbol Catalog – WRECKS01, WRECKS04, and WRECKS05 using the DAY BRIGHT (more about this later) palette. Loading all that into GeoServer and reloading the layer produced this display:


Some progress, but showing the positions of the wrecks without any further reference to shore is not very useful. I have also simplified these rules somewhat - S-52 actually contains Conditional Symbology Procedures (CSP) - these are essentially rendering rules based on values of attributes and specified using UML Activity Diagrams.

The S-57 Specification consists of over 170 Classes, each of which is presented as one or more Geometric primitives of type Point, Line, or Area (P, L, A) - this could potentially result in several hundred layers and styles. Fortunately, by rendering a small subset of these we can obtain very useful results in an iterative fashion.

Of these 170 or so Classes, there are seven Classes (using Area Geometric primitive only) that make up what is known as the "Skin of the Earth". These are the ENC Group 1 Classes:

LNDARE (Land area)
DEPARE (Depth area)
DRGARE (Dredged area)
FLODOC (Floating dock)
PONTON (Pontoon)
HULKES (Hulk)
UNSARE (Unsurveyed area)

As an example, Land Area (LNDARE) has Point, Line, and Area. Only the Area Geometry forms part of the Skin. We will look at these next.


Tuesday 29 April 2014

Creating an S-57 ENC Display with OpenLayers and GeoServer

Something that I have been wanting to do for a long time - that is to render S-57 ENC (Electronic Navigation Charts) using OpenLayers and GeoServer.

The process starts with converting the S-57 ".000" file in numerous Shapefiles using ogr2ogr. S-57 Objects have Geometric Primitives like Points, Lines, and Polygons; and are tied to Spatial Objects that have coordinates. The conversion then has to be done for each Geometry type:

ogr2ogr -skipfailures -f "ESRI Shapefile" point US5FL24M.000 -nlt POINT
ogr2ogr -skipfailures -f "ESRI Shapefile" line US5FL24M.000 -nlt LINESTRING
ogr2ogr -skipfailures -f "ESRI Shapefile" area US5FL24M.000 -nlt POLYGON


These commands will create point, line, polygon Shapefiles in corresponding folders for S-57 file US5FL24M.000 - note that many of the output files will be not-applicable (possibly blank) and we need to refer to the S-57 Specification to see which Class has which Geometric Primitives. Example is LNDARE which is "land area" - this supports both area and point geometries and needed to be styled for both.

Next step then was to figure out the specification for each S-57 Class and how it is styled based on the S-52 Specification for ECDIS Display. I created several styles using SLD for several key layers. The initial results look promising:



There are many complexities built into the rules of S-52, some Classes have several pages of Activity Diagrams that need to be translated into SLD.

Comments are most welcome.
 

Thursday 20 June 2013

BPMN Modeling with Simulations


Bazagi has released version 2.5 of Process Modeler. This version contains a Lanner Simulation Engine that can be used to analyze process flows, identify process bottlenecks, and optimize.

The simulation is very simple to set up, and comes complete with a number of Statistical Distributions. I was able to run processes very quickly at level 1, and by adding additional limits and constraints, levels 2 and 3. After a while, I started to receive the error message "The simulation has failed. Please ensure that your model is compliant to the BPMN2.0 standard and that it is supported by the Simulation engine."

As it turns out, the failure was caused by my usage of the Normal Distribution, with the negative three sigma value coming very close to zero - I believe this causes some inputs to be negative, and hence fail. The solution is to use the "Truncated Normal Distribution" and set the minimum value to 0.01 if you happen to be skirting with zero. This should prevent any negatives from occuring, and ensure a smooth BPMN execution.  

This is a great addition to an already wonderful tool.

Wednesday 9 January 2013

Stop Searching for Answers

Do you want to innovate or imitate ?

It's become too easy to fire up the browser and seek out the search results for answers.

Has it ever occurred to you that the existence of answers mean that it has been done before ?

There comes a time when the search reveals nothing useful. Instead of giving up, you should be excited that you may be on to something new and unique (or merely that the inventor never bothered to post it on the web).

Stop searching for answers and start creating the right questions.

Monday 27 February 2012

Are Facebook and Twitter innovations or just apps ?

We obviously live in an internet era.

Many recent graduates are forming startups hoping to reap the rewards like Yahoo (in the oldest days) Google (in the old days) and Facebook/Twitter in the present.

These are popular services, no doubt about it, and the press just can't stop talking about them. Valuations and IPOs are completely without realism. It's like saying that the most successful company in world commerce is the Yellow Pages.

These silly valuations come from investors fear of missing out on the next big IPO.

But are we forgetting something ? All these billion dollar-valuation companies are all single dimensional. They are all just web apps. Software really. So while their services may be innovative in their offerings, they are really just very big software houses.

I see complaints that the US is losing it's edge in innovation and R&D. No surprise really. While US is busy building web apps, China and Korea and the rest of the world are doing R&D in flat panels, lasers, semiconductor materials, acoustics, vehicle safety, and green energy. Multi-dimensional.

Sunday 8 January 2012

Business Modeling with BPMN

Very often we find that the Requirements Management process leads to a dead end. Typically, this is a revelation that the origin of the project are not well understood - and it is time to do some Business Modeling - to clarify exactly why the project is needed and where it fits into the grand scheme of things.

Over the past decade or so, I have used elements of UML to document the Business Processes, but found that something is still lacking. Activity Diagrams and Business Use Case Models can only go so far. 

I have found a very valuable tool in BPMN 2.0 - the Business Process Model and Notation - in particular the Level 1 and Level 2 conformance subclasses that limit the icon set and greatly increase the adoption rate among our client organizations. Naturally, a set of icons alone won't do the job - Bruce Silver's BPMN Method and Style goes beyond notation and offers a Methodology of process, notation, and best practices.