[GRASS-dev] Extracting coordinates of RasterNumpy objects (pygrass)

Sören Gebbert soerengebbert at googlemail.com
Mon Dec 17 13:11:08 PST 2012


Hi Pierre,
in pygrass you can find the function pixel2coor((col, row), region)
that will transform your column and row into a (northing, easting)
tuple. It is defined in pygrass/functions.py . Internally
Rast_row_to_northing() and Rast_col_to_easting() from the GRASS raster
library are used.

Best regards
Soeren

2012/12/17 Pierre Roudier <pierre.roudier at gmail.com>:
> Hi,
>
> I am using (with enthusiasm!) Pietro's pygrass library to develop a raster
> module. I am using Numpy/Scipy as my working horse, so I manipulate a lot of
> the RasterNumpy objects that have been introduced with pygrass.
>
> In a specific step, I am identifying pixels using a test (this would be
> similar to my_array <  100). I would like to extract the points that satisfy
> the test, and access not only their values and index in the array, but I
> would also go back to their coordinates to extract them as (x, y, z).
>
> Is there a way to do this using RasterNumpy and pygrass?
>
> Cheers,
>
> Pierre
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev


More information about the grass-dev mailing list