...
Name | Default |
---|---|
mark-type | circle |
mark-size | 10 |
mark-opacity | 1 |
mark-rotation | 0 |
Joining Tables
From 2.6.4 it's possible to join to another table if the underlying spatial engine is using a database, i.e. this won't work for shapefiles for example.
This would for example provide the ability to filter the rows displayed on the map based on the value in a column in a table different from the one containing the geometry. To join the additional table you need to add a <join/> tag with the information about the other table (which must be in the same database) and how it is joined to the source table. Additionally you can set the type of join, inner or outer, and add a filter for the extra table.
Code Block |
---|
<layer id="my_active_incidents" label="My Active Incidents" layer="GIS.INCIDENTS" style="incidents">
<join>
<type>inner</type> <!-- this is the default, and will result in only the rows that are in both tables being displayed -->
<table>GIS.INCIDENT_DETAILS</table> <!-- The name of the table to join to GIS.INCIDENTS -->
<where>ID = ID</where> <!-- The columns in the two tables to join, must always be an equals -->
<filter>STATUS = 'ACTIVE'</filter> <!-- An additional filter to further reduce the rows that are displayed -->
<filter>USERID = '${user.id}'/> <!-- Another filter, this time selecting rows that belong to the current user -->
</join>
</layer> |
Join
Name | Type | Carnality | Default | Description |
---|---|---|---|---|
table | string | 1..1 | The name of the table to join to the source table | |
where | string | 1..1 | A description of the join between the two columns. This should always be a X = Y type of expression where X is the column in the source table and Y is the column in the extra table. The rows from the two tables will be matched based on the values in the X column in the source table having the same value as the Y column in the target table. | |
type | 'outer' or 'inner' | 0..1 | 'inner' | Should the join between the two tables be an inner join, only rows in both tables are returned, or an outer join, rows in the source table are still returned even if they don't have a matching row in the extra table |
filter | string | 0..n | This is a ECQL expression that will be applied to the extra table to filter the rows that should be included, this includes support for user attributes. |