[GRASS-user] 2D - 3D raster intersection

Hello everybody,

I have a 3D raster and several 2D elevation rasters. Is it possible to perform somehow (within GRASS, or outside) intersection betwwen the 2D and 3D rasters and get 2D raster with values of the 3D rasters where they are intersected?

Tomas
GRASS 6.3 CVS, 2.2, Ubuntu 7.10 Gutsy

Using Matlab (or octave):

n=1;index=zeros(prod(dim(rast2d)),3)
for [i j]=1:dim(rast2d,[1 2])
  k=round(rast2d(i,j))
  index(n,:)=[i j k]
end
answer=rast3d(index)

Boris

On Nov 17, 2007 6:14 PM, Tomas Lanczos <lanczos@t-zones.sk> wrote:

Hello everybody,

I have a 3D raster and several 2D elevation rasters. Is it possible to
perform somehow (within GRASS, or outside) intersection betwwen the 2D
and 3D rasters and get 2D raster with values of the 3D rasters where
they are intersected?

Tomas
GRASS 6.3 CVS, 2.2, Ubuntu 7.10 Gutsy

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hello,

thank You Boris, it is something new for me, how can I integrate octave to grass? is there a tutorial for that?

thank You

Tomas

Boris Avdeev wrote:

Using Matlab (or octave):

n=1;index=zeros(prod(dim(rast2d)),3)
for [i j]=1:dim(rast2d,[1 2])
  k=round(rast2d(i,j))
  index(n,:)=[i j k]
end
answer=rast3d(index)

Boris

On Nov 17, 2007 6:14 PM, Tomas Lanczos <lanczos@t-zones.sk> wrote:

Hello everybody,

I have a 3D raster and several 2D elevation rasters. Is it possible to
perform somehow (within GRASS, or outside) intersection betwwen the 2D
and 3D rasters and get 2D raster with values of the 3D rasters where
they are intersected?

Tomas
GRASS 6.3 CVS, 2.2, Ubuntu 7.10 Gutsy

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Tomas Lanczos wrote:

Hello,

thank You Boris, it is something new for me, how can I integrate octave to grass? is there a tutorial for that?

No, I think you have to export your map with r.out.mat and then use the result in matlab.

However, maybe r3.cross.rast can do the trick for you directly in GRASS ?

Moritz

thank You

Tomas

Boris Avdeev wrote:

Using Matlab (or octave):

n=1;index=zeros(prod(dim(rast2d)),3)
for [i j]=1:dim(rast2d,[1 2])
  k=round(rast2d(i,j))
  index(n,:)=[i j k]
end
answer=rast3d(index)

Boris

On Nov 17, 2007 6:14 PM, Tomas Lanczos <lanczos@t-zones.sk> wrote:

Hello everybody,

I have a 3D raster and several 2D elevation rasters. Is it possible to
perform somehow (within GRASS, or outside) intersection betwwen the 2D
and 3D rasters and get 2D raster with values of the 3D rasters where
they are intersected?

Tomas
GRASS 6.3 CVS, 2.2, Ubuntu 7.10 Gutsy

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Tomas wrote:

>> I have a 3D raster and several 2D elevation rasters. Is it possible to
>> perform somehow (within GRASS, or outside) intersection betwwen the 2D
>> and 3D rasters and get 2D raster with values of the 3D rasters where
>> they are intersected?

maybe some hints here: http://grass.gdf-hannover.de/wiki/Help_with_3D
r3.mapcalc?

Boris Avdeev wrote:
> Using Matlab (or octave):
>
> n=1;index=zeros(prod(dim(rast2d)),3)
> for [i j]=1:dim(rast2d,[1 2])
> k=round(rast2d(i,j))
> index(n,:)=[i j k]
> end
> answer=rast3d(index)

Boris Avdeev wrote:
> Using Matlab (or octave):
>
> n=1;index=zeros(prod(dim(rast2d)),3)
> for [i j]=1:dim(rast2d,[1 2])
> k=round(rast2d(i,j))
> index(n,:)=[i j k]
> end
> answer=rast3d(index)

Tomas Lanczos wrote:

thank You Boris, it is something new for me, how can I integrate octave
to grass? is there a tutorial for that?

Transfer raster maps with r.in.mat and r.out.mat. Transfer vector data with
'v.in.mapgen -f' (or v.in.ascii), and 'v.out.ascii format=standard' (plus a few
lines of matlab code).

Hamish

      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs