Tuesday, January 26, 2010

Netcdf in JGrass, the non spatial part

JGrass at some point got integrated with the geotools library to read netcdf files both for visualization and for analysis purposes. The geotools library is a spatial library and therefore it gives the possibility to extract multi-time and multi-depth rastermaps from local file or remote opendap. We have seen that and it looks like this:



Well, very soon we will have also a way to view the other datasets contained in a netcdf.

The rightclick now brings up a new menu Open Netcdf Viewer on this dataset:



which opens the Netcdf Viewer. The viewer has on its left a list of all the variables contained in the netcdf and that are non raster maps (grids). The variables are marked as:

  • G: global attributes
  • 0: 0 dimensional variables (scalars)
  • 1: 1 dimensional variables
  • 2: 2 dimensional variables
  • 3: 3 dimensional variables
The below shows a global attribute selected. The right panel will show informations about the selected variable.



In the case of 0D variables, the variable definition is dumped.




In the case of 1D variables, it is already possible to chart the variable against its dimension (axis).




In the case of 2D variables, again, the content can be charted. In the case the X axis contains time values, the proper time label is computed (those who know netcdf know what that means).




It is possible to zoom into the charts and check the values.




The viewer currently supports up to 3 dimensions. In the upper combo boxes it is possible to switch the axes in the case of 2 or 3 dimensions available.




There is also a filter box available for easier browsing of many variables.




Enjoy.

Saturday, January 23, 2010

sld for rasters in a netcdf?

From today on uDig loads sld files also for raster data. This is great and a couple of posts ago I also described the style editor that can be used to create nice raster maps.

I am currently working on netcdf data, which have a cool structure that allowes to have several rasters inside a file. What can be done in that case?
Well the sld structure can contain several styles, so it is quite easy to create a style for every resource.

For example the following sld file:




