[GRASS-user] How to calculate SUM of an image

2011-10-03 Thread Kim Besson
Greetings
I have a raster map and I wan to calculate its sum. How can I do this in
GRASS?
Thanks
Kim
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: GRASS script to export raster

2011-03-09 Thread Kim Besson
Hi Glynn, Martin,  Hamish and rest of GRASS mailing list
Thanks for your feedback. Unfortunely, I was analyzing my problem in the
wrong way...
WHat I need is to:
- Export raster values in an ASCII file written from left to right and
bottom to top and each line only includes Raster value (not X neither Y).
Is this possible in GRASS with a Python Script?

Also I will need to import raster values written in ASCII file written from
left to right and bottom to top where each line is a single raster value
without X and Y.

Is there any easy-to-implement solution?
Thanks

Best regards and sorry for my previous mistake,
Kim

2011/3/9 Glynn Clements gl...@gclements.plus.com


 Martin Landa wrote:

   so just flipping all the rows in the file you can get now?
  
   don't know how to do that in python, but if unix shell powertools are
   available:
 r.out.ascii | tac

  print os.linesep.join(reversed(grass.read_command('r.out.ascii',

 FWIW, both of these are sub-optimal.

 The Python approach reads everything into memory then generates a
 reversed copy, so you need enough memory to hold two copies of the
 output from r.out.ascii.

 When given a file, tac reads the input file backwards a block at a
 time, so it only needs enough memory to hold a complete line, rounded
 up to a whole number of blocks.

 However, it can't do this when reading from a pipe; it has to store
 everything in memory.

 If you want to reverse a large file without storing everything in
 memory, the simplest solution is e.g.:

r.out.ascii ...  tmp.txt
tac tmp.txt  reversed.txt
rm tmp.txt

 If this was likely to be a common operation, r.out.ascii could easily
 be modified to flip the row number passed to Rast_get_row(). However,
 while that will be optimal for native GRASS rasters, it may be
 sub-optimal (or even fail) for linked (r.external) rasters; many
 raster formats have to be read top-to-bottom (I don't know how GDAL
 handles out-of-order reads for such formats).

 --
 Glynn Clements gl...@gclements.plus.com

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


[GRASS-user] GRASS script to export raster

2011-03-08 Thread Kim Besson
Greetings

I want to build a GRASS Python script to export raster data but instead of
XYZ (from top-left corner to lower-right corner) I want the opposite. Is
there a way to do this as a python scriipt? or I can only do this as
C-module?

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


[GRASS-user] Re: GRASS script to export raster

2011-03-08 Thread Kim Besson
Uhm I guess I wasn't clear :) I want to write a XYZ starting from low left
corner goes to the end of row then goes to above row and so on...I mean to
go from low row to top row.
Thanks


2011/3/8 Kim Besson kimbesson1...@gmail.com

 Greetings

 I want to build a GRASS Python script to export raster data but instead of
 XYZ (from top-left corner to lower-right corner) I want the opposite. Is
 there a way to do this as a python scriipt? or I can only do this as
 C-module?

 Thanks
 Kim

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


[GRASS-user] calculate raster statistics for vector polygons

2011-02-28 Thread Kim Besson
Greetings I have a vector file with polygons and I want to obtain a raster
map with statistics  of an input raster for each polygon. What can I use to
do this?

Thanks

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


[GRASS-user] Resampling- Upscalling a raster

2011-02-23 Thread Kim Besson
Greetings

I would like to know which methods are available to upscale (or resample) a
raster map from 50 m to 100 m?
And How shall I manage the g.region definitons? Before i run a resampling
method shall i define g.region Spatial resolution as 100 or only after?

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


[GRASS-user] Calculate averagfe of raster maps without mapcalc

2011-02-16 Thread Kim Besson
Greetings

I need to calculate the average of a set of raster images. How can I
calculate it without using mapcalc?
THanks

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


[GRASS-user] Re: Error while running i.gensig- Signature 1 not positive definite

2011-02-15 Thread Kim Besson
Hi

My group images ranges between 0-255, my training_areas are more than OK (I
guess).
WHy am I getting Signature 1 not positive definite?  What shall I do to
avoid this error?
Thanks
Kim

2011/2/14 Kim Besson kimbesson1...@gmail.com

 Greetings

 I have a training area map and a few landsaty images, and everytime i try
 to generate a signature I get this error/warning:
 Signature 1 not positive definite

 What might be causing this? can this be a problem of my dataset? (must it
 range in some interval of values or what is wrong with it)?
 How can I avoid this?
 And what does it mean Not positive definite?
 Thanks
 Kim Besson

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


[GRASS-user] Error while running i.gensig- Signature 1 not positive definite

2011-02-14 Thread Kim Besson
Greetings

I have a training area map and a few landsaty images, and everytime i try to
generate a signature I get this error/warning:
Signature 1 not positive definite

What might be causing this? can this be a problem of my dataset? (must it
range in some interval of values or what is wrong with it)?
How can I avoid this?
And what does it mean Not positive definite?
Thanks
Kim Besson
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Help for Wx-Georrectifier

2010-11-02 Thread Kim Besson
Hi Markus
Thanks. I do have a weekly snapshot 6.4.1 but I don't have that yet. is it
possible to integrate that part  in a earlier version of 6.4.1?
Thanks
Kim

By the way, How can I check which release am I using and, what changes have
occured since my release?

2010/11/2 Markus Metz markus.metz.gisw...@googlemail.com

 Kim Besson wrote:
  Greetings
  I'm starting to use Wx Georrectifier (Geometric Correction) and, in a
 couple
  of messages from a few weeks I saw that some help for Georrectifer was
 added
  to GRASS but I didn't find anything. could anyone point me out? Im using
  WinGRASS 6.4.0 (stable).

 The help is part of the new Georectifier in wxGUI (File - Manage
 Ground Control Points) which is available only in 6.4.1 and above. The
 latest 6.4 Windows installer is available here [1]

 Markus M

 [1] http://josef.fsv.cvut.cz/wingrass/grass64/

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


[GRASS-user] Help for Wx-Georrectifier

2010-11-01 Thread Kim Besson
Greetings

I'm starting to use Wx Georrectifier (Geometric Correction) and, in a couple
of messages from a few weeks I saw that some help for Georrectifer was added
to GRASS but I didn't find anything. could anyone point me out? Im using
WinGRASS 6.4.0 (stable).

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


[GRASS-user] Catch errors from grass.mapcalc

2010-10-29 Thread Kim Besson
Greetings

I have  python script where I try to catch, as much as possible all errors,
in order to avoid abrupt ERRORS from the script.
for instance I do this for grass.run_command:

p=grass.run_command(i.group, group=group_name, subgroup=subgroup, input=
input)
if p!=0:
   grass.fatal(_(ERROR MESSAGE))

but I'm not being able to do this for grass.mapcalc. has anyone any
suggestion or tip on how to do this for grass.mapcalc?
Thanks

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


Re: [GRASS-user] Check if a raster map has any valid pixel

2010-10-26 Thread Kim Besson
Thank Glynn. But how can I retrieve min and max using  a Python Script?


2010/10/25 Glynn Clements gl...@gclements.plus.com


 Kim Besson wrote:

  I have a python script where I need to check if an input raster map has
 any
  valid pixel (at least one pixel that is not null). How can I check this
  (easy and quick way?) in order to be integrated in my Script?

 Check the range:

$ r.mapcalc --o 'foo = null()'
$ r.info -r foo
min=NULL
max=NULL

 The range can only have min=max=NULL if there are no non-null cells.

 --
 Glynn Clements gl...@gclements.plus.com

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


[GRASS-user] Check if a raster map has any valid pixel

2010-10-25 Thread Kim Besson
Greetings
I have a python script where I need to check if an input raster map has any
valid pixel (at least one pixel that is not null). How can I check this
(easy and quick way?) in order to be integrated in my Script?

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


Re: [GRASS-user] Type of data to be used in i.maxlik

2010-10-21 Thread Kim Besson
Hi Markus




 The input can be double but will be read as integer (CELL) since the
 function
 G_open_cell_old() is used [1].


 **


*This means what? That pixels with values 255 are all the same? or pixels
like 1,034 and 2,043 are rounded?*
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Type of data to be used in i.maxlik

2010-10-19 Thread Kim Besson
Hi Markus


 The input can be double but will be read as integer (CELL) since the
 function
 G_open_cell_old() is used [1].

 This means what? That pixels with values 255 are all the same? or pixels
like 1,034 and 2,043 are rounded?

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


[GRASS-user] Re: Type of data to be used in i.maxlik

2010-10-18 Thread Kim Besson
Hello

I have sent this message but no one answered me. Can anyone help me on this?
Thanks
Kim

2010/10/15 Kim Besson kimbesson1...@gmail.com

 Greetings

 Before I used i.maxlik I decided to give a look at the code. And I have one
 question:
 - the input data, I mean the data inside the group, must it be CELL
 (integers that range 0-255) or can it be DOUBLE (double precision that range
 whatever)?

 I believe that the training_area MUST be integers (for the obvious reason)

 Thanks
 Kim

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


[GRASS-user] Type of data to be used in i.maxlik

2010-10-15 Thread Kim Besson
Greetings

Before I used i.maxlik I decided to give a look at the code. And I have one
question:
- the input data, I mean the data inside the group, must it be CELL
(integers that range 0-255) or can it be DOUBLE (double precision that range
whatever)?

I believe that the training_area MUST be integers (for the obvious reason)

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


[GRASS-user] Re: Question regarding Wiki: Compiling GRASS on MS-Windows

2010-10-07 Thread Kim Besson
Glynn mentioned some possible error associated with gcc version. Any
comments about this?
As far as I can see Thy had the same problem last week and antonio is also
having this problem. I talked with Antonio and he told me that he never had
this problem before. Only now...
Which means that this has something to do with a new improvement/update of
osgeo4w or similar


2010/10/6 Helmut Kudrnovsky hel...@web.de

 Greetings
 
 I'm using the version that is diretly linked in CompileOnWindows WIKI
 because I'm not being able to identify and corretcly select newer versions
 for msysCORE-1.0.11-bin, bin-utils, gcc-core, gcc-g++, etc.
 Can this be a limitation?

 AFAICT I'm using the linked version from the WIKI in my
 WinGrass-build-environment.

 IMHO there should be no limitation.

 best regards
 Helmut
 ___
 Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
 Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02

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


[GRASS-user] Re: Question regarding Wiki: Compiling GRASS on MS-Windows

2010-10-06 Thread Kim Besson
Greetings

I'm using the version that is diretly linked in CompileOnWindows WIKI
because I'm not being able to identify and corretcly select newer versions
for msysCORE-1.0.11-bin, bin-utils, gcc-core, gcc-g++, etc.
Can this be a limitation?
In my previous installations I always used the linked ones without any
problems... But now I'm getting errors while compilation

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


Re: [GRASS-user] Region and not-processed data

2010-09-28 Thread Kim Besson
Hi

Ok about this I just need to have an idea (or a link that can explain me
this):
1- When I import a raster map (r.in.gdal) will it import all the raster or
only the portion that fits in the current defined region?
2- If I define as a region a wider area than the image, will it process
where the image is not available?

Thanks
Kim

2010/9/27 stephen sefick ssef...@gmail.com

 Where you don't have the image, if I understand you correctly, would
 be NULL values?  In that case you will have to default to someone more
 experienced, but I suspect that it is run on the entire map, but NULL
 means no data so no process.  Just a wag.
 hth

 Stephen

 On Mon, Sep 27, 2010 at 8:58 AM, Kim Besson kimbesson1...@gmail.com
 wrote:
  Hi stephen and rest of GRASS users
 
  That was not my quiestion. My question is: if a have a an uimage inside a
  regions, will it process and run for all the region or only for where I
 have
  the image(it's not importing only image-processing). ?
 
  Thanks
  Kim
 
  2010/9/27 stephen sefick ssef...@gmail.com
 
  I get a little confused with the region raster processing stuff also.
  But, this is what I do, and it seems to work.  Anything that is
  brought in from the outside (r.in.*) will import the entire map.
  Anything that is done withing GRASS will respect the region.  So, just
  make sure to set the region before each calculation and you should be
  OK.
 
  On Mon, Sep 27, 2010 at 8:52 AM, Kim Besson kimbesson1...@gmail.com
  wrote:
   Greetings
  
   I have a very dumb question regarding region definition/processing:
   - I have defined a an area (example; 30N 20S -10W -5W). I have a
 raster
   image with (30N 15N -7W -5) I mean, it only cover a part of the
 region.
   If I
   run GRASS image-processing algorithms and processors does it run in
 all
   image or only where I have a raster image?
  
   Thanks and sorry for tyhis such a dumb question
   Kim
   ___
   grass-user mailing list
   grass-user@lists.osgeo.org
   http://lists.osgeo.org/mailman/listinfo/grass-user
  
  
 
 
 
  --
  Stephen Sefick
  
  | Auburn University   |
  | Department of Biological Sciences   |
  | 331 Funchess Hall  |
  | Auburn, Alabama   |
  | 36849|
  |___|
  | sas0...@auburn.edu |
  | http://www.auburn.edu/~sas0025 |
  |___|
 
  Let's not spend our time and resources thinking about things that are
  so little or so large that all they really do for us is puff us up and
  make us feel like gods.  We are mammals, and have not exhausted the
  annoying little problems of being mammals.
 
  -K. Mullis
 
  A big computer, a complex algorithm and a long time does not equal
  science.
 
-Robert Gentleman
 
 



 --
 Stephen Sefick
 
 | Auburn University   |
 | Department of Biological Sciences   |
 | 331 Funchess Hall  |
 | Auburn, Alabama   |
 | 36849|
 |___|
 | sas0...@auburn.edu |
 | http://www.auburn.edu/~sas0025 |
 |___|

 Let's not spend our time and resources thinking about things that are
 so little or so large that all they really do for us is puff us up and
 make us feel like gods.  We are mammals, and have not exhausted the
 annoying little problems of being mammals.

 -K. Mullis

 A big computer, a complex algorithm and a long time does not equal
 science.

   -Robert Gentleman

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


[GRASS-user] Region and not-processed data

2010-09-27 Thread Kim Besson
Greetings

I have a very dumb question regarding region definition/processing:
- I have defined a an area (example; 30N 20S -10W -5W). I have a raster
image with (30N 15N -7W -5) I mean, it only cover a part of the region. If I
run GRASS image-processing algorithms and processors does it run in all
image or only where I have a raster image?

Thanks and sorry for tyhis such a dumb question
Kim
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Region and not-processed data

2010-09-27 Thread Kim Besson
Hi stephen and rest of GRASS users

That was not my quiestion. My question is: if a have a an uimage inside a
regions, will it process and run for all the region or only for where I have
the image(it's not importing only image-processing). ?

Thanks
Kim

2010/9/27 stephen sefick ssef...@gmail.com

 I get a little confused with the region raster processing stuff also.
 But, this is what I do, and it seems to work.  Anything that is
 brought in from the outside (r.in.*) will import the entire map.
 Anything that is done withing GRASS will respect the region.  So, just
 make sure to set the region before each calculation and you should be
 OK.

 On Mon, Sep 27, 2010 at 8:52 AM, Kim Besson kimbesson1...@gmail.com
 wrote:
  Greetings
 
  I have a very dumb question regarding region definition/processing:
  - I have defined a an area (example; 30N 20S -10W -5W). I have a raster
  image with (30N 15N -7W -5) I mean, it only cover a part of the region.
 If I
  run GRASS image-processing algorithms and processors does it run in all
  image or only where I have a raster image?
 
  Thanks and sorry for tyhis such a dumb question
  Kim
  ___
  grass-user mailing list
  grass-user@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/grass-user
 
 



 --
 Stephen Sefick
 
 | Auburn University   |
 | Department of Biological Sciences   |
 | 331 Funchess Hall  |
 | Auburn, Alabama   |
 | 36849|
 |___|
 | sas0...@auburn.edu |
 | http://www.auburn.edu/~sas0025 |
 |___|

 Let's not spend our time and resources thinking about things that are
 so little or so large that all they really do for us is puff us up and
 make us feel like gods.  We are mammals, and have not exhausted the
 annoying little problems of being mammals.

 -K. Mullis

 A big computer, a complex algorithm and a long time does not equal
 science.

   -Robert Gentleman

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


[GRASS-user] Question regarding grass.mapcalc

2010-09-24 Thread Kim Besson
Greetings

I'm doing a Python script to calibrate a raster image. Since I need to do 3
different calculations I'm using a tempfile (tempL)

This is the code:

 tempL = grass.read_command(g.tempfile, pid = 1)
grass.mapcalc($L=$lmin+ (($lmax-$lmin)/($QCALmax-$QCALmin))*
($raster_file-$QCALmin), L=tempL, lmin=lmin, lmax=lmax, QCALmax=QCALmax,
QCALmin=QCALmin, raster_file=raster_file)

Where tempL is a temporary, (lmin,lmax) are floats, QCALmax and QCALmin are
int and raster_file is a raster map used as input.

And I get this:
syntax error, unexpected '/', expecting NAME or STRING
Parse error
ERROR: An error occurred while running r.mapcalc

What is happening? I believe it has something to do with tempL. Maybe I'm
not doing this right. Can anyone help me on this?
Thanks
Kim
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Customization of WxGUI Georrectification

2010-08-20 Thread Kim Besson
Hi there

 I'm a GRASS user and I've been using WxGUI Georrectification tool (that you
have developed/updated). Since we are using it for teaching purpose a few
students suggested to change the panel titles in order to identrify the
steps (for instance 1st panel (LocationPage) title would be: Setup for
geometric Correction  Step1 of 3
2nd panel (grouppage) title would be: Setup for georectification Step2 of 3
3rd panel (mappage) title would be: Setup for geometric Correction Step3 of
3

I saw that this is defining the panel titles:
self.wizard = wiz.Wizard(parent=parent, id=wx.ID_ANY, title=_(Setup for
georectification))
I tried to create new wizards
self.wizard2 = wiz.Wizard(parent=parent, id=wx.ID_ANY, title=_(Setup for
georectification Step 2of 3)) and then:
self.grouppage = GroupPage(self.wizard2, self)

but it didn't work.

My question is: Is this possible to do? If so, can you give me a tip on
that?

Thanks

Best regards,
Kim Besson
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error while creating vectorial file in WinGRASS

2010-08-04 Thread Kim Besson
Hi there
Regarding Hamish suggestion 
You need to run db.connect to select a database backend to use
first. (There is no VAR file in the mapset yet)
The thing is: I have been using an WinGRASS6.4 binary version where I didn't
need to do anything else. Just create Vector by doing this. So, my question
is, why was this disabled? Or is it some error that only occurs in this
release?

About
hopefully fixed  ready for testing in 6.5svn r42988 (v.edit).
Will it be available for 6.4 in Windows?
Thanks
Kim
2010/8/4 Markus Metz markus.metz.gisw...@googlemail.com

 Hamish wrote:
  Hamish wrote:
  You need to run db.connect to select a database backend to
  use first. (There is no VAR file in the mapset yet)
 
  hopefully fixed  ready for testing in 6.5svn r42988 (v.edit).
 
 
  devs:
   maybe do this for 'v.in.ascii -e' and 'v.digit -n' too?
   or move this into Vect_open_new() ?

 Not to Vect_open_new(), a GRASS vector does not need to have a DB
 connection, this is optional.

 Markus M


 ... but I'm not totally
  convinced that's the right place for it either; the mapset may
  come from an earlier version of GRASS. perhaps db.execute
  instead of exiting with an error.
 
 
  #include grass/dbmi.h
  ...
   if (! db_get_default_driver_name() ) {
   G_message(_(Creating new DB connection based on default mapset
 settings...));
   db_set_default_connection();
   }
 
 
  see bug #7  http://trac.osgeo.org/grass/ticket/7
 
 
  Hamish
 
 
 
 
 
  ___
  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


[GRASS-user] Error while creating vectorial file in WinGRASS

2010-08-03 Thread Kim Besson
I have installed WinGRASS-6.4.SVN-r42868-1-Setup.exe in my WinXP machine
and, when I  select Vector/Develop Vector Map/Create new vector map, I place
output name and check Create Attibute table I get an error windows stating:
- Error in command execution db.execute
Execution failed: 'db.execute --q'
Details:
Error: Unable to start driver (null)

And the following is printed in Command Output:
Traceback (most recent call last):
  File C:/GRASS6/etc/wxpython/wxgui.py, line 546, in
OnNewVector

cmdDef=(['v.edit', 'tool=create'], map))
  File C:\GRASS6\etc\wxpython\gui_modules\gdialogs.py,
line 192, in CreateNewVector

stdin=sql)
  File C:\GRASS6\etc\wxpython\gui_modules\gcmd.py, line
369, in __init__

_(Error: ) + self.GetError()))
gui_modules.gcmd
.
CmdError
Traceback (most recent call last):
  File C:/GRASS6/etc/wxpython/wxgui.py, line 546, in
OnNewVector

cmdDef=(['v.edit', 'tool=create'], map))
  File C:\GRASS6\etc\wxpython\gui_modules\gdialogs.py,
line 192, in CreateNewVector

stdin=sql)
  File C:\GRASS6\etc\wxpython\gui_modules\gcmd.py, line
