2

I would like to create a centroid of a polygon (type geometry) such that the centroid falls inside of the polygon

I have tried with function shape.STCentroid() which is creating the centroid but for my shape/polygon the centroid is falling outside of the polygon

Spatial result centroid is falling outside of the polygon as polygon is a '<' shaped polygon and centroid looks like '<.'

enter image description here

Ian Turton
  • 10,018
  • 1
  • 28
  • 47
santhoshbs
  • 21
  • 3

1 Answers1

0

If you only require the point to be in the polygon you can use STPointOnSurface, which will always be in the polygon. If you want a "good" point you may want to look into the pole of inaccessibility, see this question for more details.

Ian Turton
  • 10,018
  • 1
  • 28
  • 47