2

I have a task which I’m sure is quite common, but being new to QGIS I’m hoping someone can point me in the right direction. I have a point layer with PLANT_ID and SPECIES of individual plants, and three polygon layers: SOIL, DRAINAGE, and CANOPY. For each individual plant, I would like to add three attributes, one for each of the three polygon layers. The result would be something like this:

enter image description here

So for this example, Plant 1 was Species A, and it was located in a SOIL polygon with attribute Soil 1, and was located in a DRAINAGE polygon with attribute Drainage 4, and was located in a CANOPY polygon with attribute Canopy 4. I suspect that this has something to do with a Spatial Join in MMQGS, but I've played around with that and was not able to get what is shown in the table above.

Beyond this, I was planning to apply some data mining techniques to create a decision tree like this:

If SOIL 1 and DRAINAGE 2 and CANOPY 3, then SPECIES D

Might there be a QGIS function that would create this type of tree?

closed as too broad by artwork21, whyzar, Mapperz Jun 7 '17 at 14:40

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Please edit your question and only ask one question. Right now you have two questions within your question. – artwork21 Jun 7 '17 at 12:41
4

I realized that easiest and fastest way for you is to use Point Sampling Tool plugin, which I normally use for retrieving raster data, but on polygons it works the same. The advatage is that you can create joined layer only with selected attributes (ctrl + left mouse) and only in one step.

enter image description here

Original solution before edit:

You can use Join attributes by location function from Processing toolbox. This creates new layer with joined attribute table based on spatial interaction of two layers:

enter image description here

  • as Target vector layer set SPECIES points
  • as Join vector layer set CANOPY (or other polygon layer with variable)
  • as joining option choose intersetcs
  • in option Joined table you can set keeping all points even if they don't recieve any value
  • for joining next variables repeat the process (as target input set previous joined layer), or create model with Graphical modeler, for example like this:

enter image description here

2

Try intersecting (using intersect tool in geoprocessing) the polygon layer with the point layer. It should return a new point shapefile with combined attributes.

For the data mining, you can go some steps from select by attributes and build your SQL based on SOIL, DRAINAGE, and CANOPY, and then assign the SPECIES using field calculator.

  • After thrashing around a bit, the MMQGIS plugin worked well. I still had to do soil, drainage, and canopy separately and then combine the results, but that was pretty easy to do. So this problem is solved! – Mark Polczynski Jun 12 '17 at 20:07

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