369, in __init__

_(Error: ) + self.GetError()))
gui_modules.gcmd
.
CmdError

I believe this was not expected but, what might be wrong?

Thanks

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


[GRASS-user] Using Vector Digitizer in Windows- TclTk

2010-07-26 Thread Kim Besson
Greetings

In the past I have submitted a few questions regarding vector digitizer in
Windows (using tcltk) but now I have a few new questions, more focused on
customization.

1- Regarding Insert new Record into table item:  If I want to edit an
existing boundary, I have to uncheck this?

2- I have developed a kind of a GRASS applicable version for classification
to be used in my classes but I'm getting a lot of usability problems that
I can solve by customization of tcltk vector digitalization
please if anyone can help me, can answer the following (if not, who probably
can help me?):
   a- How can I define a pre-defined layer number (always 1) and eliminate
Layer ID check box?
   b- How can I eliminate the mode combobox and predefined next not in use?
   c- In Form, that is displayed after inserting a new boundary, how can I
eliminate data encoding and predefine an option?
   d- (this is the complicated): My students are doing a classification
procedure in which, for each landcover classe they have to define training
areas. Right now they are doing:1) Open v.digit, insert filename and flag -n
for Class1(forest); 2) Tcltk vector digitizer usage; 3) save and close
vector digitizer 4) open v.digit insert filename and flag -n for class2
(ocean) ( ... ) So this is a heavy procedure for lazy students :) My
question is: can I implement an circular process in which: 1) I open
TclTkvector digitizer that asks for Class1; 2) Digizier boundaries bla bla
bla 3) Click Next and TclTk's Vector  Digitizer will ask for Classe2 (...)
and so on.


