Re: [GRASS-user] add a centroid in the center of polygon

2014-01-27 Thread Moritz Lennert

On 25/01/14 12:52, Markus Metz wrote:

On Sat, Jan 25, 2014 at 12:27 PM, Markus Neteler nete...@osgeo.org wrote:

On Sat, Jan 25, 2014 at 12:08 PM, Markus Metz
markus.metz.gisw...@gmail.com wrote:

On Sat, Jan 25, 2014 at 12:10 AM, Milton Ribeiro
miltinho.astrona...@gmail.com wrote:

Dear all,

I have a polygon vector, and need to add point in the center of mass of each
one.
I used v.centroid, but it adds just a centroid, but not in the central
position of the polygon area.


v.centerpoint from addons [0] does that.

Markus M

[0] http://grasswiki.osgeo.org/wiki/AddOns/GRASS7/vector#v.centerpoint


Right, I forgot about this nice addon!
Perhaps its functionality might be merged into v.centroids [1]?


No, because the center of mass is not always within the area.


But couldn't that be a documented flag (e.g. something like this: 
'always place centroid within the area (for GRASS polygon)').


Personally, I support MarkusN's idea of merging the two, if that's 
possible from the code point of view. I find it more intuitive to look 
for a module creating centroids...


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


[GRASS-user] Transforming raster lines to vectors with correct segment attributes

2014-01-27 Thread Johannes Radinger
Hi,

I have a raster river (processed with r.thin) which I want to transfrom to
a vector.
Therefore I use r.to.vect with the lines option. However, the raster has
two different
values representing e.g. habitat quality (good/bad) for single segments
(group of raster cells). This information is written strangely to the
vector attribute table as the lines
are not broken at changes of habitat quality which is a reasonable
behaviour of r.to.vect.

As I need the attributes in my vector table I thought about splitting the
vector into
small segments (raster resolution) and updating the attribute table with
v.what.rast. However when I use v.split the attribute table of the created
map still has the same number of entries than before. So what do I miss
here to get single rows and thus categories for the single created lines
from v.split?

Or is there any other/better way for such transformation of raster lines to
vector lines incl. an update of the attribute table?

Best regards,

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

[GRASS-user] Python script works with Qgis but not in Grass

2014-01-27 Thread Davide Sponchiado

Hello to everyone,

i got Windows 8 with QGIS Dofour 2.0.1 e Grass 6.4.3 on my PC.

I got no problem when i run my script on Qgis but i need to fix some 
problems inside it and Qgis doesn't show you any log errors so i need to 
use Grass.

When i launch it some errors happens:

Launching script 'C:\Program Files\QGIS 
Dufour\apps\grass\grass-6.4.3\etc\gui\scripts\v.grass2hec_rev.py'...

Exception in thread Thread-75:
Traceback (most recent call last):
  File
C:\PROGRA~1\QGISDU~1\apps\Python27\lib\threading.py, line
808, in __bootstrap_inner
self.run()
  File C:\PROGRA~1\QGISDU~1\apps\grass\grass-6.4.3\etc\wxpy
thon\gui_core\goutput.py, line 126, in run
self.resultQ.put((requestId, self.requestCmd.run()))
  File C:\PROGRA~1\QGISDU~1\apps\grass\grass-6.4.3\etc\wxpy
thon\core\gcmd.py, line 553, in run
env = env)
  File C:\PROGRA~1\QGISDU~1\apps\grass\grass-6.4.3\etc\wxpy
thon\core\gcmd.py, line 164, in __init__
subprocess.Popen.__init__(self, args, **kwargs)
  File
C:\PROGRA~1\QGISDU~1\apps\Python27\lib\subprocess.py, line
711, in __init__
errread, errwrite)
  File
C:\PROGRA~1\QGISDU~1\apps\Python27\lib\subprocess.py, line
948, in _execute_child
startupinfo)
TypeError: environment can only contain strings

First of all I uninstall and reinstall Qgis and Grass many times trying 
to understand if the problem was in the x86 version or in some registry 
forgot in the previous versions (i control the regedit deleting manually 
all the files i thought related to Qgis and Grass).
Then, i remembered that I installed Python one month ago (not in the 
same folder), then i uninstall it.
I fear to forgot some other registry but nothing is shown directly in 
the registry. All the Python27 are deleted.


Now i reinstall QGIS and Grass (version i told before) but still it 
doesn't work.


Really need a big help.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] how to draw line with arrow mark to line top (tip)

2014-01-27 Thread Hamish


sgw00...@nifty.com a écrit :
 I do not find how to draw line with arrow mark to line top (tip).


