2

I used QGIS to find the extents of a list of features from a census boundaries shapefile.

I used Vector - Research tools - Polygon From Layer Extent, which creates a new shapefile with a table of extent values for each feature.

However, I need to join this new table with the old one so that I have the extent values as well as other necessary fields from the original source shapefile. And the new extent shapefile doesn't have a join field.

Is there a way to join a polygon extent layer with its original source layer? I can try adding a new column to both tables with ordered numbers, but are the extent tables produced with the same ordering as their source?

  • In my opinion, the lack of attributes in the resulting output could be considered a bug or at least a serious missing feature. Would be worth a bug report. – underdark Sep 15 '14 at 17:25
3

Well, if you really don't have a join field then you'll have to do a spatial join. You can join features on the extent layer with features on the original layer using the within filter (that is, features in the original layer should be inside features on the extents layer).

That works unless one geometry in the original layer completely contains another geometry in the same layer: Another, safer, approach is to use a intermediate point layer. Calculate the centroids from the extents layer and perform the spatial join from there.

Hope this helps

  • 1
    Thanks. Do you think a basic spatial join: Data Management Tools - Join attributes by location, would work? – user2559519 Sep 15 '14 at 2:43
  • 1
    Give it a try and find out :). Attributes will be joined provided they are within the same proximity. – Joseph Sep 15 '14 at 10:31
  • Thanks. I tried two methods: Saving the files as csv files and adding a column to both files with ordered numbers, and doing a basic spatial join. Both returned the same results. I cross-tested the results with the original files, so looks like both methods work. – user2559519 Sep 19 '14 at 7:57

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.