[GIS] Why does QGIS generate Shapefiles without DBF

dbfqgisshapefile

I need to output shapefiles for archiving, which requires generating .shp, .shx and .dbf files. When I save a layer as a shapefile it generates the first two, but not the dbf. All the help I can find tells me how to import a dbf file but not export.

The dbf files will need to contain ID, X and Y fields.

Any ideas?

Best Answer

If you don't have a .dbf file, you probably have an empty attribute table.

To get the X and Y of a point layer, you have to add them to the attribute table using the field calculator. $X and $Y from the Geometry section will add the coordinate values. Be sure to change the field type to real, and set the precision greater than zero if using degrees.

For a line or polygon layer, you can export the coordinates of the line vertices with the mmqgis plugin to a CSV file.