I'm not sure if it matches your needs or not, but see also d.rast.arrow and the 
d.barb addon (d.barb can take either raster or vector maps as input); for a 
single arrow symbol the d.mark addon script might help.


Hamish

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


[GRASS-user] Python script works with Qgis but not in Grass

2014-01-27 Thread Enrico Gallo
Dear list,

this problem has already reported for grass 7 [0] (still without a solution?)

I am not a Python expert, but accordind to [1] the problem seems due
to Unicode string management.

Davide, I suppose the script path used with Grass is:something like this:

C:\[...]\QGIS Dufour\apps\grass\grass-6.4.3\etc\gui\scripts

but probabliy this is not the same path where you put the same script
in order to use QGIS scripting interface, right?

List, any hint to check startupinfo values before launching the script ?
Could we avoid Unicode strings or force it to right values as in [2] ?

HTH

Enrico



[0] http://lists.osgeo.org/pipermail//grass-user/2013-October/069019.html
[1] https://mail.python.org/pipermail/python-win32/2010-April/010400.html
[2] https://github.com/SeleniumHQ/selenium/pull/54/files
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] R: Python script works with Qgis but not in Grass

2014-01-27 Thread davidesponchi...@alice.it


Directory 'C:\Users\Davide\Documents\ is not defined in 
GRASS_ADDON_PATH. Do you want add this directory to GRASS_ADDON_PATH?
I think that's what you meaning...




Messaggio originale
Da: enrico.ga...@gmail.com
Data: 27-gen-2014 13.52
A: GRASS user listgrass-user@lists.osgeo.org
Ogg: [GRASS-user] Python script works with Qgis but not in Grass

Dear list,

this problem has already reported for grass 7 [0] (still without a solution?)

I am not a Python expert, but accordind to [1] the problem seems due
to Unicode string management.

Davide, I suppose the script path used with Grass is:something like this:

C:\[...]\QGIS Dufour\apps\grass\grass-6.4.3\etc\gui\scripts

but probabliy this is not the same path where you put the same script
in order to use QGIS scripting interface, right?

List, any hint to check startupinfo values before launching the script ?
Could we avoid Unicode strings or force it to right values as in [2] ?

HTH

Enrico



[0] http://lists.osgeo.org/pipermail//grass-user/2013-October/069019.html
[1] https://mail.python.org/pipermail/python-win32/2010-April/010400.html
[2] https://github.com/SeleniumHQ/selenium/pull/54/files
___
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] add a centroid in the center of polygon

2014-01-27 Thread Milton Ribeiro
Hi Moritz

I agree that a flag would be a good way ..
Best wishes

miltinho

2014-01-27, Moritz Lennert mlenn...@club.worldonline.be:
 On 25/01/14 12:52, Markus Metz wrote:
 On Sat, Jan 25, 2014 at 12:27 PM, Markus Neteler nete...@osgeo.org
 wrote:
 On Sat, Jan 25, 2014 at 12:08 PM, Markus Metz
 markus.metz.gisw...@gmail.com wrote:
 On Sat, Jan 25, 2014 at 12:10 AM, Milton Ribeiro
 miltinho.astrona...@gmail.com wrote:
 Dear all,

 I have a polygon vector, and need to add point in the center of mass of
 each
 one.
 I used v.centroid, but it adds just a centroid, but not in the central
 position of the polygon area.

 v.centerpoint from addons [0] does that.

 Markus M

 [0] http://grasswiki.osgeo.org/wiki/AddOns/GRASS7/vector#v.centerpoint

 Right, I forgot about this nice addon!
 Perhaps its functionality might be merged into v.centroids [1]?

 No, because the center of mass is not always within the area.

 But couldn't that be a documented flag (e.g. something like this:
 'always place centroid within the area (for GRASS polygon)').

 Personally, I support MarkusN's idea of merging the two, if that's
 possible from the code point of view. I find it more intuitive to look
 for a module creating centroids...

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



-- 
Miltinho - m...@rc.unesp.br
Laboratório de Ecologia Espacial e Conservação - LEEC
Depto de Ecologia - UNESP - Rio Claro
Av. 24A, 1515- Bela Vista
13506-900 Rio Claro, SP, Brasil

Fone: +55 19 3526-9647 (office)  19 3526-9680 (lab)
Cel: 19 9853-3220 / 19 9853-5430

Depto Ecologia http://ib.rc.unesp.br/#!/departamentos/ecologia/
PG ECO  BIODIV
http://ib.rc.unesp.br/#!/departamentos/ecologia/pos-graduacao-em-ecologia-e-biodiversidade/

CV
http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4792988H6mostrarNroCitacoesISI=truemostrarNroCitacoesScopus=true

Google citations http://scholar.google.com/citations?user=OWX_2eAJ
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user