[GRASS-dev] grass6 and python array

Hi All,

do you know if the nice ability to import grass maps
directly in a numpy array (as already in grass7)
will be backported to grass6 too ?

thanks!

Massimo.

Massimo Di Stefano wrote:

do you know if the nice ability to import grass maps
directly in a numpy array (as already in grass7)
will be backported to grass6 too ?

The grass.script.array module in GRASS 7 relies upon some changes
which were made to r.in.bin and r.out.bin, so it can't be used as-is.

It could be modified to work with the 6.x versions, although it would
require some changes. The main issues with the 6.x versions are:

1. You can't choose the output format (other than forcing integer
output with -i). The output is in the same format as the map, so you
would need to use "r.info -t ..." to determine the format of the data.

2. Integers are truncated to 16 bits.

--
Glynn Clements <glynn@gclements.plus.com>

Hi Glynn,

thanks for your help!

Il giorno 10/mag/2010, alle ore 09.17, Glynn Clements ha scritto:

Massimo Di Stefano wrote:

do you know if the nice ability to import grass maps
directly in a numpy array (as already in grass7)
will be backported to grass6 too ?

The grass.script.array module in GRASS 7 relies upon some changes
which were made to r.in.bin and r.out.bin, so it can't be used as-is.

It could be modified to work with the 6.x versions, although it would
require some changes. The main issues with the 6.x versions are:

1. You can't choose the output format (other than forcing integer
output with -i). The output is in the same format as the map, so you
would need to use "r.info -t ..." to determine the format of the data.

2. Integers are truncated to 16 bits.

i'll try an other way to store map data into an array,
i can use directly python-gdal, but i'll try to find a grass way to do the same

--
Glynn Clements <glynn@gclements.plus.com>