0
votes

I got a * .txt file with xyz coordinates. I importet the data and create three lists for x,y and z. Now I want to generate a grid over all Points with a gridcell for example by 1x1 m. I want to get, the lowest z-value in each of the cells und generate a Digital Elevation Model (DEM) of this z-values. I do this before in the software Arcmap (see picture). Because of the huge number of Points (over 20 Million) its take very long .The Process step by step: 1. Import data an get a list of x,y,z (allready done) 2. Create grids over the Points (for example 1x1 m) 3. Intersect the grid with Points 4. Get the lowest z-value of every cell 5. Generate a DEM of the lowest z-value enter image description here

1
How is your grid represented, and you mention a grid with 100 cells, but you want to know which points are in which grid as if there's more than one grid. Could you clarify (preferably with some code)? - zondo
I got a * .txt file with xyz coordinates. I importet the data and create three lists for x,y and z. Now I want to generate a grid over all Points with a gridcell for example by 1x1 m. I want to get, the lowest z-value in each of the cells und generate a Digital Elevation Model (DEM) of this z-values. I do this before in the software Arcmap (see picture). Because of the huge number of Points (over 20 Million) its take very long . - Ruhi
The Process step by step: 1. Import data an get a list of x,y,z (allready done) 2. Create grids over the Points (for example 1x1 m) 3. Intersect the grid with Points 4. Get the lowest z-value of every cell 5. Generate a DEM of the lowest z-value - Ruhi

1 Answers

0
votes

Have you tried np.meshgrid function?

x_ = np.linspace(0., 1., 10)
y_ = np.linspace(1., 2., 20)
z_ = np.linspace(3., 4., 30)

x, y, z = np.meshgrid(x_, y_, z_, indexing='ij')

There are example numbers you can create your own grid