Thanks for your help in such an heavy questions

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


Re: [GRASS-user] Define Global Variables and use them in a Python script

2010-07-06 Thread Kim Besson
Hello Glynn

As soon as I arrive to the office I will give it a try. Thought that I could
have global variables such as LC_LANGUAGES and other GRASS_GLOBAL VARIABLES.
Is it possible to define them in Init.sh (or .bat) and be used in Python
Scripts?

Best regards,
Kim
2010/7/5 Glynn Clements gl...@gclements.plus.com


 Kim Besson wrote:

  I've been testing and kind of  using GRASS-Python scripts for nearly 2
  weeks and it's being great. So far no major issues but now I need to do
  something:
  - From a text file (ASCII) I need to read a few variables and make them
  global bariables I mean, be available and defined for a huge set of
 Scripts
  in order to avoid to define those variables in each Script. And, in case
 I
  change them, I only have to change in that ASCII File. My questions are:
  1- How can I do GRASS to read an external File in order to define GLOBAL
  VARIABLES?
  2- How can I call them from a GRASS_SCRIPT?

 A global variable in Python is local to the module in which it's
 defined. So you you have a module named config, to access any global
 variables in that module from other modules you would need either
 import config (in which case, variables will be accessible as
 config.whatever) or from config import * (but as the program grows,
 the chances of name collisions increase).

 For a set of related variables, e.g. configuration parameters, it's
 usually better to make them all members of a specific object, e.g.:

