Showing posts with label sld. Show all posts
Showing posts with label sld. Show all posts

Thursday, August 20, 2020

SMASH 1.4.0 is out: SLD and GPS Log enhancements

Today we released SMASH 1.4.0 to the Apple and Google stores.

This release brings some bugfixes and two main features.

1) SLD support

When it comes to styling data many have expressed their hate towards the OGC standard SLD. Coming from the uDig/Geotools world, where SLD has always been used, I find it quite nice to use. Well,  I use it for very simple styling, so that might be the reason behind it. Well, it seemed to be the perfect format. There are several editors and GIS that support SLD, so people will be able to create their styles for the survey. And now SMASH is one of them, even if it right now supports a subset of SLD features.

Lets' have a look. Assume to be in the region of the Resia Lake in northern Italy:

Now let's play around with some geopackage data: lake polygons, river lines and geoname points.

Sliding the polygon layer to the right allows to enter the style properties:

It is rather intuitive what needs to be done to have a lake styled. But remember to save using the floating action bottom at the bottom. This will write the style to the database table.

Et voila'. The same goes for lines:

and points. Points are the only layer types that allow labeling at the moment.

These have been very very simple styles. For those that talk SLD, these examples only had a FeatureTypeStyle and one Rule. 

SMASH supports one type of theming: by unique values. In this case a FeatureTypeStyle is populated with several rules that obey to a filter that supports matching of unique values from the attributes table.

The properties page has buttons to change rules and modify them. The following is an example that features 2 FeatureTypeStyles, one with just a Rule containing a textsymbolizer:

 
and a second one with all the Rules with filter:
 

If only one FeatureTypeStyle or Rule are present, the header titles can vary:

The result then looks like:

We decided to give also GPX files these kind of powers. If you change the style properties of a GPX layer, an SLD sidecar file is created and ensures style persistence. 

Style can be defined for lines and points. If waypoints have the name tag, it can be used for labeling.


 2) GPS log enhancements

The log stats have been extended and now contain time, length, up and down delta (mind this is GPS elevation, so it is usually bad), number of points contained in the log.

In the previous version of SMASH a Kalman filter had been added to filter GPS logs and both log types are kept in the database. It is now possible to decide to use the filtered logs in certain sections of SMASH as for example in the logs list. Just enter the GPS settings and enable the option:

If you head back to the logs list, the stats length value might be changed:

In this case the difference is around 8Km. This is due to the fact that in tunnels the GPS often goes crazy and jumps around, generating additional distance to the log. The filtered version is more realistic. But you can choose based on your usecase.


From the log list a new tool is available when sliding to the right: the Profile View

The profile view allows to analyze the profile and navigate it:

Thanks for the OwnWeb guys for this nice plugin.


Well, that is it for SMASH 1.4.0. Enjoy!





Friday, August 12, 2011

Small enhancement in single band raster styling




We already had tools to style single banded raster, i.e. color ramps on elevation models and similar things.
What was missing was a nice handling of novalues and other values we would not care. Take for example the following map:



This is how an ascii grid is loaded into udig...

Well, we can ask to read the values to propose a colortable through "reset colormap". But that would consider -9999 novalues. Therefore we added the possibility to define other novalues to ignore in the process. Applying that colortable will produce:



Where is the problem? The 0. The map was probably transformed and the altered collar part has been set to 0. We can try to add to the novalues list also the 0 and reset once more:



That is about it, nice, so we now apply one of the predefined colortables, to better look like a DTM:



Well, to really get rid of the 0 novalues, we need to create rules to "hide" those part, else they will not appear transparent and overlay on other layers.
We now added a button that will take the manually defined novalues and create transparent rules for them:



That is what we wanted to have. Just remember to export the style to have the same name as your raster map and the extension .sld, and you are good to go.

Also note that now we have select all/none and invert selection for rules, which get very handy when you need to move rules up and down.








Friday, November 12, 2010

uDig styles and filters - human readable... the fun is on!!!

You might remember my post about udig and filters, where I stated that filters were given in xml form. Well, thanks to a good comment of Andrea Aime, I tried a simple tweak and now we have filters in a simple and easy human readable form, supporting the amazing power of geotools' filter mechanics.
Thank God those guys exist :)

An example?

I have a map with rivers in it:



Now I want to create a rule that only displays those rivers that are longer than 2000 meters. The CQL function length comes to help me. Insert it into the filter textbox, press the apply button and here we go:



It is easy now to add in another rule and color those that are shorter than 2000 meters:



Nice ha? coming in your next uDig release :)


PS: some examples from the geotools site.

Monday, November 1, 2010

uDig styles and filters

When it comes to filters in SLD it gets really hairy. Filters can be really everything, from an constant value to a complex nested operation on properties. It is one of those things with superpowers but also scary when it comes to the moment to create a gui for it.

So what we decided to do for now, is to expose the pieces of xml that represents the filter part in a rule. Sure it is only for the brave, but even if you do not edit it, you can at least get some useful info out of it.

Let's for example start with a themed style with only two classes:



if you go to the simple polygon style panel now, you will find a new tab, which states Filter. Inside that you now find the current filter definistion (if one is in).



In this case it gets how the themed styles work, right? As highlighted in the following screenshot, the filter states that the first rule is applied if:
* the property POP_CNTRY >= 0
* AND
* the property POP_CNTRY < 50000

That is how themed style works. A set of rules is created with filters in a row.



You may have noticed that some countries have disappeared in the previous image. That is because in the previous image I changed the upper limit of the first rule to 50000, while it was different in the first screenshots.

So you really can modify the filter as you which. You have then to make sure you push the Apply Filter button. At that point the filter will replace the previous filter in the style.

Just to give you one more example of what you can do, here is how normalization works. Imagine you want to style the population attribute, but normalized on the area, so that it gives a better idea of population density. That is how to change the filter for it:



What you are saying now is that the first rule is applied if:
* the property POP_CNTRY divided by the property SQKM is >= 0
* AND
* the property POP_CNTRY divided by the property SQKM is < 58.513

One last hint though. Don't do this by hand, in uDig for doing normalization we have a button on the themed style page :)

Friday, August 20, 2010

Labels and Raster color masks

A quick update on the style editors for uDig for those who care.
The labels part and a raster color mask is now there for testing.

1) Example about lines labels

Now all the feature style panels have a labels panel added:



from there you can do several stuff, I will just show the labelling of lines here.

More or less I tried to support everything that gepotools does (some of it is taken from the sld cookbook of the geoserver community).

So the result would be:



2) Another thing that has been missing for a while in uDig is the possibility to create an alpha mask based on a color for imagery.

If for example I have a tecnical map:



which I would love to see in overlay with an ortophoto, I now can go into the style options and set a color to alpha:



Which then would lead to have the wanted overlay:




Sadly this last is not something that is supported in the SLD specs (so they tell me), so it can't be persisted in a sld file. However it might be added to geotools as a vendor option. That would be awesome. For now, I'll enjoy it in uDig...

Friday, August 13, 2010

Lines Styles and staring over again

Well, it sometimes happens that you are almost there and you should just add those 2% and you find that little something that you think you will need or you should put in there. And even if your schedule tells you to leave it out, you can't sleep at night, awake staring at the white roof of your room.

Well, this is what happened to me, since I wanted to make the uDig style editor from the merging of SLD into the QGIS gui design. So I decided, as you probably saw in my latest posts, that there had to be something called rules which would represent a style property for a certain geometry.

In SLD there are things called FeatureTypeStyle and Rule. And later I will show you also what they can infuence.

For now let's start with a simple road-map.



Which in the editor looks like:




You might note that the rules list if now a tree viewer. Whan looking at the tree viewer think of the following mapping:

root elements = groups = FeatureTypeStyle
children elements = rule = Rule

For some that might sound strange, but I know some will understand :)

Alright, let's add a second rule that has a line a bit thicker then the first, in order to give the feeling of a line with black border.




We now have a group with two rules, which will result in:




And exactly here lies the problem. Do you see the ugly overlapping of the roads?

If we instead do the same with two groups and one rule per group:



we gain the wanted result:



if we then also take care a bit of the caps and joins of the lines it looks even better:




To end the thing with some more fun, let's play with the dashing of the lines.

We first set the dash of the red line to 40.0, 40.0:



and let's also add some ticks to make it nicer:



And here we go:




Well, we have again the overlapping problem... so we try to split in more groups:




which is better, but we still have problems on the line ends:



Well, at the end I also did a try with graphics stroke, but that one is not yet well supported in the geotools 2.6 series, which is on what uDig 1.2 bases on:



They say geotools 2.7 has better support for graphics strokes, so that will be available in uDig 1.3.

Saturday, August 7, 2010

Themed Styles are back in time for 1.2 release

Those that were using the release candidates of uDig and were interested in style might have noticed that the themed style editor got quite buggy.

In the final rushes of the 1.2.0 release of uDig we fixed all of it (that we noticed) and also added a couple of enhancements.

First of all, icons were all black and didn't show the geometry type.
Now we see polygons being like this:



and points like this:



we also note differences between the point mark type:



One thing I was really finding blocking was the fact that only ColorBrewer colortables were supported. Well, I heard many people tell me that 12 classes of color would be enough, but then again I was asking myself why for example the standard colortable of the Corine Landcover has 45?

Well, everyone should be able to choose, so I did two things:

1) Add two dynamic colortables that adapt to the number of requested classes by colorinterpolation:



You might or might not know that the colorrules can be customized and the border color can be set.



Well, that makes Italy look a bit like the Girl in the red coat from Schnidler's List. Well, given the current political status...



2) It is now possible to add custom colortables to uDig. In my example I added the Corinne Landcover colortable:







Well, I have to add something that will come through the new style editor that is in progress :)

So let's for example start with the cities layer and create a theme with the population rank as unique value (which also was added right now).



Then let's jump into the new points panel, were we find the different rules of the theme as expected. In the General Properties of each rule we then set the size to be field based:



The result is a theme that also sets the size: