1

I'm working with a SqlGeometry SqlServer DB and am a novice to GIS. I'm tasked with getting the centroid of a series of geometries from C#'s SqlGeometry object. This is fine as it has a GetCentroid method, but it blows up when I try to get the centroid of lines and multilines.

Is averaging the points for lines and multilines a valid method of getting the centroid? If not, why not?

1
  • GSE has a one question, one-answer model. Please rewrite to focus on the most important question, and post others to address other questions
    – Vince
    Commented Nov 7, 2014 at 17:05

1 Answer 1

3

There are a number of definitions to "centroid", but the most common solution for labeling a linear feature involves either the midpoint along the arc or the midpoint of the longest segment on the arc. Averaging the vertices is unlikely to be "on" the feature and will over-emphasize the significance of short segments. If it's acceptable for the label to be "off" the feature, then weighting the midpoints of segments by segment length is more likely to produce a "better" average location.

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.