class Params(object):
def __init__(self, filename):
# initialise members from file

# read the config file
params = Params(config.cfg)

 Then you only need to import a single name:

from config import params

 --
 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] Define Global Variables and use them in a Python script

2010-07-06 Thread Kim Besson
Hi Glynn and rest of the list
I have tested this method by creating a config.py and a demo-example of
config and I'm not being able to use this solution. Maybe I'm not fully
understanding it (never used classes in Python):
1- I create a config1.py file in a working Python directory
2- I added this to config.py
class Params(object):
def __init__(self, filename):
  params = Params(config.cfg)
3- My config.cfg has the following:
Ah= '1'
Bu= '2'

4- Just for testing, in a Python Shell I do:
from config1 import Params
 (WORK)
Then:
 print Params
I get: class 'config1.Params'
So I cannot access variables inside config.cfg
What am I doing wrong?
Kim



2010/7/5 Glynn Clements gl...@gclements.plus.com


 Kim Besson wrote:

  I've been testing and kind of  using GRASS-Python scripts for nearly 2
  weeks and it's being great. So far no major issues but now I need to do
  something:
  - From a text file (ASCII) I need to read a few variables and make them
  global bariables I mean, be available and defined for a huge set of
 Scripts
  in order to avoid to define those variables in each Script. And, in case
 I
  change them, I only have to change in that ASCII File. My questions are:
  1- How can I do GRASS to read an external File in order to define GLOBAL
  VARIABLES?
  2- How can I call them from a GRASS_SCRIPT?

 A global variable in Python is local to the module in which it's
 defined. So you you have a module named config, to access any global
 variables in that module from other modules you would need either
 import config (in which case, variables will be accessible as
 config.whatever) or from config import * (but as the program grows,
 the chances of name collisions increase).

 For a set of related variables, e.g. configuration parameters, it's
 usually better to make them all members of a specific object, e.g.:

class Params(object):
def __init__(self, filename):
# initialise members from file

# read the config file
params = Params(config.cfg)

 Then you only need to import a single name:

from config import params

 --
 Glynn Clements gl...@gclements.plus.com

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


[GRASS-user] Define Global Variables and use them in a Python script

2010-07-05 Thread Kim Besson
Hi there

I've been testing and kind of  using GRASS-Python scripts for nearly 2
weeks and it's being great. So far no major issues but now I need to do
something:
- From a text file (ASCII) I need to read a few variables and make them
global bariables I mean, be available and defined for a huge set of Scripts
in order to avoid to define those variables in each Script. And, in case I
change them, I only have to change in that ASCII File. My questions are:
1- How can I do GRASS to read an external File in order to define GLOBAL
VARIABLES?
2- How can I call them from a GRASS_SCRIPT?

Thanks

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


Re: [GRASS-user] Warning regarding Datum unknown not recognised by GRASS

2010-06-30 Thread Kim Besson
So, this means that I'm not able to use g.proje -jf output to properly
define a coordinate system right?

2010/6/29 Markus Neteler nete...@osgeo.org

 Hi Kim,

 On Tue, Jun 29, 2010 at 6:37 PM, Kim Besson kimbesson1...@gmail.com
 wrote:
  Hello Markus
  Thanks for the reply
  To do what you suggest, I would have to retrieve LOCATION's CRS EPSG code
  and I'm not able to get it automatically. I only can get that PROJ4
 string
  by using g.proj. Is there a way to automatically get a LOCATIONS's EPSG
  code?

 That not possible (yet?) - also GDAL/OGR does not have a reverse
 lookup - too complicated or too many exceptions.

 The string
 +proj=utm +south +no_defs +zone=24 +a=6378137 +rf=298.257223563
 +towgs84=0.000,0.000,0.000 +to_meter=1

 looks like
  http://spatialreference.org/ref/epsg/32724/
 to me.

 cs2cs -le | grep 'WGS 84'
WGS84 a=6378137.0  rf=298.257223563 WGS 84

 Markus

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


[GRASS-user] Warning regarding Datum unknown not recognised by GRASS

2010-06-29 Thread Kim Besson
Greetings

A couple of days ago I have exchanged a few messages with Paul Kelly and
Micha Silver regarding this issue. But now I have a new example and I want
to know if I'm doing anything wrong and better understand what is  GRASS
behaviour.

I'm trying to have an aumatic procedure to reproject images using gdalwarp.
First it checks image CRS (g.proj input=IMAGE -jf) and compares with
Location's CRS (g.proj -jf).

As target_CRS I'm using the output from g.proj -j -f .
In this case, g.proj -jf give me the Location«s CRS:
+proj=utm +south +no_defs +zone=24 +a=6378137 +rf=298.257223563
+towgs84=0.000,0.000,0.000 +to_meter=1
(Sidenote. This Location was created based on an EPSG)

I use this expression to warp the image:
gdalwarp -t_srs +proj=utm +south +no_defs +zone=24 +a=6378137
+rf=298.257223563 +towgs84=0.000,0.000,0.000 +to_meter=1 input.tif
proj4.tif

But if I check proj4.tif CRS I get this:
+proj=utm +south +no_defs +zone=24 +a=6378137 +rf=298.257223563 +to_meter=1
Trying to open with OGR...
Trying to open with GDAL...
...succeeded.
Datum unknown not recognised by GRASS and no parameters found

Why towgs84 is not kept in the image?

THanks

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


Re: [GRASS-user] Warning regarding Datum unknown not recognised by GRASS

2010-06-29 Thread Kim Besson
Hello Markus
Thanks for the reply
To do what you suggest, I would have to retrieve LOCATION's CRS EPSG code
and I'm not able to get it automatically. I only can get that PROJ4 string
by using g.proj. Is there a way to automatically get a LOCATIONS's EPSG
code?
Best regards,
Kim

