ASFAIK, the centroid has not to be on the surface of you geometry. Image an circle as outer polygon and a circle as inner polygon. This forms a geometry looking like a ring. The centroid will be within the inner circle, but this area is not part of the ring geometry. As a consequence, there is no Z value.
Have you tried with pointOnSurface ? Quoting LSA <[email protected]>: > Hi everyone, > > Does anybody knows, how to get > com.vividsolutions.jts.algorithm.CentroidPoint (and CentroidLine and > CentroidArea) to handle Z coordinates? > > The centroid returned always has NaN instead of valid Z coordinate.... > > Thanks! > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
