1

I have a line-layer and want to style the line by using a data-table with no geography - I am using GeoPackage.

With other words, how can i get a field-value (i have two fields for filtering the unique entry) from the 2nd table in the field calculator to set the stroke / line width?

8
  • 4
    Have you tried using join attributes by field value and then using the data-defined symbology?
    – Erik
    Commented Jun 26, 2019 at 13:38
  • 1
    @Erik It could also be done simply with a join from the layer properties.
    – Gabriel
    Commented Jun 26, 2019 at 13:41
  • Are there any examples out there? I'd like to change the value in the "data / 2nd table" and the line-layer should be repainted with this given values immedately.
    – L.W.
    Commented Jun 26, 2019 at 16:29
  • If I am right, then this join needs to add some extra fields in any attribute table? If so, than this is not what i want, I want to have something like "SELECT strokewidth FROM tablelayout WHERE t="XX" and st="YX" LIMIT 1;". And yes, i want to use it = result in the data-definied symbology. But I do not want to have all symbology-data in every layer's attribute table. I have more then one field to mach in the 2nd table for joining the data, the joining by field is for one field only I think.
    – L.W.
    Commented Jun 26, 2019 at 20:07
  • 1
    Have a look at the functions in the "records and attributes" section of the Field Calculator. EG, this expression will retrieve the strokewidth value of the first feature of the tablelayout layer where t=XX: attribute( get_feature( 'tablelayout','t','XX'), 'strokewidth')
    – csk
    Commented Jun 27, 2019 at 22:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.