2010/6/29 Markus Neteler nete...@osgeo.org

 On Tue, Jun 29, 2010 at 11:20 AM, Kim Besson kimbesson1...@gmail.com
 wrote:
  Greetings
  A couple of days ago I have exchanged a few messages with Paul Kelly and
  Micha Silver regarding this issue. But now I have a new example and I
 want
  to know if I'm doing anything wrong and better understand what is  GRASS
  behaviour.
  I'm trying to have an aumatic procedure to reproject images using
 gdalwarp.
  First it checks image CRS (g.proj input=IMAGE -jf) and compares with
  Location's CRS (g.proj -jf).
  As target_CRS I'm using the output from g.proj -j -f .
  In this case, g.proj -jf give me the Location«s CRS:
  +proj=utm +south +no_defs +zone=24 +a=6378137 +rf=298.257223563
  +towgs84=0.000,0.000,0.000 +to_meter=1
  (Sidenote. This Location was created based on an EPSG)
  I use this expression to warp the image:
  gdalwarp -t_srs +proj=utm +south +no_defs +zone=24 +a=6378137
  +rf=298.257223563 +towgs84=0.000,0.000,0.000 +to_meter=1 input.tif
  proj4.tif
  But if I check proj4.tif CRS I get this:
  +proj=utm +south +no_defs +zone=24 +a=6378137 +rf=298.257223563
 +to_meter=1
  Trying to open with OGR...
  Trying to open with GDAL...
  ...succeeded.
  Datum unknown not recognised by GRASS and no parameters found
  Why towgs84 is not kept in the image?

 To my knowledge the GeoTIFF format is not able to keep the towgs84 string.
 Did you try with different formats?

 But in general, it may be better to assign proj metadata via EPSG code.

 Markus

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


[GRASS-user] Python Script to retrieve Location's GCS

2010-06-18 Thread Kim Besson
Greetings
Is there a Pythons Functionality to retrieve Locations Geographic
Coordinates System? But in this case can these coordinates be used in
GDALWARPs as as an Geographic Coordinates input ?

Thanks

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


Re: [GRASS-user] Using Vector Digitizer in Windows

2010-06-07 Thread Kim Besson
Where can I find that tab? I can't find it at TclTkDigitizer

2010/6/3 Hamish hamis...@yahoo.com

 Kim:
  How can I put an image as a background? I am
   at v.digit form and I cannot see any field regarding that

 Markus:
  There should be, when starting, the option to select a
  background display *command*
 
  http://grass.osgeo.org/grass64/manuals/html64_user/v.digit.html
 
  which could be set to
  d.rast map=name_of_raster

 also you can do it in the settings controls once in the tool, there's a
 tab for it.


 Hamish




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


[GRASS-user] Using Vector Digitizer in Windows

2010-06-02 Thread Kim Besson
Hi

I'm using Vector Digitizer in MS-Windows (Tcltk since WxGUI is not
available) and I wanted to know How can I put an image as a background? I am
at v.digit form and I cannot see any field regarding that
Thanks
Kim
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] DAtum Warning while using r.in.gdal

2010-06-01 Thread Kim Besson
Thanks to Paul and Micha for the help.
About this: I defined my location using this image but instead of being
reprojected with PROJ4 extension I used EPSG:3763 and then r.in.gdal. Then,
using the same original image (in UTM) I reprojected to this CRS but using
PROj4 extension (showed in my original message).

What is the correct one? the bellow expression or the EPSG:3763 in order to
reproject an image?

It was only a warning. It imported the image nevertheless, without using -o
option.

2010/5/31 Micha Silver mi...@arava.co.il

  On 05/31/2010 07:25 PM, Kim Besson wrote:

 Greetings

  Following a few suggestions made at this list I'm using gdalwarp to
 project a few landsat images and only then yusing r.in.gdal.

  I'm using this expression to reproject image:
  gdalwarp -t_srs +proj=tmerc +lat_0=39.668258
 +lon_0=-8.1331084 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs
  L71203033_03320001023_B10.TIF  landsat_out.tif

  And when I run r.in.gdal I get this warning:
  Datum unknown not recognised by GRASS and no parameters found
 Projection of input dataset and current location appear to match

  What does this means?

   There's no +datum=  parameter in the CRS definition, so the new,
 projected tif has no datum information. But, if you're sure the above
 parameters are correct, you can ignore the warning and tell GRASS to ignore
 the warning with the -o option to r.in.gdal.
 BTW, how did you define the GRASS Location? with the EPSG:3763 or the above
 definition? If so, then you surely should have no problem importing with the
 -o (over-ride projection check) option.

   Thanks
 kim

 This mail was received via Mail-SeCure System.


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


 This mail was received via Mail-SeCure System.






 --
 Micha Silver
 Arava Development Co. +972-52-3665918
 http://www.surfaces.co.il


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


[GRASS-user] DAtum Warning while using r.in.gdal

2010-05-31 Thread Kim Besson
Greetings

Following a few suggestions made at this list I'm using gdalwarp to project
a few landsat images and only then yusing r.in.gdal.

I'm using this expression to reproject image:
gdalwarp -t_srs +proj=tmerc +lat_0=39.668258
+lon_0=-8.1331084 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs
 L71203033_03320001023_B10.TIF  landsat_out.tif

And when I run r.in.gdal I get this warning:
Datum unknown not recognised by GRASS and no parameters found
Projection of input dataset and current location appear to match

What does this means?

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


[GRASS-user] Re: Get current location projection in a Python Script

2010-05-27 Thread Kim Besson
Michael, regarding the use of regiondict = grass.region() , Does this
retrieves Projection EPSG code?

Kim

2010/5/25 Kim Besson kimbesson1...@gmail.com

 Greetings

 I'm building a GRASS Python Script to automatically import a set of data to
 my location. At GRASS book (chapter 3.3.3) it uses g.proj -wf to to check
 current location projection. Can I use the same command in Python to
 retrieve the same?


 And how about calling gdalwarp in a Python-GRASS Script? can it be called
 and used by a Python_GRASS Script? if so, is there any Python example with
 that?

 Regarding g.proj -wf command. I get a lot of information. I suppose
 GDALWARP can read this right ? If not, How can I obtain current Location
 EPSG code?

 Thanks

 Best regards,
 Kim



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


[GRASS-user] Open a raster from other MAPSET

2010-05-26 Thread Kim Besson
Hi there,

At my location have 2 MAPSETS: Mapset Regional, with raster with 300m
SpatiaL Resolution and Mapset Urban with 5 meters Spatial Resolution.
I need to pass a LandCovermap from Mapset regional to my Urban mapset but I
need it in the same 5 meters Spatial Resolution instead of the original
300m. My question is: can this be done? and how can I pass a map from one
Mapset to the other?
Thanks

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


Re: [GRASS-user] Open a raster from other MAPSET

2010-05-26 Thread Kim Besson
Hey Rich

My idea is not to change mapset but to get a map and copy it to my
Local mapset.

Message: 5
Date: Wed, 26 May 2010 06:51:26 -0700 (PDT)
From: Rich Shepard rshep...@appl-ecosys.com rshep...@appl-ecosys.com
Subject: Re: [GRASS-user] Open a raster from other MAPSET
To: grass-user@lists.osgeo.org
Message-ID: alpine.lnx.2.00.1005260650400.5...@salmo.appl-ecosys.com
alpine.lnx.2.00.1005260650400.5...@salmo.appl-ecosys.com
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 26 May 2010, Kim Besson wrote:


 My question is: can this be done? and how can I pass a map from one Mapset 
 to the other?


   g.mapsets

   The resolution will be that of the current mapset.

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


[GRASS-user] Get current location projection in a Python Script

2010-05-25 Thread Kim Besson
Greetings

I'm building a GRASS Python Script to automatically import a set of data to
my location. At GRASS book (chapter 3.3.3) it uses g.proj -wf to to check
current location projection. Can I use the same command in Python to
retrieve the same?


And how about calling gdalwarp in a Python-GRASS Script? can it be called
and used by a Python_GRASS Script? if so, is there any Python example with
that?

Regarding g.proj -wf command. I get a lot of information. I suppose
GDALWARP can read this right ? If not, How can I obtain current Location
EPSG code?

Thanks

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


[GRASS-user] Export the conversion from Vector to Raster

2010-05-07 Thread Kim Besson
Greetings
This is probably a very dumb thing but I'm having a few difficulties doing
this. I have an SHAPEFILE with classification polygons. And I need to
Convert to raster (e.g. TIF) So I thought of using GRASS (of course)

