Sunday, March 31, 2013

RSAGA: Getting Started

RSAGA provides access to geocomputation capabilities of SAGA GIS from within R environment. Having SAGA GIS installed is a (quite obvious) pre-requirement to use RSAGA. 

In Linux x64 sometimes additional preparations are needed. In Linux SAGA as well as other software that would like to use SAGA modules usually searches for  them in /usr/lib/saga, but if your Linux is x64, they usually will be located in /usr/lib64/saga. Of course you may set up proper environmental variables, but the most lazy and overall-effective way is just to add symbolic link to /usr/lib64/saga (or whatever a correct path is) from /usr/lib/saga:
:~> sudo ln -s /usr/lib64/saga /usr/lib/saga
Now no app should miss these modules.

Thursday, March 14, 2013

About Questions and Answers


That is very interesting how people perceive and assess questions and answers. How do we assess quality of the question? The first and the main criteria is whether topic-starter did his homework searching for the answer himself. That's why "Do your homework" is the first advise on "how to ask the question" page on every software forum (and there is one on gis.stackexchange). The second criteria is sufficiency of information provided by the topic-starter. No one likes to play clairvoyant and guess what is the actual situation (but with experience the ability to foresight omitted details is being developed) and waste their time asking for more information.

Saturday, March 9, 2013

GRUB2 Recovery

Encountered an unpleasant issue today. Suddenly without any reason GRUB2 at my dual boot laptop halted with the "GRUB" string on the black screen and refused to proceed any further. Seems that is a known issue for the openSUSE 12.2 (GRUB2 became a bootloader for this version).

GRUB recovery usually an easy procedure and I did it quite often having several machines with a windows as a spare OS (it has an annoying habit deleting GRUB during own installation). I just used openSUSE live USB to load, and in Yast in Bootloader settings asked to propose the configuration for GRUB and then just saved it to the /boot partition.

This time it didn't work at all... So I've spent all the day looking for solution. This two sources helped me a lot: Re-install Grub2 from DVD Rescue and openSUSE Help and Troubleshooting. Here you are the steps that helped me with my dualboot needs:
  1. Boot to Rescue System from the openSUSE installation DVD (login is root).
  2. Run fdisk -l to locate root partition (/dev/sda6 for me)
  3. Mount all that is needed (including partitions with other OSs so they will be scanned and included in GRUB configuration):
    • mount /dev/sda6 /mnt 
    • mount --bind /dev /mnt/dev 
    • chroot /mnt 
    • mount /proc 
    • mount /sys 
    • mount -a
  4. If the configuration file for GRUB is lost (like in my case):
    • grub2-mkconfig -o /boot/grub2/grub.cfg
  5. Write GRUB2 configuration to disc:
    • grub2-install /dev/sda
  6. Unmount and reboot:
    • umount -a
    • exit
    • reboot

Thursday, March 7, 2013

DSM to DEM Conversion

Often you may have some Digital Surface Model (DSM) acquired from a LiDAR data, and you may desire to get rid of buildings and trees in order to get a DEM. There can be found some articles on a subject that would provide more accurate result then that described here. But I will show here my quick-n-dirty way when one don't need extreme accuracy. It is meant to be used for a relatively flat urban areas.

There will be 3 steps:
  1. Subtraction of the elevated objects like buildings and trees from DSM.
  2. Filling the gaps of the raster cleaned of the elevated objects.
  3. Polishing the DEM.
FOSS software you will need: SAGA GIS, QGIS.

Initial DSM (LiDAR)

Monday, February 11, 2013

Signs of Scientific Respect

Today I received a copy of proceedings of the conference I participated in. A peculiar moment is that my article about using Random Forest algorithm for the illegal dumping sites forecast is the very first article of my section (as well as of the whole book) and it was placed regardless of the alphabetical order of the family names of the authors (this order is correct for all other authors in all sections).

My presentation and speech were remarkable indeed - the director of my scientific-research centre later called it "the speech of guru" (actually, not a "guru", there is just no suitable equivalent in English for the word used). Also the extended version of this article for one of the journals of the Russian Academy of Sciences received an extremely positive feedback from the reviewers. So I suppose the position of my article is truly some kind of respect for the research and presentation and not a random editorial mistake.

Now I should overcome procrastination and make a post (or most likely two) about this research of mine.


Friday, November 9, 2012

Utility for Polygon Width Calculation Is Updated

I fixed an issue of my utility for polygon width calculation in a given direction caused by redundant geometry created in certain circumstances.  'Fixed' - somewhat a too strong claim for a nasty about 100 lines long workaround-function, where I had to comment almost every line to trace what is going on (optimisation is left for the feature). Nevertheless full functionality of the utility is now available! Updated version is here.

Another note: check validity of your polygons geometries beforehand to obtain correct results.

Sunday, October 21, 2012

Fire Dynamics In Leningrad Region in 2006

Today I decided to play with TimeManager plugin for QGIS that was introduced by underdark some time ago. After some search across my spatial storage I found only one dataset that contained timestamps: FIRMS fire data that I used for creation of a methodology for burn-out probability calculation (for illegal dumping environmental risk assessment) and for assessment of human influence on fire starting.


Seems that TimeManager is not quite stable after the certain number of features in layer. At least on my machine it crushed several times (during slider manipulation) on the whole dataset of about 7000 points but worked just fine with its one-year subset of about 2700 points. But anyway overall impression is very good.

The main issue was to create a video from the generated .png files. I used console ffmpeg utils. Simple command:
:~>  ffmpeg -r 1/1 -i frame%03d.PNG -vcodec yuv420p -video_size 1126x560 output.flv
produced a 3-minute video above. One second corresponds to 1 day of the most  flammable year for the Leninngrad region in a decade. Video covers period from April to November 2006. I was too lazy to create custom undercover and just loaded OSM via OpenLayers plugin)))