GRASS 6.4.0RC5, clean it up, give more info

g.remove and g.rename

r.what and r.info

Merging or combining rasters in GRASS 6.4.0RC5

It is possible to combine multiple raster files in one. It is useful for making masks. In short, we need to set the boundaries of working geographic region and then patch all maps together. Step by step:

Part I - g.region
1)Let`s set geographic region with g.region in command line and Run (GUI).
2)Choose maps which will define working region and only. Don`t choose anything else right now.
3)Run it.

Part II - r.patch
1)Launch r.patch in command line, run with GUI it.
2)Choose raster maps (input)
3)Give name for resultant raster map (output)
4)Run it.

Now you`ve got a new map in raster map list

GRASS 6.4.0RC5 and raster input

When the project and mapset region is created, it is easy to import raster and vector data, even if they are not defined on GRASS specified coordinate system.

File->Import Raster Map->Multiple Formats Using Gdal
and woila - here it is - r.in.gdal (or v.in.gdal, if importing vectors).
Otherwise (faster, by the way) importing raster using command line the same command - r.in.gdal and run in GUI.
If the raster (or vector) data has no specified coordinate system, you can
1) set it using ogr2ogr or
2) ignore this fact, and check Override projection (use location`s projection) under the Options tab.


six million problem...

repetition est mater studiorum.

In Latvia we have historical problems with coordinate systems. Some times we need to work in one of them, some times in other.

This ir how to set coordinate systems from one to another

I have shp file in LKS coordinates. I need to make false north 60000000.

1)Let`s set the coordinate system in file we`re working to.

ogr2ogr -a_srs EPSG:3059 /media/kratuve/gis_latvija/ARC_hydro/auce/lauks_LKS.shp /media/kratuve/gis_latvija/ARC_hydro/auce/lauks.shp

2)Let`s transfer coordinate system to WGS CoordSys.

ogr2ogr -t_srs EPSG:2100 /media/kratuve/gis_latvija/ARC_hydro/auce/lauks_WGS.shp /media/kratuve/gis_latvija/ARC_hydro/auce/lauks_LKS.shp

For raster data we can use gdalwarp instead of ogr2ogr

Interesting artefacts about ogr2ogr and gdalwarp.
Using previous example with vector data (ogr2ogr), the data transformed correctly. But when I used the same parameters in gdalwarp, the data were transformed to the north, but they were incorrectly transformed. I tried hardcoded transformation.

1)First by setting known coordinate system for file
gdalwarp -s_srs "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.99960
0 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" /media/kratuve/gis_latvija/ARC_hydro/auce/"$inputFileName".tif /media/kratuve/gis_latvija/ARC_hydro/auce/"$outputFileName"_CH.tif

2)Second transform the coordinate system by adding (or in this case subtracting, because in previous step false northing [y0] is -6M) 60000000
gdalwarp -t_srs "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.99960
0 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" /media/kratuve/gis_latvija/ARC_hydro/auce/"$outputFileName"_CH.tif /media/kratuve/gis_latvija/ARC_hydro/auce/"$outputFileName"_TR.tif

and it worked fine for me.


Additional info - bash script sample


Reinstalled Ubuntu three times

Installed Debian..

Problems with fTools, as I mentioned before, on Ubuntu Karmic with QGIS 1.4.0 were "solved" (as I`m not very trustworthy to freeware)

Firstly I followed these instructions, installing and compiling ECW, MrSID, GDAL and GRASS seperately from QGIS, but still while making fTools "Dissolve", QGIS crashed. 

Launching QGIS, on terminal I got an error

*** glibc detected *** qgis: double free or corruption (fasttop): 0x00007ff38002b9a0 ***

and I found out, that this glibc error is solved by typing

export MALLOC_CHECK_=0

in console


dissolve causes crash

Started messing around with vector data and I found, that qgis is frequently crashing when using vector geoprocessing tools.

Unnecessary problems are not wanted.

I found out that problems might be in python and SIP bindings. So it seems, that i should upgrade SIP and PyQt4 and then recompyle QGIS from source...
that`s sux. truly sux.

Ubuntu & VPN

Gotta problems trying to launch VPN in Karmic. Under Network Connections I was unable to add VPN connection. All I needed were
sudo apt-get install network-manager-pptp /
network-manager-vpnc network-manager-openvpn
and after that restarting network modules using
sudo /etc/init.d/networking restart
restart network-manager

I`m wondering, why these packages aren`t included in Karmic by default?

QGIS, basic GIS software and Karmic (Ubuntu 9.10)

I started installing QGIS based on written instructions here. But I`ve got some error-
package qgis is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source. E: Package qgi has no installation cadidate.
Messing around in google i found the way, how to correctly install qgis on Karmic.
Copied from ubuntugeek.com

First you need to open the terminal and run the following command

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable/

Update the source list

sudo apt-get update

Install qgis using the following command

sudo apt-get install qgis

Following the perrygeo.net instructions I tried to install other software, like GRASS and its plugins, mapserver-bin, gdal-bin, python-qt4, python-sip4, but I got message in terminal that these packages are already installed (assuming they`re installed together with QGIS).
Of course. perrygeo.net article is written 3 years ago... no more wonderings.

But still i was able to install python-gdal, cgi-mapserver, python-mapscript, gmt (which includes gmt-coastline-data), r-recommended, gpsbabel,
But still (x2), I bet, it is very good place where to start. For true newbies, like me.


long time no see.

I`m involved in some new projects dealing with groundwaters, GIS and modelling. I`ll try to give some updates here how the things are going, problems and possible solutions.
Groundwater. Freeware. Modelling. Nice pictures.
These are keywords or my work. I started with all of them together reading materials and finding out what kinda free software I can use.
The OS and software I`m on right now -
OS = Linux Ubuntu 9.10 (Karmic Koala).
Software. I`ll focus mainly on QuantumGIS, GRASS and R, following discussions with collegues in Uni. But for each of them there will be a seperate story and discussions.
Here we go.