1- Define region with a Landsat image used to create those Training areas
outside GRASS
2- Run v.in.gor
v.in.ogr -o dsn=C:\Data\GISDataBase\training_data.shp output=train00
Over-riding projection check
Layer: training_data
Default driver / database set to:
driver: dbf
database: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
Importanto feições do mapa 448...
-
Building topology for vector map train00...
Registering primitives...
448 primitives registered
2903 vertices registered
Building areas...
448 areas built
448 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 448
Number of primitives: 448
Number of points: 0
Number of lines: 0
Number of boundaries: 448
Number of centroids: 0
Number of areas: 448
Number of isles: 448
Number of areas without centroid: 448
-
Cleaning polygons, result is not guaranteed!
Building topology for vector map train00...
Number of nodes: 448
Number of primitives: 448
Number of points: 0
Number of lines: 0
Number of boundaries: 448
Number of centroids: 0
Number of areas: -
Number of isles: -
-
Break polygons:
-
Remove duplicates:
-
Break boundaries:
-
Remove duplicates:
-
Clean boundaries at nodes:
-
Change dangles to lines:
-
Remove bridges:
-
Building topology for vector map train00...
Building areas...
448 areas built
448 isles built
Attaching islands...
Number of nodes: 448
Number of primitives: 448
Number of points: 0
Number of lines: 0
Number of boundaries: 448
Number of centroids: 0
Number of areas: 448
Number of isles: 448
Number of areas without centroid: 448
Layer: training_data
-
-
Building topology for vector map train00...
Registering primitives...
896 primitives registered
3351 vertices registered
Building areas...
448 areas built
448 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 896
Number of primitives: 896
Number of points: 0
Number of lines: 0
Number of boundaries: 448
Number of centroids: 448
Number of areas: 448
Number of isles: 448
-
448 input polygons
Total area: 6.159110e+006 (448 areas)
Overlapping area: 0.00e+000 (0 areas)
Area without category: 0.00e+000 (0 areas)

3- It created a vectorial train00. When I open it at GRASS and overlays it
with my landsat images they MATCH...
4- I want to create a RASTER exacly with the same characteristics as my
landsat images but using Class Field as Raster values. I mean, the pixels
inside polygons with class value 12 will have a vlue of 12.
Reading GRASS book I decided to use v.to.rast
v.to.rast input=trai...@permanent output=train_raster00 type=area
column=Class labelcolumn=cat
Loading data...
Pass 1 of 2:
Reading areas...
Reading features...
Writing raster map...
Pass 2 of 2:
Reading areas...
Writing raster map...
Converted areas: 448 of 448
Converted points/lines: 0 of 0
v.to.rast complete.

5- Open train_raster00 and it seems to be Ok when comparing with Vectorial
6- Metadata from is train_raster00
 |   Type of Map:  raster   Number of Categories: 0
  |
 |   Data Type:CELL
  |
 |   Rows: 7109
  |
 |   Columns:  7662
  |
 |   Total Cells:  54469158
  |
 |Projection: x,y
  |
 |N: 23020.21492744S: -190249.78507256   Res:30
  |
 |E: 177696.83076767W: -52163.16923233   Res:30
  |
 |   Range of data:min = 1  max = 17
 |
And Metadata from Landsat is:
|   Type of Map:  raster   Number of Categories: 0
|
 |   Data Type:CELL
  |
 |   Rows: 7109
  |
 |   Columns:  7662
  |
 |   Total Cells:  54469158
  |
 |Projection: x,y
  |
 |N: 23020.21492744S: -190249.78507256   Res:30
  |
 |E: 177696.83076767W: -52163.16923233   Res:30
  |
 |   Range of data:min = 0  max = 255
  |

So it maches :)

