<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I am using a vector layer with text features on Polygon geometries. &nbsp;Relatively often the text label is drawn pretty far off the center of the polygon. &nbsp;My polygon is basically a rectangle with a rounded corner. &nbsp;Below is the WKT of it. &nbsp;When I do a getCentroid in OpenLayers it is different than if I do it in PostGIS. &nbsp;I think if the label was drawn at the PostGIS centroid it would be right. &nbsp;My site allows measurement, so I also tried getting the centroid of a geometry I traced with the rubberband tool. &nbsp;It also returned a Centroid more like I expected. &nbsp;<div><br></div><div>Many of the labels also appear to be correct. &nbsp;Am I missing something? &nbsp;Does it have to do with the geometry being Multipolygon? &nbsp;Any insight would be appreciated.</div><div><br></div><div>Geometry</div><div>MULTIPOLYGON(((-10842755.069337 3645931.096789,-10842790.775979 3645953.496622,-10842772.182218 3645984.113569,-10842743.492303 3645965.972283,-10842742.28656 3645964.787145,-10842741.293463 3645963.414273,-10842740.538336 3645961.898144,-10842740.044376 3645960.275967,-10842739.827709 3645958.592826,-10842739.889943 3645956.896071,-10842740.232706 3645955.23634,-10842740.843507 3645953.655201,-10842755.069337 3645931.096789)))</div><div><br></div><div>OpenLayers Centroid:</div><div><span class="Apple-style-span" style="font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; "><ol class="properties source-code" tabindex="0" style="-webkit-box-sizing: border-box; font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; padding-left: 6px; display: block; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 2px; padding-right: 6px; padding-bottom: 3px; list-style-type: none; list-style-position: initial; list-style-image: initial; min-height: 18px; "><li title="" style="-webkit-box-sizing: border-box; margin-left: 12px; white-space: nowrap; text-overflow: ellipsis; overflow-x: hidden; overflow-y: hidden; -webkit-user-select: text; cursor: auto; "><span class="name" style="-webkit-box-sizing: border-box; color: rgb(136, 19, 145); ">id</span><span class="separator" style="-webkit-box-sizing: border-box; ">:&nbsp;</span><span class="value" style="-webkit-box-sizing: border-box; ">"OpenLayers.Geometry.Point_492"</span></li><li title="" style="-webkit-box-sizing: border-box; margin-left: 12px; white-space: nowrap; text-overflow: ellipsis; overflow-x: hidden; overflow-y: hidden; -webkit-user-select: text; cursor: auto; "><span class="name" style="-webkit-box-sizing: border-box; color: rgb(136, 19, 145); ">x</span><span class="separator" style="-webkit-box-sizing: border-box; ">:&nbsp;</span><span class="value" style="-webkit-box-sizing: border-box; ">-10842792.853788493</span></li><li title="" class="selected" style="-webkit-box-sizing: border-box; margin-left: 12px; white-space: nowrap; text-overflow: ellipsis; overflow-x: hidden; overflow-y: hidden; -webkit-user-select: text; cursor: auto; "><span class="name" style="-webkit-box-sizing: border-box; color: rgb(136, 19, 145); ">y</span><span class="separator" style="-webkit-box-sizing: border-box; ">:&nbsp;</span><span class="value" style="-webkit-box-sizing: border-box; ">3645967.2444699085</span></li></ol></span><div><br></div></div><div>PostGIS Centroid</div><div>"POINT(-10842763.8558177 3645957.49366021)"</div><div><br></div><div><br></div><div>Rubberband Tool Geometry:</div><div><span class="Apple-style-span" style="font-family: Menlo, monospace; color: rgb(196, 26, 22); font-size: 11px; white-space: pre-wrap; ">POLYGON((-10842772.247212 3645983.9949693,-10842790.759305 3645953.5395909,-10842754.929448 3645931.1459303,-10842740.597505 3645955.0325016,-10842739.701759 3645957.7197409,-10842739.701759 3645961.3027266,-10842740.298923 3645962.7956373,-10842743.284744 3645965.7814587,-10842745.374819 3645967.2743694,-10842772.247212 3645983.9949693))</span></div><div><br></div><div>Rubberband Tool Centroid:</div><div><span class="Apple-style-span" style="font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; "><ol class="properties source-code" tabindex="0" style="-webkit-box-sizing: border-box; outline-style: none; outline-width: initial; outline-color: initial; font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; padding-left: 6px; display: block; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 2px; padding-right: 6px; padding-bottom: 3px; list-style-type: none; list-style-position: initial; list-style-image: initial; min-height: 18px; "><li title="" style="-webkit-box-sizing: border-box; margin-left: 12px; white-space: nowrap; text-overflow: ellipsis; overflow-x: hidden; overflow-y: hidden; -webkit-user-select: text; cursor: auto; "><span class="name" style="-webkit-box-sizing: border-box; color: rgb(136, 19, 145); ">id</span><span class="separator" style="-webkit-box-sizing: border-box; ">:&nbsp;</span><span class="value" style="-webkit-box-sizing: border-box; ">"OpenLayers.Geometry.Point_689"</span></li><li title="" style="-webkit-box-sizing: border-box; margin-left: 12px; white-space: nowrap; text-overflow: ellipsis; overflow-x: hidden; overflow-y: hidden; -webkit-user-select: text; cursor: auto; "><span class="name" style="-webkit-box-sizing: border-box; color: rgb(136, 19, 145); ">x</span><span class="separator" style="-webkit-box-sizing: border-box; ">:&nbsp;</span><span class="value" style="-webkit-box-sizing: border-box; ">-10842779.12432854</span></li><li title="" class="selected" style="-webkit-box-sizing: border-box; margin-left: 12px; white-space: nowrap; text-overflow: ellipsis; overflow-x: hidden; overflow-y: hidden; -webkit-user-select: text; cursor: auto; "><span class="name" style="-webkit-box-sizing: border-box; color: rgb(136, 19, 145); ">y</span><span class="separator" style="-webkit-box-sizing: border-box; ">:&nbsp;</span><span class="value" style="-webkit-box-sizing: border-box; ">3645962.747894722</span></li></ol></span><div><br></div></div></body></html>