Wednesday, 13 September 2017

How to create a 3D shapefile with QGIS from values stored in the attribute table


I have a shapefile containing buildings represented as polygons (basically the area of the buildings).



In the attribute table there is a field where the elevation of every building is stored (every building/polygon as a different elevation). Elevations are stored as decimal numbers.


What I am trying to do, is to convert this 2D shapefile in a 3D shapefile using the elevations stored in the "z" field of the shapefile.


With ArcGis it is possible with the tool Feature to 3D by attribute


I cannot find anything similar in QGIS.


I tried "save as" and then include "z dimension" but it does not prompt to choose a field where elevations are stored.


I also tried the v.extrude Grass command, but none of the field in the attribute table are shown to select from as height field.


Is it possible with QGIS/Grass to do this?


My final goal is to obtain buildings as 3D objects.



Answer



I guess if you have None as a value for the v.extrude command, it's because your data is not in the right format (string instead of real for example). See below, it works for me :



v.extrude


In case you need, GRASS has a v.to.3d command that transforms 2d vectors to 3d vectors. It'll pass Point into PointZ or Polygon to PolygonZ.



v.to.3d - Performs transformation of 2D vector features to 3D.



See https://grass.osgeo.org/grass72/manuals/v.to.3d.html


v.to.3d


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...