[GRASS-user] 2D to 3D vector polygon file

Markus Neteler neteler at osgeo.org
Mon Sep 15 04:58:03 EDT 2008


On Mon, Sep 15, 2008 at 10:38 AM, christian Brandt
<chrisbrandt74 at hotmail.com> wrote:
> Dear list,
>
> I have a 2D polygon file containing building data which is associated with
> height values (within attribute table). Is it possible to create a
> 3D-vector/raster file from that file. And how to do it? Hence I would like
> to drape it over a DEM both in 3D!
>
> Any suggestions?

Sure (example for North Carolina data set):

Note: v.extrude requires polygons as input to extrude to 3D house blocks:

 v.extract P079215 out=bldg_resid where="layer='BLDG_RESID_BL'"
 v.extract P079215 out=bldg_cmcl where="layer='BLDG_COMMER_BL'"

# convert lines to boundaries (may not be needed in your case)
# add centroids (may not be needed in your case):
 v.type bldg_resid out=bldg_resid_bnd type=line,boundary
 v.centroids bldg_resid_bnd out=bldg_resid_pol
 v.type bldg_cmcl out=bldg_cmcl_bnd type=line,boundary
 v.centroids bldg_cmcl_bnd out=bldg_cmcl_pol

# add height of the building:
 g.region rural_1m -p
 v.extrude -t bldg_resid_pol out=bldg_resid_3d height=10 \
              elev=el_D792_6m
 v.extrude -t bldg_cmcl_pol  out=bldg_cmcl_3d height=15 \
              elev=el_D792_6m

# showcase:
nviz elev_lid792_1m col=ortho_2001_t792_1m vect=bldg_resid_3d,bldg_cmcl_3d

The result should be similar to the lower right image in
http://www.grassbook.org/gallery/chapters/images.html

Markus


More information about the grass-user mailing list