4

I am trying to build some tool for a collegue of mine to query data from a spatialite database while clicking on vector features.

My first guess is, that I could do this with an "action" I define for the layer. The example actions provided for layers unfortunately do not give me any hint how to perform, and more detailed documentation on actions is quite absent.

I need a query, cause each feature in layer has many corresponding entries in the database table (one-to-many).

While performing the action, I would like to pop up simple table which lists the corresponding data sharing the same id as the feature.

In the example action, i can query an attribute of the layer with this:

echo "[% "id" %]"

which then looks like this: enter image description here

Ok, that's a start.

But what i need is a table which lists all items in a spatialite table with the same id-attribute as the feature.

My data structure:

Layer attribute: 
id

Data table: 
id | name | year

The layer itself is stored in the spatialite database too, if thats of any help.

Can anyone give me a hint on how to proceed?

0

1 Answer 1

2

I do this with:

echo [% "id" %]," [% "name" %], [% "year" %]

OBSERVATION:

  • If you have two or more point in the same local, you will get only one response.

I need the next response, if someone knows how to do:

id  name   year     (for point 3) 
id  name   year     (for point 3)    
id  name   year     (for point 3)

example:

17   Elsa   1985    
17   Ana    1991    
17   Olaf   2011

Your Answer

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

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