[GRASS-user] Getting raster cell coordinates

Yann Chemin yann.chemin at gmail.com
Thu May 2 05:00:31 PDT 2013


Are you using pygrass?
On May 2, 2013 5:10 PM, "Allar Haav" <allar.haav at gmail.com> wrote:

> Hi,
>
> What would be the most efficient way of getting the coordinates for each
> input raster cell? I'm using this in a Python script that creates a
> separate cost surface (using r.cost) for each cell (yes, that is
> computationally intensive thing indeed, but that's not a problem itself).
> I've been using a simple function I made that creates a list of coordinates
> via iteration starting from the region corner and using cellsize as a step.
> But this does not check for null-values in the raster (which I would like
> to exclude) and I'm also not very sure how it would play out with some
> coordinate systems. One way to solve the null-value issue would be to
> impose an r.what check, but this does not seem to be very elegant way to do
> it.
> Any suggestions? I'm more or less comfortable with using ctypes, so that
> route would perhaps be the best in terms of performance.
>
> Regards,
> Allar
> ______________________________**_________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/grass-user<http://lists.osgeo.org/mailman/listinfo/grass-user>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130502/57884b89/attachment.html>


More information about the grass-user mailing list