Combining 2d rasters to 3d using point files

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Combining 2d rasters to 3d using point files

Francois Chartier
Hi 

I would like to combine potentially 100s of 2d rasters into one 3d raster. 

Instead of using r.to.rast3 which could take a long time to prepare the setting, is there a way to export the raster as point files, and combine them using for example MsAccess, and then reimporting them into one 3d raster file?  

Alternatively, is it possible to combine several 3d raster into one 3d raster?  i could combine ten 2d rasters into one and then combine the multiple 3d rasters into one larger one. 

thks
F


_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Combining 2d rasters to 3d using point files

Francois Chartier
Are there any ideas how to run this process in batch mode for example?

On Thu., Apr. 25, 2019, 21:40 Francois Chartier, <[hidden email]> wrote:
Hi 

I would like to combine potentially 100s of 2d rasters into one 3d raster. 

Instead of using r.to.rast3 which could take a long time to prepare the setting, is there a way to export the raster as point files, and combine them using for example MsAccess, and then reimporting them into one 3d raster file?  

Alternatively, is it possible to combine several 3d raster into one 3d raster?  i could combine ten 2d rasters into one and then combine the multiple 3d rasters into one larger one. 

thks
F


_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
SBL
Reply | Threaded
Open this post in threaded view
|

Re: Combining 2d rasters to 3d using point files

SBL

From: grass-user <[hidden email]> on behalf of Francois Chartier <[hidden email]>
Sent: Wednesday, May 1, 2019 2:00:12 PM
To: GRASS user list
Subject: Re: [GRASS-user] Combining 2d rasters to 3d using point files
 
Are there any ideas how to run this process in batch mode for example?

On Thu., Apr. 25, 2019, 21:40 Francois Chartier, <[hidden email]> wrote:
Hi 

I would like to combine potentially 100s of 2d rasters into one 3d raster. 

Instead of using r.to.rast3 which could take a long time to prepare the setting, is there a way to export the raster as point files, and combine them using for example MsAccess, and then reimporting them into one 3d raster file?  

Alternatively, is it possible to combine several 3d raster into one 3d raster?  i could combine ten 2d rasters into one and then combine the multiple 3d rasters into one larger one. 

thks
F


_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Combining 2d rasters to 3d using point files

Moritz Lennert
In reply to this post by Francois Chartier
On 26/04/19 03:40, Francois Chartier wrote:

> Hi
>
> I would like to combine potentially 100s of 2d rasters into one 3d raster.
>
> Instead of using r.to.rast3 which could take a long time to prepare the
> setting, is there a way to export the raster as point files, and combine
> them using for example MsAccess, and then reimporting them into one 3d
> raster file?
>
> Alternatively, is it possible to combine several 3d raster into one 3d
> raster?  i could combine ten 2d rasters into one and then combine the
> multiple 3d rasters into one larger one.

If Stefan's suggestion does not help, and if each 2D raster is of one
constant height, you could try a combination of r.out.xyz and r3.in.xyz
with some magic in between to include a z. Here's an uncomplete and
untested algorithm for Linux in

height = 0

for each raster:
        height = height + step
        r.out.xyz raster out=- | awk -v var=$height -F'|' '{print
$1,$2,var,$3}' >> combined_raster

then

r3.in;xyz combined_raster


Moritz

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Combining 2d rasters to 3d using point files

Francois Chartier
I am doing it manually for now, picking the files one by one, but i have come up with a way to make a string of text in excel for each raster elevation and combining into one and then pasting into grass module.  i will send results this wkd, and i will try your recom.

On Fri., May 3, 2019, 08:54 Moritz Lennert, <[hidden email]> wrote:
On 26/04/19 03:40, Francois Chartier wrote:
> Hi
>
> I would like to combine potentially 100s of 2d rasters into one 3d raster.
>
> Instead of using r.to.rast3 which could take a long time to prepare the
> setting, is there a way to export the raster as point files, and combine
> them using for example MsAccess, and then reimporting them into one 3d
> raster file?
>
> Alternatively, is it possible to combine several 3d raster into one 3d
> raster?  i could combine ten 2d rasters into one and then combine the
> multiple 3d rasters into one larger one.

If Stefan's suggestion does not help, and if each 2D raster is of one
constant height, you could try a combination of r.out.xyz and r3.in.xyz
with some magic in between to include a z. Here's an uncomplete and
untested algorithm for Linux in

height = 0

for each raster:
        height = height + step
        r.out.xyz raster out=- | awk -v var=$height -F'|' '{print
$1,$2,var,$3}' >> combined_raster

then

r3.in;xyz combined_raster


Moritz


_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user