Project: QGIS

Version: 2.14.0

Feature: New expression functions in 2.14

Lots of new expression functions have been added for version 2.14:

  • relate: performs DE-9IM geometry relations by either returning the DE-9IM representation of the relationship between two geometries, or by testing whether the DE-9IM relationship matches a specified pattern.
  • the make_point function now accepts optional z and m values, and a new make_point_m function has been added for creation of PointM geometries.
  • m and z functions for retrieving the m and z values from a point geometry
  • new make_line and make_polygon functions, for creation of line and polygon geometries from a set of points
  • reverse, for reversing linestrings
  • eval function, which can evaluate a string as though it is an expression of its own
  • translate function, for translating geometries by and x/y offset
  • darker and lighter functions, which take a color argument and make it darker or lighter by a specified amount
  • radians and degrees: for converting angles between radians and degrees
  • point_on_surface: returns a point on the surface of a geometry
  • exterior_ring: returns the exterior ring for a polygon geometry
  • is_closed: returns true if a linestring is closed
  • new geometry accessor functions: geometry_n (returns a specific geometry from within a collection), interior_ring_n (returns an interior ring from within a polygon)
  • num_geometries: returns number of geometries inside a collection
  • num_rings: returns number of rings in a polygon geometry object
  • num_interior_rings: returns number of interior rings in a polygon
  • nodes_to_points, for converting every node in a geometry to a multipoint geometry
  • segments_to_lines, for converting every segment in a geometry to a multiline geometry
  • closest_point: returns closest point a geometry to a second geometry
  • shortest_line: returns the shortest possible line joining two geometries

nodes_to_points and segments_to_lines are intended for use with geometry generator symbology, eg to allow use of m and z values for nodes/lines with data defined symbology.

Other improvements:

  • geometries and features can now be used in conditional functions. For instances, this allows expressions like case when $geometry then ... else ... and case when get_feature(...) then ... else ...