I have gpkg features table where I have $x and $y columns and features info. I also have a gpkg table with a grid generated by QGIS with UTM coordinates in (left, top, right, bottom) for each square. Each square has a unique id.

When collecting data on the field (QField) in my features table, when I add a new feature, is there a way for QGIS/QField to autodetect the grid square id containing that new feature?

So the solution of Nelson worked quite well but both table have to be in the same SRID to work. I wonder if there is a field calculator function to convert the coordinates of one table virtually before launching the spatial query function.

  • Aggregate function doesn't require layers to be in the same SRID. But if you asking Transform function transforms geometry from one CRS to another.
    – BlackTesta
    Commented Sep 29, 2021 at 19:30
  • As per the help center please do not include chit chat like thanks in your posts.
    – PolyGeo
    Commented Sep 30, 2021 at 4:15

1 Answer 1


you can use Aggregate function. Same examples here in Spanish, but easy to understand https://www.linkedin.com/pulse/funci%25C3%25B3n-aggregate-en-qgis-38-mauricio-marquez

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.