Timeline for 3D centroid in PostGIS
Current License: CC BY-SA 4.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 12, 2023 at 20:23 | comment | added | geozelot |
The simple shoelace algorithm at the core of the centroid computation cannot consider z-coordinates. Yet, the weighted centroid of a Polygon parallel projected onto the x,y-plane (i.e. ignore the z-value) will have the correct x,y coordinates of the weighted centroid of the original Polygon Z - only the z-coordinate is not equally trivial to derive. You could take the ST_3DIntersection of a LineString starting at the ST_Centroid and going z-wards, and the original Polygon Z and take the ST_Z - or dive a little into vector math.
|
|
S Jan 12, 2023 at 16:41 | answer | added | swiss_knight | timeline score: 1 | |
S Jan 12, 2023 at 16:41 | history | asked | swiss_knight | CC BY-SA 4.0 |