5

In QGIS 2.14.10 I've set up a simple model to assign min and max of attributes of a point layer (adresses, about 2500 features) to a polygon layer (parcels, about 14000 features) to polygons containing the points (hint: polygons were created with polygonize algorithm, so these should have valid topology):

enter image description here

The 'Join attributes by location' algorithm is set up like this:

enter image description here

The resulting bla polygon layer is created, but has zero features:

enter image description here

After some playing around, I found that turning of on-the-fly-projection solved my issue ...

enter image description here

... but unfortunatly not for long. So toggeling on-the-fly-projection sometimes helps, but the behaviour of 'Join attributes by location' algorithm does not seem to depend on whether OTF projection is ON or OFF and is, furthermore, unpredictable when toggling OTF projection.

Am I missing something in modeler, or is there any advice of using this algorithm in the context of OTF projection?

  • Is the CRS of the output layer the same as the input layers? – Joseph Jan 11 '17 at 13:36
  • yep, both epsg:31468 – Jochen Schwarze Jan 11 '17 at 13:39
  • Does it work all the time outside the modeler? – Joseph Jan 11 '17 at 13:50
  • as far as i can see until now, yes. – Jochen Schwarze Jan 11 '17 at 14:11
  • 1
    Because your are dealing with points and polygons, I suggest you using the "intersects" predicate (because it is faster and it could probably solve your problem). – mgri Jan 11 '17 at 15:46
2

Try adding a custom script into your modeler instead of calling the tool directly and see if it makes a difference:

##Join_attributes_by_location=name
##Layer_1=vector
##Layer_2=vector
##Output=output vector

layer_1 = processing.getObject(Layer_1)
layer_2 = processing.getObject(Layer_2)

processing.runalg("qgis:joinattributesbylocation", layer_1, layer_2, u'contains', 0, 1, 'min,max', 0, Output)

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.