<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
<sld:UserLayer>
<sld:LayerFeatureConstraints>
<sld:FeatureTypeConstraint/>
</sld:LayerFeatureConstraints>
<sld:UserStyle>
<sld:Name>aspect</sld:Name>
<sld:Title/>
<sld:FeatureTypeStyle>
<sld:Name>aspect</sld:Name>
<sld:FeatureTypeName>Feature</sld:FeatureTypeName>
<sld:SemanticTypeIdentifier>SemanticType[ANY]</sld:SemanticTypeIdentifier>
<sld:Rule>
<sld:RasterSymbolizer>
<sld:Geometry>
<ogc:PropertyName>raster</ogc:PropertyName>
</sld:Geometry>
<sld:Opacity>
<ogc:Literal>1.0</ogc:Literal>
</sld:Opacity>
<sld:OverlapBehavior>
<sld:RANDOM/>
</sld:OverlapBehavior>
<sld:ColorMap type="ramp">
<sld:ColorMapEntry color="#000000" opacity="1.0" quantity="0.0"/>
<sld:ColorMapEntry color="#FFFFFF" opacity="1.0" quantity="180.0"/>
<sld:ColorMapEntry color="#FFFFFF" opacity="1.0" quantity="180.0"/>
<sld:ColorMapEntry color="#000000" opacity="1.0" quantity="360.0"/>
</sld:ColorMap>
<sld:ContrastEnhancement/>
<sld:ShadedRelief>
<sld:BrightnessOnly>false</sld:BrightnessOnly>
<sld:ReliefFactor>55</sld:ReliefFactor>
</sld:ShadedRelief>
</sld:RasterSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
<sld:UserStyle>
<sld:Name>surface_altitude</sld:Name>
<sld:Title/>
<sld:FeatureTypeStyle>
<sld:Name>name</sld:Name>
<sld:FeatureTypeName>Feature</sld:FeatureTypeName>
<sld:SemanticTypeIdentifier>SemanticType[ANY]</sld:SemanticTypeIdentifier>
<sld:Rule>
<sld:RasterSymbolizer>
<sld:Geometry>
<ogc:PropertyName>raster</ogc:PropertyName>
</sld:Geometry>
<sld:Opacity>
<ogc:Literal>1.0</ogc:Literal>
</sld:Opacity>
<sld:OverlapBehavior>
<sld:RANDOM/>
</sld:OverlapBehavior>
<sld:ColorMap type="ramp">
<sld:ColorMapEntry color="#00BFBF" opacity="1.0" quantity="2012.86"/>
<sld:ColorMapEntry color="#00FF00" opacity="1.0" quantity="2096.901999816894"/>
<sld:ColorMapEntry color="#00FF00" opacity="1.0" quantity="2096.901999816894"/>
<sld:ColorMapEntry color="#FFFF00" opacity="1.0" quantity="2180.9439996337887"/>
<sld:ColorMapEntry color="#FFFF00" opacity="1.0" quantity="2180.9439996337887"/>
<sld:ColorMapEntry color="#FF7F00" opacity="1.0" quantity="2264.986007080078"/>
<sld:ColorMapEntry color="#FF7F00" opacity="1.0" quantity="2264.986007080078"/>
<sld:ColorMapEntry color="#BF7F3F" opacity="1.0" quantity="2349.027999267578"/>
<sld:ColorMapEntry color="#BF7F3F" opacity="1.0" quantity="2349.027999267578"/>
<sld:ColorMapEntry color="#141514" opacity="1.0" quantity="2433.069991455078"/>
</sld:ColorMap>
<sld:ContrastEnhancement/>
<sld:ShadedRelief>
<sld:BrightnessOnly>false</sld:BrightnessOnly>
</sld:ShadedRelief>
</sld:RasterSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
<sld:UserStyle>
<sld:Name>d8scheme_drainage_directions</sld:Name>
<sld:Title/>
<sld:FeatureTypeStyle>
<sld:Name>name</sld:Name>
<sld:FeatureTypeName>Feature</sld:FeatureTypeName>
<sld:SemanticTypeIdentifier>SemanticType[ANY]</sld:SemanticTypeIdentifier>
<sld:Rule>
<sld:RasterSymbolizer>
<sld:Geometry>
<ogc:PropertyName>raster</ogc:PropertyName>
</sld:Geometry>
<sld:Opacity>
<ogc:Literal>1.0</ogc:Literal>
</sld:Opacity>
<sld:OverlapBehavior>
<sld:RANDOM/>
</sld:OverlapBehavior>
<sld:ColorMap type="ramp">
<sld:ColorMapEntry color="#FFFF00" opacity="1.0" quantity="1.0"/>
<sld:ColorMapEntry color="#FFFF00" opacity="1.0" quantity="1.0"/>
<sld:ColorMapEntry color="#00FF00" opacity="1.0" quantity="2.0"/>
<sld:ColorMapEntry color="#00FF00" opacity="1.0" quantity="2.0"/>
<sld:ColorMapEntry color="#00FFFF" opacity="1.0" quantity="3.0"/>
<sld:ColorMapEntry color="#00FFFF" opacity="1.0" quantity="3.0"/>
<sld:ColorMapEntry color="#FF00FF" opacity="1.0" quantity="4.0"/>
<sld:ColorMapEntry color="#FF00FF" opacity="1.0" quantity="4.0"/>
<sld:ColorMapEntry color="#0000FF" opacity="1.0" quantity="5.0"/>
<sld:ColorMapEntry color="#0000FF" opacity="1.0" quantity="5.0"/>
<sld:ColorMapEntry color="#A020F0" opacity="1.0" quantity="6.0"/>
<sld:ColorMapEntry color="#A020F0" opacity="1.0" quantity="6.0"/>
<sld:ColorMapEntry color="#FFA500" opacity="1.0" quantity="7.0"/>
<sld:ColorMapEntry color="#FFA500" opacity="1.0" quantity="7.0"/>
<sld:ColorMapEntry color="#1E90FF" opacity="1.0" quantity="8.0"/>
<sld:ColorMapEntry color="#1E90FF" opacity="1.0" quantity="8.0"/>
<sld:ColorMapEntry color="#FF0000" opacity="1.0" quantity="10.0"/>
<sld:ColorMapEntry color="#FF0000" opacity="1.0" quantity="10.0"/>
</sld:ColorMap>
<sld:ContrastEnhancement/>
<sld:ShadedRelief>
<sld:BrightnessOnly>false</sld:BrightnessOnly>
<sld:ReliefFactor>55</sld:ReliefFactor>
</sld:ShadedRelief>
</sld:RasterSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:UserLayer>
</sld:StyledLayerDescriptor>



