1

How do you completely turn a shapefile (created with QGIS, including .shx and the other 4-5 files) into one tabular dataset.

I am actually doing this when I import the shapefile into Postgresql database, but I was wondering if there is the opportunity to do that in another way.

2
  • 2
    What do you mean 'turn into'? The dbf is just the attributes. It (and an Excel file which isn't even a database) are not capable of storing some of the information contained in those other files in a meaningful way. What exactly are you trying to do? – Chris W Apr 17 '15 at 20:54
  • @ChrisW I mean I want to see all the information of a layer, including id,columns I may have added and geometry information in a table. – drizo Apr 17 '15 at 21:04
1

I think what you want to do is create a CSV for the output, which in QGIS there are options on how to export the geometry.

Right-click the layer

Choose Save As

Choose Format - CSV

now notice the Layer Options settings > GEOMETRY

do you want your geometry stored as WKT, XY's, etc.?

In my example, I turned zip code polygon shapefiles into CSV using WKT.

Here's what the CSV looks like in LibreOffice Calc:

enter image description here

And here's the CSV in QGIS displaying the geometry in WKT:

enter image description here

Then you can simply save the CSV to an excel file or DBF from there...

6
  • 1
    when I do this it will turn the shapefile into a dbf, but I can't get the geometry features I have added in a column into the same table. I am mainly interested into the column that describes the geometry. – drizo Apr 17 '15 at 21:08
  • @drizo gotcha - updating answer shortly... – DPSSpatial_BoycottingGISSE Apr 17 '15 at 21:15
  • OH GOD THAT IS SO GOOD! I WAS SEARCHING FOR THIS FOR AGES! YOU SAVED MY ... YOU SAVED ME! – drizo Apr 17 '15 at 21:24
  • @drizo right on!!! Good luck!!! – DPSSpatial_BoycottingGISSE Apr 17 '15 at 21:24
  • 1
    ah ok my bad I found it – drizo Apr 17 '15 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.