There is a polygon geometry in my QGIS project which represents the extents of my map. Does anybody know how to use the data defined override to get the X/Y min and X/Y max coordinates of the polygon in the print composer?

enter image description here

Unfortunately this isn't working:

xmin(attribute(getFeature('layername', 'gid', 1), 'geom'))

The geometry can be accessed directly rather than through the attributes:

x_min(geometry(getFeature('airports', 'cat', 1)))
  • Yeah, works fine using 'xmin' instead of 'x_min'! – Lunar Sea Jun 7 '15 at 19:40

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.