7- Now, export this raster.Since I want a Geotiff I used:
r.out.tiff input=train_raste...@permanent output=trainraster00a
If I do gdalinfo to the exported file I get:river: GTiff/GeoTIFF
Files: /mnt/GIS/trainraster00a.tif
Size is 7662, 7109
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (0.0,

Re: [GRASS-user] Export the conversion from Vector to Raster

2010-05-07 Thread Kim Besson
Hi Markus
I did this:
r.out.gdal 
input=train_raste...@permanentoutput=c:\Data\GISDataBase\trainraster00b
nodata=-1
And I got
PROJ_INFO not found for  DATA
PROJ_UNITS not found for  PT_IGP
Exporting to GDAL data type: Byte
Unable to set projection
Input raster map contains cells with NULL-value (no-data). The value -1 was
used to represent no-data values in the input map. You can specify nodata
value by nodata parameter.

It's strange. Then I decided to do g.region display and I realized that:
projection: 0 (x,y)
zone:   0
north:  23020.21492744
south:  -190249.78507256
west:   -52163.16923233
east:   177696.83076767
nsres:  30
ewres:  30
rows:   7109
cols:   7662
cells:  54469158
(Fri May 07 10:40:07 2010) Comando terminado (0 sec)

(Fri May 07 10:40:30 2010)

g.region -p

projection: 0 (x,y)
zone:   0
north:  23020.21492744
south:  -190249.78507256
west:   -52163.16923233
east:   177696.83076767
nsres:  30
ewres:  30
rows:   7109
cols:   7662
cells:  54469158

I have NO PROJECTION :( How come? I have defined my Location from a
projected Landsat image the same that I have imported. Any clues of what I
did wrong?

2010/5/7 Markus Metz markus.metz.gisw...@googlemail.com

 Kim Besson wrote:

 [snip]

  7- Now, export this raster.Since I want a Geotiff I used:
  r.out.tiff input=train_raste...@permanent output=trainraster00a

 You must use r.out.gdal to get a GeoTIFF, r.out.tiff produces an
 ordinary tif image, not a spatial raster dataset.

 Markus M

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


[GRASS-user] Error in Projection from Landsat images

2010-05-07 Thread Kim Besson
Greetings
This topic was being discussed in converting Vector to raster and them I
realized that it might be better to change it to here:
I did
gdalinfo to my landsat data is this:
Driver: GTiff/GeoTIFF
Files: L.tif
Size is 7662, 7109
Coordinate System is:
LOCAL_CS[ Geocoding information not available Projection Name =
ETRS_1989_Transverse_Mercator Units = meters Geo,
UNIT[unknown,1]]
Origin = (-52163.169232331842068,23020.214927441673353)
Pixel Size = (30.000,-30.000)
Metadata:
  TIFFTAG_SOFTWARE=IMAGINE TIFF Support
Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: etif.c $ $Revision: 1.10.1.9.1.9.2.11 $ $Date: 2004/09/15
18:42:01EDT $
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  -52163.169,   23020.215)
Lower Left  (  -52163.169, -190249.785)
Upper Right (  177696.831,   23020.215)
Lower Right (  177696.831, -190249.785)
Center  (   62766.831,  -83614.785)
Band 1 Block=64x64 Type=Byte, ColorInterp=Red
Band 2 Block=64x64 Type=Byte, ColorInterp=Green
Band 3 Block=64x64 Type=Byte, ColorInterp=Blue
Band 4 Block=64x64 Type=Byte, ColorInterp=Undefined
Band 5 Block=64x64 Type=Byte, ColorInterp=Undefined
Band 6 Block=64x64 Type=Byte, ColorInterp=Undefined

It has geographic information right? and it's supposed to be recognized by
GRASS.
So I decided to create a new Location.
1- Define name of the location (landsat02)
2- Choose method for creating a new location: Read Projection and datums
from a georreferenced file== I select the file
I choose no in defining region
3- Enter into location
4- do g.region -p and I get:
projection: 0 (x,y)
zone:   0
north:  23020.21492744
south:  -190249.78507256
west:   -52163.16923233
east:   177696.83076767
nsres:  30
ewres:  30
rows:   7109
cols:   7662
cells:  54469158

Everything else seems ok except the Projection that is (x,y). This means
that it's not recognizing the coordinate system or am I doing something
wrong?

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


[GRASS-user] Call an external function from GRASS-Pythons Scripts

2010-04-22 Thread Kim Besson
Hi

I'm developing a small GRASS Python script but I will need to call an
external executive. I already know where to put it (at $PATH) but i don't
know how to call it from Python GRASS Script. How can I do this? (as an
example it's helloWorld :) )

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


Re: [GRASS-user] Call an external function from GRASS-Pythons Scripts

2010-04-22 Thread Kim Besson
Here now at the ML for everyone :)
But which one of the two options is correct? The first one or the second
one? Or both are ok? (at least the second one is correct I suppose)

2010/4/22 Martin Landa landa.mar...@gmail.com

 Hi,

 {please keep discussion on ML}

 2010/4/22 Kim Besson kimbesson1...@gmail.com:
  Bur for instance you separated two argument inside [ ]. This means that
 for
  instance If I need to call a external function and inser input and output
 I
  would have to do this:
  grass.call(['whoami', 'input_file', 'output_file']) or
  grass.call(['whoami input output_file'])

 it's first argument 'args'.

 Martin

 PS: Probably it would be reasonable to change configuration of ML
 (send replay to the list instead to 'from') to avoid this mistake.

 --
 Martin Landa landa.martin gmail.com * http://gama.fsv.cvut.cz/~landa

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


[GRASS-user] Installing snapshot on a defined Folder

2010-04-13 Thread Kim Besson
Greetings

from my Package manager (Synaptic in Ubuntu) I have installed GRASS-dev
package in /usr/lib/grass64/. But, then I decided to install a Weekly
snapshot to update a few issues. But the weekly snapshot was installed
in /usr/local/grass-6.4.0svn.
My question is, how can I define my installation destination  directory to
avoid having 2 different installations?

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


Re: [GRASS-user] R-GDAL incompatible libraries

2010-03-02 Thread Kim Besson
Hi

I have installed R from Ubuntu repositories. My grass installation is a
Weekly snapshot.
I had to install rgdal since it doesn't exist in UBUNTU repositories neither
CRAN and the same with spgrass6.

Ok I will rebuild grass and reply again to mailing list

Thanks
Kim

Did you install grass from source? Did you install R, spgrass6 from

 source?

 - If you have installed grass from source, then try to rebuild grass
 (after having installed R and the rest).

 - If you have grass from the ubuntu repositories, the you should
 probably stick with R and the rest from the repositories as well. If the
 latter is the case and it does not work, then there is a problem.

 Tell us a bit more...

 Nikos


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


Re: [GRASS-user] R-GDAL incompatible libraries

2010-03-02 Thread Kim Besson
Ok I have just installed latest GRASS snapshot and I got the following error
 precip30n - readVECT6(precip_30ynormals, ignore.stderr=TRUE)
ERROR: Incompatible library version for module. You need to rebuild GRASS
   or untangle multiple installations.

What I would like to know is the versions of R and spgrass6 that I should
install on my system in order to not get this errors?

Thanks
Kim

2010/3/2 Kim Besson kimbesson1...@gmail.com

 Hi

 I have installed R from Ubuntu repositories. My grass installation is a
 Weekly snapshot.
 I had to install rgdal since it doesn't exist in UBUNTU repositories
 neither CRAN and the same with spgrass6.

 Ok I will rebuild grass and reply again to mailing list

 Thanks
 Kim

 Did you install grass from source? Did you install R, spgrass6 from

 source?

 - If you have installed grass from source, then try to rebuild grass
 (after having installed R and the rest).

 - If you have grass from the ubuntu repositories, the you should
 probably stick with R and the rest from the repositories as well. If the
 latter is the case and it does not work, then there is a problem.

 Tell us a bit more...

 Nikos



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


Re: [GRASS-user] R-GDAL incompatible libraries

2010-03-02 Thread Kim Besson
Ok I reinstalled rgdal
R CMD INSTALL rgdal

And then:
R
library(spgrass6)

Output:
Loading required package: sp
Loading required package: rgdal
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.5.4, released 2009/01/07
Path to GDAL shared files: /usr/share/gdal15
Loaded PROJ.4 runtime: Rel. 4.6.1, 21 August 2008
Path to PROJ.4 shared files: (autodetected)
Loading required package: XML
GRASS GIS interface loaded with GRASS version: 6.4.0svn
and location: North-Carolina

precip30 - readVECT6(precip_30ynormals, ignore.stderr=TRUE)
ERROR: Incompatible library version for module. You need to rebuild GRASS
   or untangle multiple installations.

Same error.
I'm running GRASSsvn6.4.0, from latest week, in a Linux Machine with:
rgdal_0.6-10
spgrass6_0.6-15.
R version 2.9.2 (2009-08-24)

Any idea of what might not be compatible?

Thank you
Kim

2010/3/2 Markus Neteler nete...@osgeo.org

 2010/3/2 Kim Besson kimbesson1...@gmail.com:
  Ok I have just installed latest GRASS snapshot and I got the following
 error
  precip30n - readVECT6(precip_30ynormals, ignore.stderr=TRUE)
  ERROR: Incompatible library version for module. You need to rebuild GRASS
 or untangle multiple installations.
  What I would like to know is the versions of R and spgrass6 that I should
  install on my system in order to not get this errors?

 You also need to update the GRASS-GDAL plugin.

 Markus

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


Re: [GRASS-user] R-GDAL incompatible libraries

2010-03-02 Thread Kim Besson
Following Leo's suggestion I installed GDAL 1.6.3 and I tried again:

 library(spgrass6)
Loading required package: sp
Loading required package: rgdal
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.6.3, released 2009/11/19
Path to GDAL shared files: /usr/share/gdal16
Loaded PROJ.4 runtime: Rel. 4.6.1, 21 August 2008
Path to PROJ.4 shared files: (autodetected)
Loading required package: XML
GRASS GIS interface loaded with GRASS version: 6.4.0svn
and location: nc_spm_08

(seems OK?)

 precip - readVECT6(precip_30ynormals, ignore.stderr)
OGR data source with driver: GRASS
Source: /mnt/GIS/nc_spm_08/PERMANENT/vector/precip_30ynormals/head, layer:
1
with 136 features and 18 fields
Feature type: wkbPoint with 3 dimensions
(seems OK?)

When I did
 plot(nc_state, axes=TRUE)
 plot(precip30n, add=TRUE, lwd=2, col=brown)
Error: object 'precip30n' not found
Error in plot(precip30n, add = TRUE, lwd = 2, col = brown) :
  error in evaluating the argument 'x' in selecting a method for function
'plot'
THe last plot gave that error

But would you say that it seems to be working?

Thank you all for your help and support
Thanks
Kim


Question: Is there any known problem with GRASS and GDAL1.6.3?

2010/3/2 Kim Besson kimbesson1...@gmail.com


 Ok I reinstalled rgdal
 R CMD INSTALL rgdal

 And then:
 R
 library(spgrass6)

 Output:
 Loading required package: sp
 Loading required package: rgdal
 Geospatial Data Abstraction Library extensions to R successfully loaded
 Loaded GDAL runtime: GDAL 1.5.4, released 2009/01/07
 Path to GDAL shared files: /usr/share/gdal15
 Loaded PROJ.4 runtime: Rel. 4.6.1, 21 August 2008
 Path to PROJ.4 shared files: (autodetected)
 Loading required package: XML
 GRASS GIS interface loaded with GRASS version: 6.4.0svn
 and location: North-Carolina

 precip30 - readVECT6(precip_30ynormals, ignore.stderr=TRUE)
 ERROR: Incompatible library version for module. You need to rebuild GRASS
or untangle multiple installations.

 Same error.
 I'm running GRASSsvn6.4.0, from latest week, in a Linux Machine with:
 rgdal_0.6-10
 spgrass6_0.6-15.
 R version 2.9.2 (2009-08-24)

 Any idea of what might not be compatible?

 Thank you
 Kim

 2010/3/2 Markus Neteler nete...@osgeo.org

 2010/3/2 Kim Besson kimbesson1...@gmail.com:

  Ok I have just installed latest GRASS snapshot and I got the following
 error
  precip30n - readVECT6(precip_30ynormals, ignore.stderr=TRUE)
  ERROR: Incompatible library version for module. You need to rebuild
 GRASS
 or untangle multiple installations.
  What I would like to know is the versions of R and spgrass6 that I
 should
  install on my system in order to not get this errors?

 You also need to update the GRASS-GDAL plugin.

 Markus



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


Re: [GRASS-user] R-GDAL incompatible libraries

2010-03-02 Thread Kim Besson
EHEHE this is true inglorious. Me and Gilbert were trying to compile and put
this working and a simple typo was our final error.
Thanks. Now it's working

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


[GRASS-user] R-GDAL incompatible libraries

2010-03-01 Thread Kim Besson
Greetings

I have just installed R, spgrass6, rgdal into my Ubuntun installation.
While I was running an example from GRASS book I got this error
 precip30n - readVECT6(precip_30ynormals, ignore.stderr=TRUE)

ERROR: Incompatible library version for module. You need to rebuild GRASS
   or untangle multiple installations.

Where can I find an identification of the correct libraries versions.

Thank you

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


Re: [GRASS-user] Wxpython GUI in UBUNTU 9.10

2010-01-21 Thread Kim Besson
Hi
About GRASS-dev: I should install this version If  I want to develop
functions/modules in GRASS? Or the normal package is enough?

Ah as a Normal user, I guess.
Now I tried this command
sudo grass64 -wxpython.. and It worked... :(
Why do I need to be a super-user to run GRASS??



2010/1/20 Leo Hardtke leohard...@gmail.com

 Hi,
 the grass-dev version available at Synaptic package manager is 6.4.0-rc5-2.
 about the error... are entering grass as sudo? (sudo grass) or as a normal
 user?

 Leonardo

 Kim Besson escribió:

 Ciao Leonardo
 It was exacly what you were saying. :)

 Now I'm getting a different error, that I already sent to the mailing
 list.
 One question regarding grass version on karmic.
 - what is grass-dev that is available at Synaptic package manager?

 Thanks

 Kim

 2010/1/19 Leonardo Hardtke leohard...@gmail.com mailto:
 leohard...@gmail.com


Hi!
I'm using the same grass version on Mint 8 (=karmik) without
problems, check if  python-wxgtk2.8 is installed in your system.

leo

2010/1/19 Kim Besson kimbesson1...@gmail.com
mailto:kimbesson1...@gmail.com


Hello All

I'm a nçew user of GRASS and I have downloaded grass
(6.4.0~rc5-2) for i386 architecture
from http://packages.ubuntu.com/karmic/grass.

as far as I can see GRASS by command line is working. Now the
problem seems to be wxpython
grass64 -wxpython I get this error:

Starting GRASS ...
Traceback (most recent call last):
  File /usr/lib/grass64/etc/wxpython/gis_set.py, line 33, in
module
from gui_modules import globalvar
  File
/usr/lib/grass64/etc/wxpython/gui_modules/globalvar.py, line
55, in module
CheckForWx()
  File
/usr/lib/grass64/etc/wxpython/gui_modules/globalvar.py, line
44, in CheckForWx
except (ImportError, ValueError, wxversion.VersionError), e:
UnboundLocalError: local variable 'wxversion' referenced
before assignment
Error in GUI startup. If necessary, please
report this error to the GRASS developers.
Switching to text mode now.
Hit RETURN to continue...


Can anyone help me on this?

By the way, If I want to update my GRASS installation I just
have to download a weekly snapshot ans install/Make it?

Thanks

Best regards,Kim

___
grass-user mailing list
grass-user@lists.osgeo.org mailto:grass-user@lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/grass-user




--Lic. Leonardo A. Hardtke  Laboratorio de Teledetección y
 S.I.G.  Centro Nacional Patagónico (CONICET)
Bvd. Brown 2825, 9120
Puerto Madryn, Chubut, Argentina




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


Re: [GRASS-user] Wxpython GUI in UBUNTU 9.10

2010-01-21 Thread Kim Besson
Hi all
Leonardo suggested me to run as sudo grass64 -wxpython and it worked.
Why do I need to run as SUDO to fix this?

2010/1/20 Hamish hamis...@yahoo.com

 Kim wrote:
  ok Now it's working
  but I got another ERROR and I guess this one has nothing to
  do with WXpython.
  An error windows stating
 
  ERROR in command
  execution g.region
  Unable to get current geographic extent. Force quiting wxGUI.
  Please run manually g.region to fix the problem.
 
  When I press ok the window and GUI closes and it get back to
  TERMINAL.
 
  Any tips of what is
  happening?

 can you start up in text mode ('grass64 -text', then esc-enter)
 and run 'g.region -p' from the command line?

 (typically this error means a mis-match in the GDAL install
 version, but you have to run g.region from the command line
 to see the real error message  find out. [devs: why can't the
 GUI propgate the g.region error message for us?])


 Hamish





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


Re: [GRASS-user] Wxpython GUI in UBUNTU 9.10

2010-01-20 Thread Kim Besson
Hello

Ok my bad. I didn't have python-wxgtk2.8 installed.

ok Now it's working but I got another ERROR and I guess this one has nothing
to do with WXpython.
An error windows stating
*ERROR in command execution g.region*
Unable to get current geographic extent. Force quiting wxGUI. Please run
manually g.region to fix the problem.

When I press ok the window and GUI closes and it get back to TERMINAL.

Any tips of what is happening?

Kim







2010/1/19 Hamish hamis...@yahoo.com

  Kim Besson wrote:
   I'm a new user of GRASS and I have downloaded grass (6.4.0~rc5-2) for
  i386 architecture from http://packages.ubuntu.com/karmic/grass.
 
   as far as I can see GRASS by command line is working.
   Now the problem seems to be wxpython

 Micha wrote:
  Check if you have installed the package python-wxversion:
  mi...@rms:~$ dpkg -l | grep wxversion
  ii  python-wxversion2.8.10.1-0ubuntu1

 The 6.4 GRASS package there only Suggests python-wxgtk2.8 (which
 depends on python-wxversion), it isn't a mandatory requirement (tcl is).
 Maybe we should bump that up to recommends.

 you might have a look at the other optional packages at
   http://packages.ubuntu.com/karmic/grass
 and decide if you want to install them too.


 (sure, it could fail in a cleaner way too!)


 Hamish





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


[GRASS-user] Wxpython GUI in UBUNTU 9.10

2010-01-19 Thread Kim Besson
Hello All

I'm a new user of GRASS and I have downloaded grass (6.4.0~rc5-2) for i386
architecture from http://packages.ubuntu.com/karmic/grass.

as far as I can see GRASS by command line is working. Now the problem seems
to be wxpython
grass64 -wxpython I get this error:

Starting GRASS ...
Traceback (most recent call last):
  File /usr/lib/grass64/etc/wxpython/gis_set.py, line 33, in module
from gui_modules import globalvar
  File /usr/lib/grass64/etc/wxpython/gui_modules/globalvar.py, line 55, in
module
CheckForWx()
  File /usr/lib/grass64/etc/wxpython/gui_modules/globalvar.py, line 44, in
CheckForWx
except (ImportError, ValueError, wxversion.VersionError), e:
UnboundLocalError: local variable 'wxversion' referenced before assignment
Error in GUI startup. If necessary, please
report this error to the GRASS developers.
Switching to text mode now.
Hit RETURN to continue...


Can anyone help me on this?

By the way, If I want to update my GRASS installation I just have to
download a weekly snapshot ans install/Make it?

Thanks

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