<div dir="ltr"><div>Manual says: "<span style="color:rgb(46,46,46);font-family:"lucida grande",verdana,geneva,arial,helvetica,sans-serif;font-size:13.3333px">This function supports 3d and will not drop the z-index."</span></div><div><span style="color:rgb(46,46,46);font-family:"lucida grande",verdana,geneva,arial,helvetica,sans-serif;font-size:13.3333px"><br></span></div><div><span style="color:rgb(46,46,46);font-family:"lucida grande",verdana,geneva,arial,helvetica,sans-serif;font-size:13.3333px">This indeed works as per documentation example: </span></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">SELECT ST_AsEWKT(ST_PointOnSurface(ST_GeomFromEWKT('LINESTRING Z(0 5 1, 0 0 1, 0 10 2)'))); </font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">Returns: "POINT(0 0 1)"</font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif"><br></font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">This doesn't:</font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">SELECT ST_AsEWKT(ST_PointOnSurface(ST_GeomFromEWKT('POLYGON Z((14 14 10,20 10 150,34 6 25,14 14 10))')))<br></font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">Returns: "POINT(18 12)"</font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif"><br></font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">Inspired by: <a href="http://gis.stackexchange.com/questions/216212/how-to-create-points-grid-on-a-3d-surface-with-geometry-polygonz-in-postgis">http://gis.stackexchange.com/questions/216212/how-to-create-points-grid-on-a-3d-surface-with-geometry-polygonz-in-postgis</a></font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">and: <a href="http://gis.stackexchange.com/questions/201161/postgis-st-pointonsurface-and-st-centroid-dropping-z">http://gis.stackexchange.com/questions/201161/postgis-st-pointonsurface-and-st-centroid-dropping-z</a></font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif"><br></font></div><div><span style="color:rgb(46,46,46);font-family:"lucida grande",verdana,geneva,arial,helvetica,sans-serif">I guess GEOS is just not capable of doing this, but the documentation is not clear about that and implies that PolygonZ would work just as LinestringZ would work.</span><br></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif"><br></font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif">Best,</font></div><div><font color="#2e2e2e" face="lucida grande, verdana, geneva, arial, helvetica, sans-serif"> Tom</font></div></div>