Re: raster map from coordinates in python

Stefan Blumentrath <[email protected]>
Newsgroups gmane.comp.gis.grass.user
Message-ID <HE1PR02MB12115D62E831242A07F4741B9EF70@HE1PR02MB1211.eurprd02.prod.outlook.com>
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 can be replaced with BytesIO BTW, though I don`t know what difference the two make...
Cheers
Stefan


From: grass-user [mailto:[email protected]] On Behalf Of Stefan Blumentrath
Sent: mandag 12. februar 2018 14.42
To: grass-user grass-user ([email protected]) <[email protected]>
Subject: [GRASS-user] raster map from coordinates in python

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 (separated by space) and rows separated by '\n'...
Any hints on how to accomplish that without writing out stuff to a textfile?

Cheers
Stefan

_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.