Jump to content

Shapefile import from QGIS

J. Wallace

Recommended Posts

Hello Everyone, i hope you are all having a great day.

I have been trying to import a shapefile which was created (exported) in QGIS.

The shapefile has the elevation data within it but when I import this via Import Shapefile command I get contours but these are regular polylines.


When I've imported shapefiles in the past it's been a pretty stratighforward event.

Thanks in advance to any help.

Below images are screen shots from QGIS showing the elevation data, then on VW.



Shape file import.vwx

Link to comment

Would it be possible to share the actual shapefile?

When trying to set the coordinate system in blank file to the same EPSG code as in your VW file I get the error below in VW2022:

CPLErr( 3 ), err_no( 1 )

PROJ: utm: Invalid latitude


Despite that... the elevation is within an elevation field in the record Test1Rec but all lines have a Z value of 0 (zero). You may want to check your export settings to see if the elevation value is exported as a Z value as well, or assign the Z value to the polylines/polygons based on the Elevation attribute before exporting the shapefile. Then try importing again into VW and the lines should be at the proper elevation.


Or a workaround could be to reimport the data into QGIS and make sure the Elevation (Z value) is set by the ELEVATION attribute so that the lines do get a Z value that equals the value of the ELEVATION attribute.

When I import into BricsCAD using Spatial Manager and I can set the Z value bases on the ELEVATION attribute and it generates the lines at the Z value based on the ELEVATION attribute of the lines.


Attached are the files as VW2020 with the shapefiles generated as described hereafter imported into VW, dwg after importing the SHP from exporting from your VWX files into BricsCAD using Spatial Manager to generate the Z values for the lines as well as the SHP files exported again from BricsCAD/Spatial Manager with Z value assigned to the lines so you can test the import of the shapefiles to see if there might be a glitch.

3D terrain.dwg 3D terrain SHP files.zip 3D terrain v2020.vwx

Edited by Art V
Files added.
Link to comment

Just checked the SHP file. VW imports some of the polylines as groups of multiple lines. Maybe this is causing the issue.


When importing the shapefile into BricsCAD with Spatial Manager (with assigning the ELEVATION attribute as Z value) it says there are 235 objects that have been imported as 285 features due to the complexity (i.e. grouping) of some objects. Both QGIS and Global Mapper import it fine as well and also state that there are 285 features after import. Except for VW I get the polylines/polygons at Z-value i.e. as a 3D terrain after import of the SHP file.


It could be that QGIS somehow groups same elevation polylines and that VW is not splitting the objects back into separate polylines or VW is grouping those lines upon import and therefore may not be adding the Z value properly. But that is just a guess on my end. I suggest you have VW support take a look at this shapefile to see if this is the issue or that something else is going on that causes VW to not properly import the shapefile.

Edited by Art V
Link to comment

Wanted to add something here as a guess.

But 1st a problem. I have the qgis files in a folder with a new vwx file.  I can import the shp (comes in as 2d polys), and see a new Test1Rec record resource, but this record format has no items. No way for it to acquire data. Not sure why the folder of qgis files is not implanting the database when I import the shp file to a fresh vwx f ile. ???  Previous experience is that the shp file contains the db info.  Perhaps a vwx2022 thang?


When I open @J. Wallace vwx file, I see Test1Rec and testRec record resources - both have appropriate fields including ELEVATION.


Anyway a possible problem/solution: in @J. Wallace vwx file Record format resources, the data elevation fields are formatted as Number>General.  I think the elevation field value needs to be formatted as Number>Dimension in order for the 3d poly to respond to the record data.  This tripped me up one time when needing vwx to extrude a gob of building outlines to their various recorded heights.  Changing vwx data format from General to Dimension made the outlines extrude to the apex value from the shp data base.  No such luck here. These contours maintain their z=0 after the reformat from gen to dim. Rats!


Is there something to change in the QGIS db prior to export? Or some way to link the vwx elevation data record to the OIP Z value?  





Edited by Benson Shaw
Link to comment

@J. Wallace Not sure what your final goal is.  Are you trying to use the .shp to make a site model?


If so, I was able to import the shape file, use Select Similar to grab the groups, ungroup those groups, move the resulting 2Dpolys to their elevation by the record, and generate a site model.  No reformatting of the record type or anything beyond simply importing the .shp with the other related files in the same directory was required.  I didn't look at the results carefully, but it seems accurate and was really fast.  I can upload the file if it's helpful.



