Rounding of floating numbers in GRASS GIS r.mapcalc

The GRASS GIS development team keeps on introducing new features and enhancements to GRASS 7.0. One of the latest examples is the enhancement of the round() function in r.mapcalc. Previously this function would always returns an integer, regardless of its argument types. And because integers are always 32-bit, the result was limited to the range ± 2147483647 (2^31-1).

These limitations have been removed in the latest update of grass 7.0 (trunk r56313). Now the output type of round() is the same as the input type. Rounding to a given number of decimal places is supported with round(x, y) where y = number of decimal places.

In addition, the new function round(x, y) supports a negative number of decimal places: for example, round(119, -1) results in 120, and round(119, -2) results in 100.
Again great work by the GRASS development team!

example

Rounding a double precision raster layers (twi_900mm) to two decimals places (test).

Posted in GIS, GRASS GIS | Tagged , , | Leave a comment

Building QGIS on Ubuntu 13.04

Always one of those dreaded moments after updating Ubuntu, to 13.04 this time. Will QGIS compile properly. Not as it turned out, but the solutions were easy and quick, thanks to posts on nyalldawson.net and boringnerdystuff.

Ubuntu 13.04 defaults to Qt 5. You could solve this by changing back to Qt4, but as one pointed out in the comments on Nyall Dawson’s post, making system-wide changes to compile a single piece of software might be a bit of an overkill. Instead, what worked for me was to change in the configure options:

from: -DQMAKE_EXECUTABLE=/usr/bin/qmake
to:   -DQMAKE_EXECUTABLE=/usr/bin/qmake-qt4

You may also need to set -DQT_INCLUDE_DIR=/usr/include/qt4 as suggested in the above-mentioned comment. In my case it was already set, so I didn’t need to change it.

The next error was that libpython2.7.so was not found in /usr/lib. Following Nyal Dawson’s suggestion, I found it in /usr/lib/x86_64-linux-gnu/.

Creating a softlink did the trick: ln -sf /usr/lib/x86_64-linux-gnu/libpython2.7.so /usr/lib/libpython2.7.so sudo ldconfig
sudo ldconfig

Update from Nyal Dawson: change the PYTHON_LIBRARY option:

from: /usr/lib/libpython2.7.so
to:   /usr/lib/x86_64-linux-gnu/libpython2.7.so

And now QGIS is up and running again :-) , thanks to the above-mentioned two posts.

Posted in GIS, QGIS | Tagged , , | 4 Comments

Zotero 4.0 is out

My reference manager of choice, Zotero, just released an update, Zotero 4.0, with loads of new functionality. For the highlights, see here.

Posted in Software release, tools | Tagged , | Leave a comment

What if Google decides to discontinue Google Scholar?

Since Google discontinued Google reader I have always been wondering; what if they decide to stop with Google Scholar? If you are lucky enough to have access to an university library, you should be fine. But there are also a number of freely available alternatives. Just checking my bookmarks gave me gave me the list below. None of these tools have been able to convince me to abandon Google Scholar (to be completely fair, I haven’t tried them all out extensively), but at least if Google decides to kill of Scholar, I have somewhere else to go: Continue reading

Posted in Data sources, Open access, research tools | Tagged , , , | Leave a comment

GRASS gis scripts to import data from Worldclim, CSFR and PISM

I just came across these GRASS GIS scripts by Julien Seguinot to import multiple files from the WorldClim current climate dataset, the  Climate Forecast System Reanalysis (CSFR) data and some other reanalysis data sets. Furthermore, there is a script (r.in.pism) to imports multiple raster maps from a NetCDF output file from PISM.

They are not in the GRASS addon 6 or GRASS addon 7 repositories so I am sharing the link here. If you are planning to work with these data sets, check out these scripts, they may make your life a whole lot easier.

Posted in GIS, GRASS GIS | Tagged , , , , , | 1 Comment

Some cool new features in the upcoming QGIS 2.0

The upcoming QGIS 2.0 will have some really cool and useful new features. Check for example out the latest blog posts by Anita Graser aka Underdark, where she takes you on a tour of all the new features of the all new print composer. There are six posts highlighting the following new features: guidelines, multi-column legends, overview maps, html labels, map grids and rules and guidelines.

At nyalldawson.net you can read more about the upcoming ‘blend modes for layers‘. These effects, previously only found in photo/image editors like GIMP or photoshop, will allow you to blend layers together using various effects. Another feature you would normally expect in GIMP or the like is colour control for raster layers. This allows you to tweak the saturation, hue, grey scale, etc.

There is a lot more coming, but these changes alone are really impressive!

 

Posted in GIS, QGIS, Software release | Tagged , , , , | 6 Comments

A plugin to export layers in GIMP file to single pdf file

A while back I wrote about two possible ways to export multiple layers in GIMP to one pdf file using third-party tools. But it turns out there is an much easier solution as Nevar pointed out in the comments on that blog post. The ‘Export Layers as PDF’ plugin for GIMP. You can get the plugin from the Gimp plugin registry. See here for instructions how to install the plugin.
After installing you need to restart GIMP after which you can find the new function in the file menu (see screenshot). Continue reading

Posted in tools | Tagged , , , | 1 Comment

Update of the r.forestfrag addon for GRASS GIS

Some time ago I came across this post from Sylla Consult about a script to calculate forest fragmentation index suggested by Riitters et al. (2000). Obviously, it can be used for any land cover type, so perhaps landscape fragmentation index would be a better name. Anyway, the script r.forestfrag.sh is available from the GRASS-addons page.

Unfortunately, it only worked with GRASS 6.4. Because I mostly work in GRASS 7.0 I adapted the script to make it work on GRASS 7.0.  I also added some additional options and changes: Continue reading

Aside | Posted on by | Tagged , , , | 7 Comments

Presentation of map query result improved in GRASS 7.0

GRASS GIS (version 6.4, and up to recently 7.0 too) would present map query results in the command console. I have never really got used to it though. Often when I needed to query some points on the map, I ended up shifting back and forth between the ‘Map layer’ and ‘command console’ tabs. In addition, it didn’t present the map data in a clear way, especially not when querying more then one layer at once.

So after I updated my GRASS 7.0 this morning, I was happily surprised to see that the developers have created a whole new way to present map query results. Continue reading

Posted in GIS, GRASS GIS | Tagged , | Leave a comment

Sharing or exporting sub-sections of a ZIM notebook

I use ZIM desktop wiki to keep all kind of notes. Sometimes I want to share my notes. This is easy enough when I want to share the whole notebook. I simply send the whole folder containing the ZIM notebook (zipped or not) to my collaborator.

But what if you want to share only a section of the notebook? On a similar note, what if I want to export part of my notebook as html files? Continue reading

Posted in tools | Tagged , , , | Leave a comment