[GRASS-user] python parse_command

2018-02-12 Thread Jonathan Reith
 Dear list, I am struggling with my python code. I am trying to get the computational region of a xyz-file. If I use r.in.xyz in GRASS itself, it works all just fine, but using it in python I always get an error. Here is my code: from grass_session import Session from grass.script import

[GRASS-user] raster map from coordinates in python

2018-02-12 Thread Stefan Blumentrath
Dear all, I have a numpy array with x,y, z coordinates that I would like to write to a rater map. When I convert the array to a StringIO-object and feed it to r.in.xyz I get: OSError: [Errno 7] Argument list too long I checked the content of the StringIO object and it contains only three columns

Re: [GRASS-user] python parse_command

2018-02-12 Thread Pietro
Dear Jonathan, the error is due to grass_session that is not creating the location if missing. I don't have time in this day to fix this issue in grass_session, so the fastest fsolution at the momenth is to check and create what is needed step by step. I did not have xyz file to test so I've only

Re: [GRASS-user] python parse_command

2018-02-12 Thread Anna Petrášová
Isn't the problem that you have there r.in_xyz instead of r.in.xyz? Anna On Feb 12, 2018 9:35 AM, "Pietro" wrote: Dear Jonathan, the error is due to grass_session that is not creating the location if missing. I don't have time in this day to fix this issue in grass_session, so the fastest fsol

Re: [GRASS-user] LSMetrics - addon development

2018-02-12 Thread Bernardo Santos
Dear Moritz,  thanks for the answer and the examples. I'll try to put the functions and files in this format and test them like that.I am not sure how to build these makefile files but I'll try to follow the patterns I find in the other examples of modules.Once this is done, I'll post it here.

Re: [GRASS-user] v.generalize failing on some geoms

2018-02-12 Thread Paolo Cavallini
Il 11/02/2018 18:34, Markus Metz ha scritto: > This implies that the data have been reprojected at some stage somewhere > from one SRS to the other. The most likely explanation for the different > results, particularly the topological errors reported by v.in.ogr, is > that non-topological polygons

Re: [GRASS-user] raster map from coordinates in python

2018-02-12 Thread Stefan Blumentrath
OK, found it! Reading the manuals more carefully helps: So, with my StringIO object "result", formated x y z, the following works: grass.write_command('r.in.xyz', stdin=result.getvalue(), input='-', output=output, method='mean', separator=' ') StringIO c

Re: [GRASS-user] Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

2018-02-12 Thread Dinarzarde Raheem
Hi Helmut, I have been installing r.vif as you have indicated (i.e. by downloading from the server using g.extension and opening the tree of installable raster addons), but can now confirm after installing both the new and old versions of r.vif on a Windows 10 (64 bit) machine, that r.vif isn't

Re: [GRASS-user] raster map from coordinates in python

2018-02-12 Thread Nikos Alexandris
* Stefan Blumentrath [2018-02-12 19:41:15 +]: StringIO can be replaced with BytesIO BTW, though I don`t know what difference the two make... Out of curiosity I did a search. https://stackoverflow.com/a/37463095 Nikos [..] signature.asc Description: PGP signature _

Re: [GRASS-user] v.generalize failing on some geoms

2018-02-12 Thread Markus Metz
On Mon, Feb 12, 2018 at 6:22 PM, Paolo Cavallini wrote: > > Il 11/02/2018 18:34, Markus Metz ha scritto: > > > This implies that the data have been reprojected at some stage somewhere > > from one SRS to the other. The most likely explanation for the different > > results, particularly the topolog

Re: [GRASS-user] Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

2018-02-12 Thread Paulo van Breugel
Hi Dinarzarde and Helmut I checked on Windows (grass 7.4.0 installed using osgeo4w), and installing r.vif using g.extension works fine, but after installing it does not appear in the addon list in the Modules tab. The same is true for a number of other addons I installed. There are, on the oth

Re: [GRASS-user] Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

2018-02-12 Thread Dinarzarde Raheem
Many thanks Paulo and Helmut. Have an osgeo4w installation of grass 7.4.0, so will run it on the console. Best wishes, Dinarzarde From: Paulo van Breugel [p.vanbreu...@gmail.com] Sent: 12 February 2018 23:45 To: Dinarzarde Raheem; Helmut Kudrnovsky Cc: gr

Re: [GRASS-user] raster map from coordinates in python

2018-02-12 Thread Stefan Blumentrath
Thanks, Nikos! Interesting! Not 100% sure though, how to conclude from that post. One voice there says "the two are not comparable one should use BytesIO, when input data is bytes, and StringIO when Input data is string". However in the this case, both seem suitable. So, the performance comparison