public static Double getX(Geometry geometry) {
        if(geometry==null) {
            return null;
        }
        return geometry.getCoordinate().x;
    }
public static Double getX ( Geometry geometry ) { if ( geometry == null ) { return null ; } return geometry . getCoordinate ( ) . x ; }
@param geometry Geometry instance
@return A x coordinate or null if null or empty geometry.