0

I am trying to work out centroid of a polygon, but I need this in British National Grid.

Does anyone know a way of getting it to work in QGIS 3.10?

4
  • Trying to work out a way to get the centroid of a polygon and show it as a BNG value rather than in XY. I know it will need doing in field calculator.
    – mh_perth
    Sep 21, 2020 at 15:47
  • What is the coordinate system of your data?
    – BERA
    Sep 21, 2020 at 15:50
  • 27700 so is BNG.
    – mh_perth
    Sep 21, 2020 at 15:52
  • have got the current code to work, but not happy with the fact that I have to enter the OS grid square manually. concat ('NH') ||(right(left(x($geometry),4),3)) || right(left(y($geometry),4),3)
    – mh_perth
    Sep 21, 2020 at 15:53

1 Answer 1

1

It sounds like you need my experimental QGis plugin which gives you the gridSquare function to use in labels etc. The first argument controls how many digits you get from 100 giving TF to .001 giving TF3928703326.

enter image description here

4
  • Ian, will give that a go, really useful.
    – mh_perth
    Sep 23, 2020 at 8:13
  • Ian, just tried it and works perfectly. thank you.
    – mh_perth
    Sep 23, 2020 at 9:39
  • Is there a way it could be altered to allow for 12 figures, the government has a habit of wanting the grid square then 10 figures after.
    – mh_perth
    Sep 23, 2020 at 13:23
  • So TF3928703326 - you set the size parameter to 0.001 for that (I don't support the TF3928703326SW format but if you need raise an issue on the plugin)
    – Ian Turton
    Sep 23, 2020 at 14:44

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.