Edited by jeff prince
  • Like 2
Link to comment

@jeff prince Ummm, sorry to be so dense, but I'm not getting there.  Which file(s) did you import into vwx?


In past, I have found that the shp file holds (refs?) all the geometry and data from all the associated files in the folder (directory).  Import the shp, the contours arrive with attached records from a fully functional record format (the db). Perhaps I had to convert 2d to 3d.  But I don't recall how they achieved the correct z.  Automatic response to the record?


My trials:

New blank vwx in same directory as the Q files (5 of them). Import only the shp file. Result -  2d polys and groups on design layer, and a blank record format (no lines/items) in the RM.  Ungroup - everything is 2d polylines and polygons. The 2d polys have the record attached, but record contains no data.


OK, I start over in a blank file in same directory. Import only the db file (choose Options>All Files so that db can be selected).  Same bunch of 2d polys and groups arrives, plus the record format, this time with data. Yay!  Select all, Ungroup. Everything is 2d polylines and polygons.


But how to proceed? Convert 2d to 3d? Import the other Q files?   Contours retain the attached record data, but remain at z= 0.  They do not automatically move in z to the record value for ELEVATION.


Thanks for your insights!



Link to comment

@jeff prince @Tom W. @Benson Shaw thank you very much for looking at this.


@jeff prince yes I pulled these contours from QGIS (which I'm in a steep learning curve, I'm taking a fantastic online course which is a huge help) with the hopes of creating a site model. The model you created looks great, thanks! It might be a bit flatter than actual as my contour intervals where 2 meter.

Jeff I'm not sure how you discovered the Modify by record tool but it worked like a charm. I discovered that I made an error while exporting from QGIS as I did not extract the Z value correctly. No worries as VW has the tool to change this. Amazing.

I'm also surprised that the resulting model is pretty stable given it's 850 acres.

Thank you all so much for helping me learn more about this software. I

850 acre site model.jpg

  • Like 4
Link to comment
3 minutes ago, J. Wallace said:

The model you created looks great, thanks! It might be a bit flatter than actual as my contour intervals where 2 meter.

Jeff I'm not sure how you discovered the Modify by record tool but it worked like a charm.

Happy to help.

My model looked flatter because I assumed feet 🙂

I learned modify by record in one of the training classes on Vectorworks GIS.  In that class they took bldg footprints which had roof height records and turned them into massing models. I think that was the first thing I used it for too.


at 2:26 in this video, all the context bldgs were generated using “modify by record”.  You may recognize this project from our drone posts a while back 🙂



  • Like 4
Link to comment

Yes! Tools>Records>Modify by Record!  Duh. Couple years ago that's how I made those building outlines extrude to apex record height (but had to switch format from Number to Dimension).


The 2d polylines and polygons all moved to z = ELEVATION record value.

They remained 2d polys with OIP Plane designation as 3d.

In the Modify by Record command dialog, I needed to switch from the empty record format (from .shp) to the full one (from .db).

Still not clear on why that shp record format is empty.


The Terrain formed via AEC>Terrain>Site Model from Source Data.

Surprised (and pleased) that conversion to 3d poly not needed.

Terrain skirt is empty along top of NE edge (from the low corner).

In wire frame,Top, it looks like some of the mesh connects back through itself instead of to nearest neighbor.  The old bridging problem.

Otherwise looks really good.


Super helpfull all.




Edited by Benson Shaw
Dog searches for buried bone
Link to comment
On 10/26/2021 at 4:46 PM, J. Wallace said:

QGIS (which I'm in a steep learning curve, I'm taking a fantastic online course which is a huge help)

Could you please share what course it is? It may be useful for those (relatively) new to (Q)GIS so that I can refer people to that course if applicable.

Thanks in advance.

Link to comment

@Art V the course I'm taking is offered by the Regrarians...http://www.regrarians.org/qgis-for-mapping-and-design/

You get lifetime access the this online video course. For those who are not familiar with it,  the Regrarians platform is a farm design protocol based on a variety of applications such as Permaculture, Holistic management, PA Yeomens scale of permanence and other design approaches.



  • Like 3
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...