Re: [GRASS-user] Error running g.mapset

2010-10-16 Thread Glynn Clements

Markus Neteler wrote:

  I'm running WinGRASS and I'm obtaining a weird error when I run g.mapset:
  ERROR: Unable to read GIS_LOCK environment variable
 
  How can I fix this in Win GRASS?
 
 I have seen
 
 
 
 Author: glynn
 Date: 2010-10-14 02:51:09 -0700 (Thu, 14 Oct 2010)
 New Revision: 43906
 
 Modified:
   grass/trunk/general/g.mapset/main.c
 Log:
 Don't set option defaults from current state (results in incorrect
 documentation).
 
 
 but I don't know if this is related nor if this should be backported.

It's not related.

The underlying bug (init.bat doesn't set GIS_LOCK) is still present in
6.5-svn. It isn't applicable to 7.0, where init.sh/init.bat have been
replaced by a Python script (which does set GIS_LOCK).

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error running g.mapset

2010-10-16 Thread Markus Neteler
On Sat, Oct 16, 2010 at 8:26 AM, Glynn Clements
gl...@gclements.plus.com wrote:
 Markus Neteler wrote:
 katrin eggert wrote:
 I'm running WinGRASS and I'm obtaining a weird error when I run g.mapset:
 ERROR: Unable to read GIS_LOCK environment variable

 How can I fix this in Win GRASS?

...
 The underlying bug (init.bat doesn't set GIS_LOCK) is still present in
 6.5-svn. It isn't applicable to 7.0, where init.sh/init.bat have been
 replaced by a Python script (which does set GIS_LOCK).

I have found this GPL program to the the PID which is needed
to set GIS_LOCK:
http://www.scheibli.com/projects/getpids/

Would that be of interest? Or is %RANDOM% together with something
else sufficient?

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error running g.mapset

2010-10-16 Thread Glynn Clements

Markus Neteler wrote:

  The underlying bug (init.bat doesn't set GIS_LOCK) is still present in
  6.5-svn. It isn't applicable to 7.0, where init.sh/init.bat have been
  replaced by a Python script (which does set GIS_LOCK).
 
 I have found this GPL program to the the PID which is needed
 to set GIS_LOCK:
 http://www.scheibli.com/projects/getpids/
 
 Would that be of interest? Or is %RANDOM% together with something
 else sufficient?

AFAICT, GIS_LOCK needs to be set to an integer, but the actual value
is irrelevant on Windows.

g.mapset reads GIS_LOCK, passes it to $GISBASE/etc/lock, and checks
that etc/lock returns a zero exit code.

On Windows, etc/lock does nothing:

int main(int argc, char *argv[])
{
...
if (argc != 3 || sscanf(argv[2], %d, lockpid) != 1)
G_fatal_error(usage: %s file pid, argv[0]);
...
#ifdef __MINGW32__
G_warning(Concurrent mapset locking is not supported on Windows);
exit(0);
#else

If GIS_LOCK isn't set, g.mapset will complain. If it doesn't parse
with %d, etc/lock will complain. Other than that, it shouldn't
matter.

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Grass Script- Implementing a Quadratic Mahalanobis Distance

2010-10-16 Thread Daniel Victoria
R has a command to calculate the Mahalanobis distance [1], so I
believe it's just a matter of getting the grass data into R in the
correct way and using the already R built in tools in R.
Unfortunately, this is as far as I can help, not being an expert in R
myself

Cheers
Daniel

[1] - http://stat.ethz.ch/R-manual/R-devel/library/stats/html/mahalanobis.html



On Fri, Oct 15, 2010 at 8:45 AM, Nikos Alexandris
nikos.alexand...@felis.uni-freiburg.de wrote:
 (
 Pedro, I kindly ask you to keep the discussion on the list - it's very
 interesting (to me at least) and of wider interest (I guess) as a small
 challenge for grass. I am sure others can help here.

 Also, accept my apologies for re-structuring the mail to make it easy to
 follow for other readers.
 )

 Pedro wrote:

   I need to implement a Quadratic Mahaloanobis Distance by using GRASS.
   This is based on medium vector and covariance matrix.

   1- As anyone implemented anything similar?
   2- If not, Is there any GRASS script that accesses medium vector and
   Covariance matrix in its processing?

 Nikos:

  Not sure at all but my guess is that it's a (simple) job for grass if you
  know the formula. I am not familiar with the term medium vector. But
  there is r.covar to get the covariance (or correlation) matrix based on
  raster maps.

 Pedro:

 Medium vector is a vector/array in which each element is the average of
 that class in each image
 [average in image1; average in image2, ...]

 The problem of implemeting this in a script is that it required matrix
 calculation. I mean, for each pixel in a class, I will have to multiplicate
 byt the covariance matriz and this vector.

 I don't have a quick answer on how to do it within grass using r.mapcalc. But
 I am convinced that using grass + R is a solution. Also, is the following
 matlab (open source?) code of any use?

 http://www.hackchina.com/en/r/129852/mahalanobis.m__html

 I've read on the net efforts trying to link R and matlab. If the latter is
 practically doable, then you can even avoid writing the code (again). So, I
 imagine something like:

  1. import data in grass and prepare/process etc.
  2. load data of interest in R
  3. calculate the (qudratic) mahalanobis distances of interest (within R with
 R code/ with matlab code ?)
  4. export results (or even maps) in grass back again

 Cheers, Nikos
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Grass Script- Implementing a Quadratic Mahalanobis Distance

2010-10-16 Thread Nikos Alexandris
Daniel Victoria wrote:

 R has a command to calculate the Mahalanobis distance [1], so I
 believe it's just a matter of getting the grass data into R in the
 correct way and using the already R built in tools in R.
 Unfortunately, this is as far as I can help, not being an expert in R
 myself

Sorry that I did not take the time to search better within R. So, it seems to 
be very easy then using the R function mahalanobis(). As Daniel notes, it's 
just a matter of correctly loading the data in R.

@Pedro: If you have difficulties to get started with R, check the wiki [2]. 
There are examples. Myself I calculated separability measures this way (grass 
raster samples - R - separability measures - exported as csv).

Cheers, Nikos

 [1] -
 http://stat.ethz.ch/R-manual/R-devel/library/stats/html/mahalanobis.html
[2] http://grass.osgeo.org/wiki/R_statistics
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] d.vect.thematic doesn't update properly

2010-10-16 Thread Nick Cahill
Dear GRASS list,

Using William Kyngesburye's 6.4 binaries on OSX, I'm having trouble with 
d.vect.thematic. I'm making a graduated points map of circles whose diameter is 
set by a column in the database. When I zoom or pan in the displayed map, it 
doesn't update. The other layers in the display follow the zoom and pan, only 
the thematic layer remains stuck and unchanged. Redrawing, erasing and 
redrawing, do nothing; sometimes I get two maps, the previous pan overlaid by a 
the current. Any ideas? Many thanks,

Nick Cahill

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user