1

I am using QGIS. I have three different study sites on an island, and have defined these as three polygons using 'clip'. I want to export the geometry data so I could import it into 'Distance' for study design - however, the polygons have an attribute table that is basically empty. Therefore when I try and export, I get .csv file which only contains the column headings "shapeid" "x" and "y" but no data.

I'm not sure what I have done wrong. The original shapefile that I used as base for clipping has a full attribute table with many points.

5
  • 1
    Welcome to GIS:SE @Katherine! Did you ensure that the CRS (Coordinate Reference System) for both layers and projection are the same? Commented Sep 8, 2017 at 10:41
  • Are the datatypes for your new table the exact same as the original? Commented Sep 8, 2017 at 12:28
  • Try using the Intersection tool instead of the Clip tool. Commented Sep 8, 2017 at 16:14
  • 1
    It seems to me you're mixing geometry data (the shape of the polygon) and attribute data (the table data) in your title. Commented Sep 9, 2017 at 7:51
  • I suspect you're right that I am mixing up attribute and geometry data. I guess my underlying problem is that when I try and bring the polygons into Distance, they don't have any geometry data. I found another answer which helped me export as a .csv (MMQGIS plugin) and it was supposed to give me the attribute table and the geometry (I think) as two separate .csv files but the geometry one was empty as described above. Commented Sep 10, 2017 at 23:09

2 Answers 2

1

I suggest you restart your work one step at a time :

  • Check the layers CRS . Make sure they are the same (@Joseph's idea in the comments)
  • Check if the layer you are cutting has the attributes you want to keep. If you want to keep the clipper (=the scissors) layer attributes, it's not the right way of doing. f you need to keep every attributes from both layers, you will need to have a look at the Intersect tool for example (@csk idea)
  • Use a tool from the processing panel

Clip tools

  • Open your layer and check
  • Only after can you export the result
  • If it doesn't do what you need, check the options in the CSV export
1

You can print out the polygon coordinates with these PyQGIS code:

path="d:/stackexchange/" filename = "polygon" layer = QgsVectorLayer(path + filename + ".shp", filename, "ogr") iter = layer.getFeatures() for feature in iter: print feature.geometry().asPolygon() 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.