gives me the possibility to load from sld file automatically the styles for the layers aspect, d8scheme_drainage_direction and surface_altitude.



The not so friendly thing is that for now to have multiple styles inside the sld file, you have to paste them from the raster style editor. But once done you are fine.

Wednesday, January 20, 2010

maven-ant-task and the misleading errors

Today I ran the refresh.xml from the udig libs plugin again to get back in sync with the current development. And I got an error about some ant task that can't be executed... ugh, it is not the first time.... wont be the last. Since my mind does not want to remember and this fools me every time, this time I document it. :)

What happens is that to execute ant tasks, the maven-ant-tasks package is used, which the uDig community holds inside the code trunk in:
trunk/extras/org.apache.maven-ant-tasks/lib

So we are usually fine, the only thing is that from time to time, the jar: maven-ant-tasks-2.1.0.jar, currently at version 2.1.0 is updated and eclipse doesn't know were to find it any more.

Well, here is how to set it: preferences-> ant -> runtime


simply check that your path is set to a jar that really exists. If not, remove and add the existing jar (add external jar).

Thursday, December 24, 2009

Getting smarter... the Xmas query tool

The transition to use coverages at internal level in JGrass, to be more compatible with geotools slowly proves that the hard work done (and ongoing) is worth the price.

One example for this is what was known as the Raster Query Tool which was used to query grass raster layers, as shown in this picture:



Well, we now decided to make it a bit smarter, such that it would understand the underlying raster layer.

The Smart query tool can now be found here:



The following image shows a query done on a tiff layer:



But what makes me really happy is the way it is able to query layers that depend on time and depth, as for example a netcdf layer. The result look like this:



What happens is that the values are shown along the Y axis, while time and depth along the X axis. Well, in the case in which the dataset depends on both, time is shown along the X axis and a chart is created for every depth available. The charts can also be switched on and off for better understanding.

To be even smarter, we enabled the tool to work also on feature layers, by showing the attributes and some additional informations depending on the geometry type (such as number of nodes, centroid, area, etc):




What happens if several layers are selected? Depends on the layer types, anyways, the case of feature and coverage ones is not handled really well, it shows popups in a pile. For sure you get the info you wanted, you just have to browse it :)


So happy Christmas to everyone and a great great new JGrass year!!!!!!

Tuesday, December 8, 2009

Arcmap dbf import to BeeGIS

Recently we did a 3 days uDig-JGrass-BeeGIS course for some very nice guys. When they saw BeeGIS, they were very intereted and one question that came to the surface by one guy owning a handheld with arcmap, was if it would be possible to import the arcpad file into the database of BeeGIS, in order to exploit it to synchronise pictures on the map.

Well, since they really where that nice, we created a small import tool for BeeGIS.
You should know that from arcpad you can export a point shapefile, which has a big attribute table with all the infos in it.
The below is an example:



To use it just follow the steps:

1) Go to File -> import and select "Import Arcpad..."



2) In the following tab insert the path to the dbf file exported from Arcpad




After pushing finish the dbf is imported into the database's internal gps log, which is also use for the photo sync.

In fact if we have a look into the database view, we can see that the imported data are there:




Guess that will make it into the next build.

Saturday, December 5, 2009

EPL-GPL: Open letter to the FSFEurope

Since I have enough of not knowing exactly how to deal with the
EPL-GPL problem, I am going to write to the FSFEurope for
clarification.

The letter I will send is placed here:
http://jgrass.wiki.software.bz.it/jgrass/Open_letter_to_the_fSFEurope

It will for sure change during the next days, but I plan to send it by
mid of next week.

Constructive comment are welcome!

New BeeGIS version available

It has taken a real long while, but finally a new BeeGIS version is out. It has a lot of enhancements and fixes that would take me too long to explain. One real important thing is that now we have a manual. Also now BeeGIS has not JGrass dependencies and as such can be installed into uDig directly.

For installation instructions have a look here.

You can download the manual here.