[Qgis-user] DEM error with OpenDataNRW
Nicolas Cadieux
njacadieux.gitlab at gmail.com
Tue Nov 17 08:57:42 PST 2020
Indeed,
I believe this would be the Python code for a 2x6 raster.
import numpy
row = numpy.array([[0,0,-1],[0,1,-3],[0,2,-5],[1,0,-2],[1,1,-4],[1,2,-6]])
print (row)
col = numpy.array([[0,0,-1],[1,0,-2],[0,1,-3],[1,1,-4],[0,2,-5],[1,2,-6]])
print(col)
new_col = row.reshape(2,3,3).transpose(1,0,2).reshape(-1,3)
print(new_col)
Nicolas Cadieux
https://gitlab.com/njacadieux
On 2020-11-16 2:28 p.m., qgis-user at stripfamily.net wrote:
> On 11/16/2020 12:09 PM, Prof. Dr. Martin Berchtold wrote:
>> The NRW data sort the other way round (see below). So I probably
>> âjustâ will have to rearrange Y and X in the NRW data to get it ready
>> ⦠⦠⦠Yes, works! Cool.
> Â At the risk of stating the obvious, you could transpose the matrix
> with just a few lines of Python or R.
More information about the Qgis-user
mailing list